diff --git a/docs/examples/03_backends_ros/files/03_forward_kinematics.py b/docs/examples/03_backends_ros/files/03_forward_kinematics.py index d79716acc..04fff85bc 100644 --- a/docs/examples/03_backends_ros/files/03_forward_kinematics.py +++ b/docs/examples/03_backends_ros/files/03_forward_kinematics.py @@ -11,6 +11,8 @@ robot_cell_state = RobotCellState.from_robot_cell(robot_cell) robot_cell_state.robot_configuration.joint_values = [-2.238, -1.153, -2.174, 0.185, 0.667, 0.0] + + # When using the forward_kinematics() method with TargetMode.ROBOT, the last link of the robot's main group is used. frame_WCF = planner.forward_kinematics(robot_cell_state, TargetMode.ROBOT) print("Frame in the world coordinate system") diff --git a/docs/examples/03_backends_ros/files/03_forward_kinematics_with_tools.py b/docs/examples/03_backends_ros/files/03_forward_kinematics_with_tools.py index 469347aad..ae2d3b87b 100644 --- a/docs/examples/03_backends_ros/files/03_forward_kinematics_with_tools.py +++ b/docs/examples/03_backends_ros/files/03_forward_kinematics_with_tools.py @@ -6,13 +6,20 @@ from compas_fab.backends import MoveItPlanner with RosClient() as client: + planner = MoveItPlanner(client) + + # Loading the robot cell with tool and workpiece from the RobotCellLibrary robot_cell, robot_cell_state = RobotCellLibrary.ur5_gripper_one_beam(client) - planner = MoveItPlanner(client) + # Check that the robot in the ROS MoveIt backend is the same as the one in the RobotCellLibrary + client.load_robot_cell(False) + assert client.robot_cell.root_name == robot_cell.root_name + + # Set the tool and workpiece in the ROS MoveIt backend planner.set_robot_cell(robot_cell) + # Modify the default robot_cell_state to change the robot's configuration and the attachment location of the beam robot_cell_state.robot_configuration.joint_values = [-2.238, -1.153, -2.174, 0.185, 0.667, 0.0] - # Change the attachment location (grasp) of the beam robot_cell_state.rigid_body_states["beam"].attachment_frame = Frame( [0.0, 0.0, -0.1], [1.0, 0.0, 0.0], [0.0, 1.0, 0.0] )