diff --git a/src/pycram/process_modules/pr2_process_modules.py b/src/pycram/process_modules/pr2_process_modules.py index 9736d1222..50e07adf5 100644 --- a/src/pycram/process_modules/pr2_process_modules.py +++ b/src/pycram/process_modules/pr2_process_modules.py @@ -87,14 +87,13 @@ def _execute(self, desig: DetectingMotion): robot = World.robot object_type = desig.object_type # Should be "wide_stereo_optical_frame" - cam_frame_name = RobotDescription.current_robot_description.get_camera_frame() + camera_link_name = RobotDescription.current_robot_description.get_camera_link() # should be [0, 0, 1] camera_description = RobotDescription.current_robot_description.cameras[ list(RobotDescription.current_robot_description.cameras.keys())[0]] front_facing_axis = camera_description.front_facing_axis objects = World.current_world.get_object_by_type(object_type) - camera_link_name = [link.name for link in robot.links.values() if link.tf_frame == cam_frame_name][0] for obj in objects: if btr.visible(obj, robot.get_link_pose(camera_link_name), front_facing_axis): return obj diff --git a/src/pycram/world_concepts/world_object.py b/src/pycram/world_concepts/world_object.py index 9a3c0b237..dde2bf08a 100644 --- a/src/pycram/world_concepts/world_object.py +++ b/src/pycram/world_concepts/world_object.py @@ -814,7 +814,11 @@ def joint_states(self, joint_states: Dict[int, JointState]) -> None: :param joint_states: A dictionary with the joint id as key and the current state of the joint as value. """ for joint in self.joints.values(): - joint.current_state = joint_states[joint.id] + if joint.name not in self.robot_virtual_move_base_joints_names(): + joint.current_state = joint_states[joint.id] + + def robot_virtual_move_base_joints_names(self): + return self.robot_description.virtual_move_base_joints.names def remove_saved_states(self) -> None: """