Trossen Arm Bringup
The Trossen Arm Bringup package provides the necessary configuration and launch files to bring up the ros2_control hardware interface for the Trossen Arms. This package allows you to control the arm and gripper using ROS 2.
Two different hardware interfaces are supported:
Mock Hardware: For testing and development purposes, simulating the arm’s behavior.
Real Hardware: For controlling the actual Trossen Arm hardware.
These interfaces can be swapped by changing the ros2_control_hardware_type
launch argument when launching the bringup package by switching between mock_components
and real
.
Usage
Launch File
We will first cover how to launch the mock Trossen Arm hardware interface with controllers for the arm and gripper.
source ~/ros2_ws/install/setup.bash
ros2 launch trossen_arm_bringup trossen_arm.launch.py ros2_control_hardware_type:=mock_components
Several nodes are launched and can be listed with the following command:
ros2 node list
You will see output similar to the following:
/arm_controller
/controller_manager
/gripper_controller
/joint_state_broadcaster
/robot_state_publisher
/rviz2
/transform_listener_impl_6280570b14d0
The relevant nodes are:
The
controller_manager
node is a ros2_control Controller Manager responsible for managing the controllers for all ros2_control hardware interfaces.The
arm_controller
is a joint_trajectory_controller/JointTrajectoryController that allows you to send joint trajectory commands to the arm.The
gripper_controller
is a position_controllers/GripperActionController that allows you to open and close the gripper.The
joint_state_broadcaster
is a joint_state_broadcaster/JointStateBroadcaster node that publishes the joint states of the arm and gripper.
The relevant nodes are:
The
controller_manager
node is a ros2_control Controller Manager responsible for managing the controllers for all ros2_control hardware interfaces.The
arm_controller
is a joint_trajectory_controller/JointTrajectoryController that allows you to send joint trajectory commands to the arm.The
gripper_controller
is a parallel_gripper_action_controller/GripperActionController that allows you to open and close the gripper.The
joint_state_broadcaster
is a joint_state_broadcaster/JointStateBroadcaster node that publishes the joint states of the arm and gripper.
To further customize the trossen_arm launch file at runtime, refer to the table below, or run the command below
ros2 launch trossen_arm_bringup trossen_arm.launch.py --show-args
Argument |
Description |
Default |
Choices |
---|---|---|---|
robot_model |
model type of the Trossen Arm. |
|
|
arm_variant |
End effector variant of the Trossen Arm. |
|
|
arm_side |
Side of the Trossen Arm. Note that only the wxai follower variant has a left and right side. |
|
|
ip_address |
IP address of the robot to connect to. |
‘192.168.1.2’ |
|
ros2_control_hardware_type |
Use real or mocked hardware interface. |
|
|
use_world_frame |
Use world frame if set to |
|
|
use_rviz |
launches RViz if set to |
|
|
robot_description |
URDF of the robot; this is typically generated by the xacro command. |
Command(FindExec( |
Controller Demo Script
A simple script is used to demonstrate how to control and monitor the arm_controller
and gripper_controller
using their action interfaces.
This script sends a series of commands to the arm and gripper, allowing you to test their functionality while printing off the action feedback and result.
It also demonstrates handling of goal response, feedback, and results.
To use this demo script, first make sure the arm and gripper controllers are running using this package’s trossen_arm.launch.py
launch file.
Then run the following commands in a new terminal:
source ~/ros2_ws/install/setup.bash
ros2 run trossen_arm_bringup controllers.py
You should see the arm move upright, the gripper open, the gripper close, then the arm move back to sleep. In the launch terminal, you will see that the arm and gripper controllers receive and respond to a series of goal requests. In the demo terminal, you will see feedback from both action servers, and information about goal acceptance and results.
See the script source for more details.
See the script source for more details.
Next Steps
Now that you are familiar with the controllers required to control the Trossen Arm, you can proceed to the next tutorial to learn how to control the arm using the Trossen Arm MoveIt configuration package.