pycram.ros_utils.object_state_updater#

Classes#

RobotStateUpdater

Updates the robot in the World with information of the real robot published to ROS topics.

EnvironmentStateUpdater

Updates the environment in the World with information of the real environment published to ROS topics.

Module Contents#

class pycram.ros_utils.object_state_updater.RobotStateUpdater(tf_topic: str, joint_state_topic: str)#

Updates the robot in the World with information of the real robot published to ROS topics. Infos used to update the robot are:

  • The current pose of the robot

  • The current joint state of the robot

Note

This class can only be used if the topics are present in the RSO network on the real robot/world,

hence it is not testable in the CI.

tf_listener#
tf_topic#
joint_state_topic#
tf_timer#
joint_state_timer#
_subscribe_tf(msg: geometry_msgs.msg.TransformStamped) None#

Callback for the TF timer, will do a lookup of the transform between map frame and the robot base frame.

Parameters:

msg – TransformStamped message published to the topic

_subscribe_joint_state(msg: sensor_msgs.msg.JointState) None#

Sets the current joint configuration of the robot in the world to the configuration published on the topic. Since this uses rospy.wait_for_message which can have errors when used with threads there might be an attribute error in the rospy implementation.

Parameters:

msg – JointState message published to the topic.

_stop_subscription() None#

Stops the Timer for TF and joint states and therefore the updating of the robot in the world.

class pycram.ros_utils.object_state_updater.EnvironmentStateUpdater(tf_topic: str, joint_state_topic: str)#

Updates the environment in the World with information of the real environment published to ROS topics. Infos used to update the envi are:

  • The current pose of the environment

  • The current joint state of the environment

Note

This class can only be used if the topics are present in the RSO network on the real robot/world,

hence it is not testable in the CI.

tf_listener#
tf_topic#
joint_state_topic#
joint_state_timer#
_subscribe_joint_state(msg: sensor_msgs.msg.JointState) None#

Sets the current joint configuration of the environment in the world to the configuration published on the topic. Since this uses rospy.wait_for_message which can have errors when used with threads there might be an attribute error in the rospy implementation.

Parameters:

msg – JointState message published to the topic.

_stop_subscription() None#

Stops the Timer for TF and joint states and therefore the updating of the environment in the world.