Skip to content

Commit f4ccd78

Browse files
Release/Flexiv ROS 2 Humble v1.4 (#37)
1 parent dabb167 commit f4ccd78

File tree

109 files changed

+195102
-76768
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

109 files changed

+195102
-76768
lines changed

.github/workflows/humble-binary-build.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,10 +43,12 @@ jobs:
4343
target-ros2-distro: ${{ env.ROS_DISTRO }}
4444
package-name: |
4545
flexiv_bringup
46-
flexiv_controllers
4746
flexiv_description
4847
flexiv_hardware
4948
flexiv_moveit_config
5049
flexiv_msgs
50+
flexiv_robot_states_broadcaster
5151
flexiv_test_nodes
52+
gpio_controller
53+
joint_impedance_controller
5254
skip-tests: true

.pre-commit-config.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ repos:
1717
- id: check-yaml
1818
args: [--allow-multiple-documents]
1919
- id: check-added-large-files
20-
args: [--maxkb=500]
20+
args: [--maxkb=600]
2121
- id: pretty-format-json
2222
args: [--no-sort-keys, --autofix, --indent=4]
2323

README.md

Lines changed: 35 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -67,12 +67,31 @@ This project was developed for ROS 2 Foxy (Ubuntu 20.04) and Humble (Ubuntu 22.0
6767
rosdep install --from-paths src --ignore-src --rosdistro humble -r -y
6868
```
6969

70-
5. Build and source the workspace:
70+
> [!NOTE]
71+
> Skip step 5 and 6 if you have compile and install [flexiv_rdk](https://github.com/flexivrobotics/flexiv_rdk).
72+
73+
5. Choose a directory for installing `flexiv_rdk` library and all its dependencies. For example, a new folder named `rdk_install` under the home directory: `~/rdk_install`. Compile and install to the installation directory:
74+
75+
```bash
76+
cd ~/flexiv_ros2_ws/src/flexiv_ros2/flexiv_hardware/rdk/thirdparty
77+
bash build_and_install_dependencies.sh ~/rdk_install
78+
```
79+
80+
6. Configure and install `flexiv_rdk`:
81+
82+
```bash
83+
cd ~/flexiv_ros2_ws/src/flexiv_ros2/flexiv_hardware/rdk
84+
mkdir build && cd build
85+
cmake .. -DCMAKE_INSTALL_PREFIX=~/rdk_install
86+
cmake --build . --target install --config Release
87+
```
88+
89+
7. Build and source the workspace:
7190

7291
```bash
7392
cd ~/flexiv_ros2_ws
7493
source /opt/ros/humble/setup.bash
75-
colcon build --symlink-install
94+
colcon build --symlink-install --cmake-args -DCMAKE_PREFIX_PATH=~/rdk_install
7695
source install/setup.bash
7796
```
7897

@@ -86,15 +105,14 @@ This project was developed for ROS 2 Foxy (Ubuntu 20.04) and Humble (Ubuntu 22.0
86105
## Usage
87106
88107
> [!NOTE]
89-
> The instruction below is only a quick reference, see the [Flexiv ROS 2 Documentation](https://rdk.flexiv.com/manual/ros2_packages.html) for more information.
108+
> The instruction below is only a quick reference, see the [Flexiv ROS 2 Documentation](https://rdk.flexiv.com/manual/ros2_bridge.html) for more information.
90109
91-
The prerequisites of using ROS 2 with Flexiv Rizon robot are [enable RDK on the robot server](https://rdk.flexiv.com/manual/getting_started.html#activate-rdk-server) and [establish connection](https://rdk.flexiv.com/manual/getting_started.html#establish-connection) between the workstation PC and the robot.
110+
The prerequisites of using ROS 2 with Flexiv Rizon robot are [enable RDK on the robot server](https://rdk.flexiv.com/manual/activate_rdk_server.html) and [establish connection](https://rdk.flexiv.com/manual/establish_connection.html) between the workstation PC and the robot.
92111
93-
The main launch file to start the robot driver is the `rizon.launch.py` - it loads and starts the robot hardware, joint states broadcaster, force torque sensor broadcaster, TCP wrench and TCP pose broadcasters, and robot controller and opens RViZ. The arguments for the launch file are as follows:
112+
The main launch file to start the robot driver is the `rizon.launch.py` - it loads and starts the robot hardware, joint states broadcaster, Flexiv robot states broadcasters, and robot controller and opens RViZ. The arguments for the launch file are as follows:
94113
95-
- `robot_ip` (*required*) - IP address of the robot server (remote).
96-
- `local_ip` (*required*) - IP address of the workstation PC (local).
97-
- `rizon_type` (default: *rizon4*) - type of the Flexiv Rizon robot. (rizon4, rizon4s or rizon10)
114+
- `robot_sn` (*required*) - Serial number of the robot to connect to. Remove any space, for example: Rizon4s-123456
115+
- `rizon_type` (default: *rizon4*) - type of the Flexiv Rizon robot. (rizon4, rizon4s, rizon10 or rizon10s)
98116
- `use_fake_hardware` (default: *false*) - starts `FakeSystem` instead of real hardware. This is a simple simulation that mimics joint command to their states.
99117
- `start_rviz` (deafult: *true*) - starts RViz automatically with the launch file.
100118
- `fake_sensor_commands` (default: *false*) - enables fake command interfaces for sensors used for simulations. Used only if `use_fake_hardware` parameter is true.
@@ -109,13 +127,13 @@ The main launch file to start the robot driver is the `rizon.launch.py` - it loa
109127
- Test with real robot:
110128
111129
```bash
112-
ros2 launch flexiv_bringup rizon.launch.py robot_ip:=[robot_ip] local_ip:=[local_ip] rizon_type:=rizon4
130+
ros2 launch flexiv_bringup rizon.launch.py robot_sn:=[robot_sn] rizon_type:=rizon4
113131
```
114132
115133
- Test with fake hardware (`ros2_control` capability):
116134
117135
```bash
118-
ros2 launch flexiv_bringup rizon.launch.py robot_ip:=dont-care local_ip:=dont-care use_fake_hardware:=true
136+
ros2 launch flexiv_bringup rizon.launch.py robot_sn:=dont-care use_fake_hardware:=true
119137
```
120138
121139
> [!TIP]
@@ -133,7 +151,7 @@ The main launch file to start the robot driver is the `rizon.launch.py` - it loa
133151
- To test another controller, define it using the `robot_controller` launch argument, for example the `joint_impedance_controller`:
134152
135153
```bash
136-
ros2 launch flexiv_bringup rizon.launch.py robot_ip:=[robot_ip] local_ip:=[local_ip] robot_controller:=joint_impedance_controller
154+
ros2 launch flexiv_bringup rizon.launch.py robot_sn:=[robot_sn] robot_controller:=joint_impedance_controller
137155
```
138156
139157
Open a new terminal and run the launch file:
@@ -155,27 +173,24 @@ The main launch file to start the robot driver is the `rizon.launch.py` - it loa
155173
You can also run the MoveIt example and use the `MotionPlanning` plugin in RViZ to start planning:
156174
157175
```bash
158-
ros2 launch flexiv_bringup rizon_moveit.launch.py robot_ip:=[robot_ip] local_ip:=[local_ip]
176+
ros2 launch flexiv_bringup rizon_moveit.launch.py robot_sn:=[robot_sn]
159177
```
160178
161179
Test with fake hardware:
162180
163181
```bash
164-
ros2 launch flexiv_bringup rizon_moveit.launch.py robot_ip:=dont-care local_ip:=dont-care use_fake_hardware:=true
182+
ros2 launch flexiv_bringup rizon_moveit.launch.py robot_sn:=dont-care use_fake_hardware:=true
165183
```
166184
167185
### Robot States
168186
169187
The robot driver (`rizon.launch.py`) publishes the following feedback states to the respective ROS topics:
170188
189+
- `/${robot_sn}/flexiv_robot_states`: [Flexiv robot states](https://rdk.flexiv.com/api/structflexiv_1_1rdk_1_1_robot_states.html#details) including the joint- and Cartesian-space robot states. [[`flexiv_msgs/msg/RobotStates.msg`](flexiv_msgs/msg/RobotStates.msg)]
171190
- `/joint_states`: Measured joint states of the robot: joint position, velocity and torque. [[`sensor_msgs/JointState.msg`](https://docs.ros.org/en/noetic/api/sensor_msgs/html/msg/JointState.html)]
172-
- `/external_wrench_in_tcp_broadcaster/external_wrench_in_tcp`: Estimated external wrench applied on TCP and expressed in TCP frame $^{TCP}F_{ext}$ in force $[N]$ and moment $[Nm]$. [[`geometry_msgs/WrenchStamped.msg`](https://docs.ros.org/en/noetic/api/geometry_msgs/html/msg/WrenchStamped.html)]
173-
- `/external_wrench_in_base_broadcaster/external_wrench_in_base`: Estimated external wrench applied on TCP and expressed in base frame $^{0}F_{ext}$ in force $[N]$ and moment $[Nm]$. [[`geometry_msgs/WrenchStamped.msg`](https://docs.ros.org/en/noetic/api/geometry_msgs/html/msg/WrenchStamped.html)]
174-
- `/force_torque_sensor_broadcaster/wrench`: Force-torque (FT) sensor raw reading in flange frame: $^{flange}F_{raw}$ in force $[N]$ and moment $[Nm]$. The value is 0 if no FT sensor is installed. [[`geometry_msgs/WrenchStamped.msg`](https://docs.ros.org/en/noetic/api/geometry_msgs/html/msg/WrenchStamped.html)]
175-
- `/tcp_pose_broadcaster/tcp_pose`: Measured TCP pose expressed in base frame $^{0}T_{TCP}$ in position $[m]$ and quaternion. [[`geometry_msgs/PoseStamped.msg`](https://docs.ros.org/en/noetic/api/geometry_msgs/html/msg/PoseStamped.html)]
176-
177-
> [!NOTE]
178-
> The topic names of the broadcasters are specified in `flexiv_bringup/config/rizon_controllers.yaml`
191+
- `/flexiv_robot_states_broadcaster/tcp_pose`: Measured TCP pose expressed in world frame $^{0}T_{TCP}$ in position $[m]$ and quaternion. [[`geometry_msgs/PoseStamped.msg`](https://docs.ros.org/en/noetic/api/geometry_msgs/html/msg/PoseStamped.html)]
192+
- `/flexiv_robot_states_broadcaster/external_wrench_in_tcp`: Estimated external wrench applied on TCP and expressed in TCP frame $^{TCP}F_{ext}$ in force $[N]$ and torque $[Nm]$. [[`geometry_msgs/WrenchStamped.msg`](https://docs.ros.org/en/noetic/api/geometry_msgs/html/msg/WrenchStamped.html)]
193+
- `/flexiv_robot_states_broadcaster/external_wrench_in_world`: Estimated external wrench applied on TCP and expressed in world frame $^{0}F_{ext}$ in force $[N]$ and torque $[Nm]$. [[`geometry_msgs/WrenchStamped.msg`](https://docs.ros.org/en/noetic/api/geometry_msgs/html/msg/WrenchStamped.html)]
179194
180195
### GPIO
181196

flexiv_bringup/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
This package contains launch files: the main driver launcher, the MoveIt launch file and demo examples:
44

5-
- `rizon.launch.py` - the main launcher: starts *ros2_control* node including hardware interface, runs joint states, force torque sensor, external TCP wrench and TCP pose broadcasters, and a controller, and visualizes the current robot pose in RViZ. The default controller is `rizon_arm_controller`, a joint trajectory controller.
5+
- `rizon.launch.py` - the main launcher: starts *ros2_control* node including hardware interface, runs joint states, Flexiv robot states broadcaster, and a controller, and visualizes the current robot pose in RViZ. The default controller is `rizon_arm_controller`, a joint trajectory controller.
66
- `rizon_moveit.launch.py` - runs MoveIt together with the driver. The controller for robot joints started in this launch file is *rizon_arm_controller*.
77
- `test_joint_trajectory_controller.launch` - sends joint trajectory goals to the *rizon_arm_controller*.
88
- `sine_sweep_position.launch.py` - gets current joint states and then performs a sine-sweep motion with *forward_position_controller*.

flexiv_bringup/config/rizon_controllers.yaml

Lines changed: 4 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -11,46 +11,14 @@ controller_manager:
1111
joint_state_broadcaster:
1212
type: joint_state_broadcaster/JointStateBroadcaster
1313

14-
force_torque_sensor_broadcaster:
15-
type: force_torque_sensor_broadcaster/ForceTorqueSensorBroadcaster
16-
1714
joint_impedance_controller:
18-
type: flexiv_controllers/JointImpedanceController
15+
type: joint_impedance_controller/JointImpedanceController
1916

2017
gpio_controller:
21-
type: flexiv_controllers/GPIOController
22-
23-
external_wrench_in_base_broadcaster:
24-
type: flexiv_controllers/ExternalTcpWrenchBroadcaster
25-
26-
external_wrench_in_tcp_broadcaster:
27-
type: flexiv_controllers/ExternalTcpWrenchBroadcaster
28-
29-
tcp_pose_state_broadcaster:
30-
type: flexiv_controllers/TcpPoseStateBroadcaster
31-
32-
force_torque_sensor_broadcaster:
33-
ros__parameters:
34-
sensor_name: force_torque_sensor
35-
frame_id: flange
18+
type: gpio_controller/GPIOController
3619

37-
external_wrench_in_tcp_broadcaster:
38-
ros__parameters:
39-
sensor_name: external_wrench_in_tcp
40-
frame_id: flange
41-
topic_name: external_wrench_in_tcp
42-
43-
external_wrench_in_base_broadcaster:
44-
ros__parameters:
45-
sensor_name: external_wrench_in_base
46-
frame_id: flange
47-
topic_name: external_wrench_in_base
48-
49-
tcp_pose_state_broadcaster:
50-
ros__parameters:
51-
sensor_name: tcp_pose
52-
frame_id: flange
53-
topic_name: tcp_pose
20+
flexiv_robot_states_broadcaster:
21+
type: flexiv_robot_states_broadcaster/FlexivRobotStatesBroadcaster
5422

5523
forward_position_controller:
5624
ros__parameters:

flexiv_bringup/launch/rizon.launch.py

Lines changed: 15 additions & 65 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
from launch import LaunchDescription
22
from launch.actions import DeclareLaunchArgument, RegisterEventHandler
3-
from launch.conditions import IfCondition
3+
from launch.conditions import IfCondition, UnlessCondition
44
from launch.event_handlers import OnProcessExit
55
from launch.substitutions import (
66
Command,
@@ -14,8 +14,7 @@
1414

1515
def generate_launch_description():
1616
rizon_type_param_name = "rizon_type"
17-
robot_ip_param_name = "robot_ip"
18-
local_ip_param_name = "local_ip"
17+
robot_sn_param_name = "robot_sn"
1918
start_rviz_param_name = "start_rviz"
2019
use_fake_hardware_param_name = "use_fake_hardware"
2120
fake_sensor_commands_param_name = "fake_sensor_commands"
@@ -29,21 +28,14 @@ def generate_launch_description():
2928
rizon_type_param_name,
3029
description="Type of the Flexiv Rizon robot.",
3130
default_value="rizon4",
32-
choices=["rizon4", "rizon4s", "rizon10"],
31+
choices=["rizon4", "rizon4s", "rizon10", "rizon10s"],
3332
)
3433
)
3534

3635
declared_arguments.append(
3736
DeclareLaunchArgument(
38-
robot_ip_param_name,
39-
description="IP address of the robot server (remote).",
40-
)
41-
)
42-
43-
declared_arguments.append(
44-
DeclareLaunchArgument(
45-
local_ip_param_name,
46-
description="IP address of the workstation PC (local).",
37+
robot_sn_param_name,
38+
description="Serial number of the robot to connect to. Remove any space, for example: Rizon4s-123456",
4739
)
4840
)
4941

@@ -82,8 +74,7 @@ def generate_launch_description():
8274

8375
# Initialize Arguments
8476
rizon_type = LaunchConfiguration(rizon_type_param_name)
85-
robot_ip = LaunchConfiguration(robot_ip_param_name)
86-
local_ip = LaunchConfiguration(local_ip_param_name)
77+
robot_sn = LaunchConfiguration(robot_sn_param_name)
8778
start_rviz = LaunchConfiguration(start_rviz_param_name)
8879
use_fake_hardware = LaunchConfiguration(use_fake_hardware_param_name)
8980
fake_sensor_commands = LaunchConfiguration(fake_sensor_commands_param_name)
@@ -101,11 +92,8 @@ def generate_launch_description():
10192
" ",
10293
flexiv_urdf_xacro,
10394
" ",
104-
"robot_ip:=",
105-
robot_ip,
106-
" ",
107-
"local_ip:=",
108-
local_ip,
95+
"robot_sn:=",
96+
robot_sn,
10997
" ",
11098
"name:=",
11199
"rizon",
@@ -145,7 +133,7 @@ def generate_launch_description():
145133
ros2_control_node = Node(
146134
package="controller_manager",
147135
executable="ros2_control_node",
148-
parameters=[robot_description, robot_controllers],
136+
parameters=[robot_description, robot_controllers, {"robot_sn": robot_sn}],
149137
output="both",
150138
)
151139

@@ -176,48 +164,13 @@ def generate_launch_description():
176164
],
177165
)
178166

179-
# Run force torque sensor broadcaster
180-
force_torque_sensor_broadcaster_spawner = Node(
181-
package="controller_manager",
182-
executable="spawner",
183-
arguments=[
184-
"force_torque_sensor_broadcaster",
185-
"--controller-manager",
186-
"/controller_manager",
187-
],
188-
)
189-
190-
# Run external wrench in base broadcaster
191-
external_wrench_in_base_broadcaster_spawner = Node(
192-
package="controller_manager",
193-
executable="spawner",
194-
arguments=[
195-
"external_wrench_in_base_broadcaster",
196-
"--controller-manager",
197-
"/controller_manager",
198-
],
199-
)
200-
201-
# Run external wrench in tcp broadcaster
202-
external_wrench_in_tcp_broadcaster_spawner = Node(
167+
# Run Flexiv robot states broadcaster
168+
flexiv_robot_states_broadcaster_spawner = Node(
203169
package="controller_manager",
204170
executable="spawner",
205-
arguments=[
206-
"external_wrench_in_tcp_broadcaster",
207-
"--controller-manager",
208-
"/controller_manager",
209-
],
210-
)
211-
212-
# Run tcp pose state broadcaster
213-
tcp_pose_state_broadcaster_spawner = Node(
214-
package="controller_manager",
215-
executable="spawner",
216-
arguments=[
217-
"tcp_pose_state_broadcaster",
218-
"--controller-manager",
219-
"/controller_manager",
220-
],
171+
arguments=["flexiv_robot_states_broadcaster"],
172+
parameters=[{"robot_sn": robot_sn}],
173+
condition=UnlessCondition(use_fake_hardware),
221174
)
222175

223176
# Run gpio controller
@@ -249,10 +202,7 @@ def generate_launch_description():
249202
ros2_control_node,
250203
robot_state_publisher_node,
251204
joint_state_broadcaster_spawner,
252-
force_torque_sensor_broadcaster_spawner,
253-
external_wrench_in_base_broadcaster_spawner,
254-
external_wrench_in_tcp_broadcaster_spawner,
255-
tcp_pose_state_broadcaster_spawner,
205+
flexiv_robot_states_broadcaster_spawner,
256206
gpio_controller_spawner,
257207
delay_rviz_after_joint_state_broadcaster_spawner,
258208
delay_robot_controller_spawner_after_joint_state_broadcaster_spawner,

0 commit comments

Comments
 (0)