RASG Supporting Tools API Reference
rviz_marker_publisher.pose_tools module
A supporting module rviz_marker_publisher.
- rviz_marker_publisher.pose_tools.list_to_pose(pose) geometry_msgs.msg.Pose
Convert a pose in xyzrpy or xyzq format to Pose.
- Parameters:
pose – s pose in a list format of xyzrpy or xyzq
- Returns:
a Pose object with the same pose
- rviz_marker_publisher.pose_tools.list_to_pose_stamped(pose: list[float], frame: str, rostime: rclpy.time.Time = None) geometry_msgs.msg.PoseStamped
Convert a pose in xyzrpy or xyzq format in a reference frame to PoseStamped.
- Parameters:
pose – a pose in a list format of xyzrpy or xyzq
frame – the reference frame of type str
rostime – the current ros time, or None if a simulated time is used
- Returns:
a Pose object with the same pose
- rviz_marker_publisher.pose_tools.list_to_xyzq(pose) list
Convert a pose in xyzrpy or xyzq format to xyzq format.
- Parameters:
pose – a pose in a list format of xyzrpy or xyzq
- Returns:
a list of the format xyzqqqq with the same pose
- rviz_marker_publisher.pose_tools.list_to_xyzrpy(pose) list
Convert a pose in xyzrpy or xyzq format to xyzrpy format.
- Parameters:
pose – a pose in a list format of xyzrpy or xyzq
- Returns:
a list of the format xyzrpy with the same pose
- rviz_marker_publisher.pose_tools.pose_stamped_to_point_stamped(pose_stamped: geometry_msgs.msg.PoseStamped) geometry_msgs.msg.PointStamped
Convert a PoseStamped object into PointStamped object.
- rviz_marker_publisher.pose_tools.pose_stamped_to_transform_stamped(pose_stamped: geometry_msgs.msg.PoseStamped, reference_frame: str) geometry_msgs.msg.TransformStamped
Convert a PoseStamped object into TransformStamped object.
- rviz_marker_publisher.pose_tools.pose_to_xyzq(pose) list
Convert a pose in Pose or PoseStamped format to xyzq format.
- Parameters:
pose – the pose of type Pose or PoseStamped
- Returns:
a list of the format xyzqqqq with the same pose
- rviz_marker_publisher.pose_tools.pose_to_xyzrpy(pose) list
Convert a pose in Pose or PoseStamped format into xyzrpy format.
- Parameters:
pose – the pose of type Pose or PoseStamped
- Returns:
a list of the format xyzrpy with the same pose
- rviz_marker_publisher.pose_tools.same_joint_values_with_tolerence(joint_values_1: list, joint_values_2: list, tolerance: float = 0.1) bool
Test if the two sets of joint values are the same.
- Parameters:
joint_values_1 (list) – the first set of joint_values
joint_values_2 (list) – the second set of joint values
tolerance (float) – the absolute tolerance for the comparison
- Returns:
True if the two sets of joint values are deemed the same
- Return type:
bool
- rviz_marker_publisher.pose_tools.same_pose_with_tolerence(pose_1, pose_2, tolerance: float = 0.01) bool
Test if two poses are the same within a tolerance of each other.
- Parameters:
goal (A list of floats or a Pose) – A pose
actual (A list of floats or a Pose) – another pose
tolerance (float) – the absolute tolerance for the comparison
- Returns:
True if the goal and actual are the same
- Return type:
bool
- rviz_marker_publisher.pose_tools.same_rpy_with_tolerence(rpy_1: list, rpy_2: list, tolerance: float = 0.01) bool
Test if two euler’s angles are the same.
- Parameters:
rpy_1 (list) – the first orientation in euler’s angle
rpy_2 (list) – the second orientation in euler’s angle
tolerance (float) – the absolute tolerance for the comparison
- Returns:
True if the two orientations are deemed the same
- Return type:
bool
- rviz_marker_publisher.pose_tools.same_xyz_with_tolerence(xyz_1: list, xyz_2: list, tolerance: float = 0.01) bool
Test if two positions are the same.
- Parameters:
xyz_1 (list) – the first position in xyz
xyz_2 (list) – the second position in xyz
tolerance (float) – the absolute tolerance for the comparison
- Returns:
True if the two orientations are deemed the same
- Return type:
bool
- rviz_marker_publisher.pose_tools.transform_to_pose_stamped(transform_stamped: geometry_msgs.msg.TransformStamped) geometry_msgs.msg.PoseStamped
Convert a TransformStamped object into PoseStamped object. An alternative implementation.
rviz_marker_publisher.logging_tools module
A supporting module for rviz_marker_publisher.
- class rviz_marker_publisher.logging_tools.TimeLogger
Bases:
objectLog the amount of time taken in a profiling task.
- append_results_to_csv(id: str, csv_file: str) None
APpend the timing results to the end of the csv file.
- Parameters:
id (str) – The id to be added
csv_file (str) – the csv file where the results are stored
- get_time_since_start() float
Return the time since the start.
- Returns:
the time since the start in seconds
- Return type:
float
- take(name: str)
Take the time.
- Parameters:
name (str) – the name attached to the timestamp
- rviz_marker_publisher.logging_tools.get_logger(name='rviz_marker_publisher', level: int = 20, silent: bool = False, logging_file: str | None = None, logging_file_level: int | None = None) Logger
Create or get an existing logger givne the name and optionally the level, slient mode, and whether the log is written to a file.
- Parameters:
name (str, optional) – the name of the logger, defaults to DEFAULT_LOGGER_NAME
level (int, optional) – the logging level, defaults to logging.INFO
silent (bool, optional) – if True, no display on the screen, defaults to False
logging_file (str, optional) – if provided, the log messages are also written to a log file given in this parameter, defaults to None
logging_file_level (int, optional) – the logging level of messages to be written to a log file, defaults to None
- Returns:
an instance of the logger
- Return type:
logging.Logger