The PAL Whole Body Control (WBC) is PAL’s implementation of the Stack of Tasks1. It includes a hierarchical quadratic solver that runs at 100 Hz, that is able to accomplish different tasks with different priorities assigned to each of them. To accomplish the tasks, the WBC can take control of all the joints of the robot. When WBC starts an already predefined stack with a set of task is started. The set of task includes (from highest to lowest priority):
- Joint limit avoidance: to ensure joint limits are never reached.
- Self-collision avoidance: to prevent the robot from colliding with itself while moving.
- Cartesian position control: to command the robot end effector in cartesian space (position).
- Cartesian orientation control: to command the robot end effector in carteisan space (orientation).
- Gaze control: to control the head to look at a specific point in cartesian space.
- Reference posture: to define the default postural configuration of the robot in joint space.
Ensure you have a running TIAGo robot or an active simulation with ros2 control.
Deactivate the existing controllers before activating WBC:
ros2 control switch_controllers --deactivate arm_controller torso_controller head_controller
ros2 launch tiago_wbc tiago_wbc.launch.py
RViz2 is used to visualize and interact with the controller.
- Open RViz2:
ros2 run rviz2 rviz2
- Click the
Add
button (bottom left). - Select
RobotModel
from theBy display type
page. - Set the
Fixed Frame
(underGlobal Options
) tobase_link
. - Expand the
RobotModel
tab and setDescription Topic
to/robot_description
.
pal_connect
.
- Click the
Add
button again. - Go to the
By topic
page. - Find
/arm_tool_link_marker
and double-clickInteractiveMarkers
. - Repeat for
/head_front_camera_optical_frame_marker
.
Once added, moving these markers will control the TIAGo model in RViz, which should also reflect in the Gazebo simulation or the real robot.
By default, all tasks are activated. You can manually activate a specific task if it has been deactivated or started inactive.
ros2 service call /pal_wbc_controller/activate_task pal_wbc_msgs/srv/ActivateTask "name: ''
order:
order: 0
blend: false
blending_duration:
sec: 0
nanosec: 0"
Use caution when deactivating tasks. Deactivating joint limits or self collision might damage the robot.
ros2 service call /pal_wbc_controller/deactivate_task pal_wbc_msgs/srv/DeactivateTask "name: ''
blend: false
blending_duration:
sec: 0
nanosec: 0"
Retrieve a list of all tasks with descriptions.
ros2 service call /pal_wbc_controller/stack_description pal_wbc_msgs/srv/GetStackDescription "{}"
This removes a task completely—it cannot be reactivated using activate_task
.
ros2 service call /pal_wbc_controller/pop_task pal_wbc_msgs/srv/PopTask "name: 'cartesian_position'
blend: false
blending_duration:
sec: 0
nanosec: 0"
Edit, add, or remove tasks in the config/default_kinematic_stack.yaml
file. This file defines the available tasks and its parameters for the TIAGo robot, allowing customization.
Ensure that any modifications align with the overall task structure and maintain compatibility with the robot’s motion planning framework.
-
pal_references::InteractiveMarkerReference
: The end effector is controlled by moving the interactive marker in RViz2. -
pal_references::TopicPoseReference
: The end effector is controlled via a topic that publishes ageometry_msgs/msg/Pose
. The topic name follows the pattern<link_name>_pose
. In this case, it would be/arm_tool_link_pose
. This is visualizable in rvizz as/visualization_markers
as a MarkerArray.
To adjust parameters dynamically, use rig_reconfigure
:
ros2 run rig_reconfigure rig_reconfigure
Find the pal_wbc_controller
node in the list and modify parameters as needed.
The main parameters to change are PiDs
and joint_limits
, as they directly affect the system's behavior and constraints.