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:

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.

wxai

wxai,

arm_variant

End effector variant of the Trossen Arm.

base

base, leader, follower

arm_side

Side of the Trossen Arm. Note that only the wxai follower variant has a left and right side.

none

none, left, right

ip_address

IP address of the robot to connect to.

‘192.168.1.2’

ros2_control_hardware_type

Use real or mocked hardware interface.

real

real, mock_components

use_world_frame

Use world frame if set to true.

false

true, false

use_rviz

launches RViz if set to true.

true

true, false

robot_description

URDF of the robot; this is typically generated by the xacro command.

Command(FindExec(xacro) + ‘ ‘ + LocalVar(‘FindPackageShare(pkg= trossen_arm_description) + ‘urdf’ + LaunchConfig(robot_model)’) + ‘.urdf.xacro ‘ + ‘use_world_frame:=’ + LaunchConfig(use_world_frame) + ‘ ‘ + ‘arm_variant:=’ + LaunchConfig(arm_variant) + ‘ ‘ + ‘arm_side:=’ + LaunchConfig(arm_side) + ‘ ‘ + ‘ros2_control_hardware_type:=’ + LaunchConfig(ros2_control_hardware_type) + ‘ ‘ + ‘ip_address:=’ + LaunchConfig(ip_address))

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.

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.