Skip to content

Commit 2da41a6

Browse files
Feature/Set robot_sn as default prefix to the robot joint and link names (#45)
1 parent c0e815e commit 2da41a6

34 files changed

+408
-336
lines changed

README.md

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,7 @@ The main launch file to start the robot driver is the `rizon.launch.py` - it loa
134134
- Test with fake hardware (`ros2_control` capability):
135135
136136
```bash
137-
ros2 launch flexiv_bringup rizon.launch.py robot_sn:=dont-care use_fake_hardware:=true
137+
ros2 launch flexiv_bringup rizon.launch.py robot_sn:=Rizon4-123456 use_fake_hardware:=true
138138
```
139139
140140
> [!TIP]
@@ -145,7 +145,7 @@ The main launch file to start the robot driver is the `rizon.launch.py` - it loa
145145
- To send the goal position to the controller by using the node from `flexiv_test_nodes`, start the following command in a new terminal:
146146
147147
```bash
148-
ros2 launch flexiv_bringup test_joint_trajectory_controller.launch.py
148+
ros2 launch flexiv_bringup test_joint_trajectory_controller.launch.py robot_sn:=[robot_sn]
149149
```
150150
151151
The joint position goals can be changed in `flexiv_bringup/config/joint_trajectory_position_publisher.yaml`
@@ -158,7 +158,7 @@ The main launch file to start the robot driver is the `rizon.launch.py` - it loa
158158
Open a new terminal and run the launch file:
159159
160160
```bash
161-
ros2 launch flexiv_bringup sine_sweep_impedance.launch.py
161+
ros2 launch flexiv_bringup sine_sweep_impedance.launch.py robot_sn:=[robot_sn]
162162
```
163163
164164
The robot should run a sine-sweep motion with joint impedance control.
@@ -180,7 +180,7 @@ ros2 launch flexiv_bringup rizon_moveit.launch.py robot_sn:=[robot_sn]
180180
Test with fake hardware:
181181
182182
```bash
183-
ros2 launch flexiv_bringup rizon_moveit.launch.py robot_sn:=dont-care use_fake_hardware:=true
183+
ros2 launch flexiv_bringup rizon_moveit.launch.py robot_sn:=Rizon4-123456 use_fake_hardware:=true
184184
```
185185
186186
### Robot States
@@ -189,18 +189,18 @@ The robot driver (`rizon.launch.py`) publishes the following feedback states to
189189
190190
- `/${robot_sn}/flexiv_robot_states`: [Flexiv robot states](https://www.flexiv.com/software/rdk/api/structflexiv_1_1rdk_1_1_robot_states.html) including the joint- and Cartesian-space robot states. [[`flexiv_msgs/msg/RobotStates.msg`](flexiv_msgs/msg/RobotStates.msg)]
191191
- `/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)]
192-
- `/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)]
193-
- `/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)]
194-
- `/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)]
192+
- `/${robot_sn}/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)]
193+
- `/${robot_sn}/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)]
194+
- `/${robot_sn}/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)]
195195
196196
### GPIO
197197
198-
All digital inputs on the robot control box can be accessed via the ROS topic `/gpio_controller/gpio_inputs`, which publishes the current state of all the 18 *(16 on control box + 2 inside the wrist connector)* digital input ports *(True: port high, false: port low)*.
198+
All digital inputs on the robot control box can be accessed via the ROS topic `/{robot_sn}/gpio_inputs`, which publishes the current state of all the 18 *(16 on control box + 2 inside the wrist connector)* digital input ports *(True: port high, false: port low)*.
199199
200-
The digital output ports on the control box can be set by publishing to the topic `/gpio_controller/gpio_outputs`. For example:
200+
The digital output ports on the control box can be set by publishing to the topic `/{robot_sn}/gpio_outputs`. For example:
201201
202202
```bash
203-
ros2 topic pub /gpio_controller/gpio_outputs flexiv_msgs/msg/GPIOStates "{states: [{pin: 0, state: true}, {pin: 2, state: true}]}"
203+
ros2 topic pub /Rizon4_123456/gpio_outputs flexiv_msgs/msg/GPIOStates "{states: [{pin: 0, state: true}, {pin: 2, state: true}]}"
204204
```
205205
206206
### Gripper Control

flexiv_bringup/config/joint_trajectory_position_publisher.yaml

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -11,12 +11,12 @@ publisher_joint_trajectory_controller:
1111
pos4: [-0.698, -0.698, 0.698, 1.57, 0.698, 0.698, 0.698]
1212

1313
joints:
14-
- joint1
15-
- joint2
16-
- joint3
17-
- joint4
18-
- joint5
19-
- joint6
20-
- joint7
14+
- $(var robot_sn)_joint1
15+
- $(var robot_sn)_joint2
16+
- $(var robot_sn)_joint3
17+
- $(var robot_sn)_joint4
18+
- $(var robot_sn)_joint5
19+
- $(var robot_sn)_joint6
20+
- $(var robot_sn)_joint7
2121

2222
check_starting_point: true

flexiv_bringup/config/rizon_controllers.yaml

Lines changed: 21 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -23,37 +23,37 @@ controller_manager:
2323
forward_position_controller:
2424
ros__parameters:
2525
joints:
26-
- joint1
27-
- joint2
28-
- joint3
29-
- joint4
30-
- joint5
31-
- joint6
32-
- joint7
26+
- $(var robot_sn)_joint1
27+
- $(var robot_sn)_joint2
28+
- $(var robot_sn)_joint3
29+
- $(var robot_sn)_joint4
30+
- $(var robot_sn)_joint5
31+
- $(var robot_sn)_joint6
32+
- $(var robot_sn)_joint7
3333

3434
joint_impedance_controller:
3535
ros__parameters:
3636
joints:
37-
- joint1
38-
- joint2
39-
- joint3
40-
- joint4
41-
- joint5
42-
- joint6
43-
- joint7
37+
- $(var robot_sn)_joint1
38+
- $(var robot_sn)_joint2
39+
- $(var robot_sn)_joint3
40+
- $(var robot_sn)_joint4
41+
- $(var robot_sn)_joint5
42+
- $(var robot_sn)_joint6
43+
- $(var robot_sn)_joint7
4444
k_p: [3000.0, 3000.0, 800.0, 800.0, 200.0, 200.0, 200.0]
4545
k_d: [80.0, 80.0, 40.0, 40.0, 8.0, 8.0, 8.0]
4646

4747
rizon_arm_controller:
4848
ros__parameters:
4949
joints:
50-
- joint1
51-
- joint2
52-
- joint3
53-
- joint4
54-
- joint5
55-
- joint6
56-
- joint7
50+
- $(var robot_sn)_joint1
51+
- $(var robot_sn)_joint2
52+
- $(var robot_sn)_joint3
53+
- $(var robot_sn)_joint4
54+
- $(var robot_sn)_joint5
55+
- $(var robot_sn)_joint6
56+
- $(var robot_sn)_joint7
5757
command_interfaces:
5858
- position
5959
state_interfaces:

flexiv_bringup/config/sine_sweep_impedance_config.yaml

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,12 @@ sine_sweep_impedance_controller:
33

44
controller_name: "joint_impedance_controller"
55
joints:
6-
- joint1
7-
- joint2
8-
- joint3
9-
- joint4
10-
- joint5
11-
- joint6
12-
- joint7
6+
- $(var robot_sn)_joint1
7+
- $(var robot_sn)_joint2
8+
- $(var robot_sn)_joint3
9+
- $(var robot_sn)_joint4
10+
- $(var robot_sn)_joint5
11+
- $(var robot_sn)_joint6
12+
- $(var robot_sn)_joint7
1313
wait_sec_between_publish: 0.001
1414
speed_scaling: 1.0

flexiv_bringup/config/sine_sweep_position_config.yaml

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,12 @@ sine_sweep_position_controller:
33

44
controller_name: "forward_position_controller"
55
joints:
6-
- joint1
7-
- joint2
8-
- joint3
9-
- joint4
10-
- joint5
11-
- joint6
12-
- joint7
6+
- $(var robot_sn)_joint1
7+
- $(var robot_sn)_joint2
8+
- $(var robot_sn)_joint3
9+
- $(var robot_sn)_joint4
10+
- $(var robot_sn)_joint5
11+
- $(var robot_sn)_joint6
12+
- $(var robot_sn)_joint7
1313
wait_sec_between_publish: 0.001
1414
speed_scaling: 1.0

flexiv_bringup/launch/rizon.launch.py

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
from launch.event_handlers import OnProcessExit
99
from launch.launch_description_sources import PythonLaunchDescriptionSource
1010
from launch_ros.actions import Node
11-
from launch_ros.parameter_descriptions import ParameterValue
11+
from launch_ros.parameter_descriptions import ParameterFile, ParameterValue
1212
from launch_ros.substitutions import FindPackageShare
1313
from launch.substitutions import (
1414
Command,
@@ -122,9 +122,6 @@ def generate_launch_description():
122122
"robot_sn:=",
123123
robot_sn,
124124
" ",
125-
"name:=",
126-
"rizon",
127-
" ",
128125
"rizon_type:=",
129126
rizon_type,
130127
" ",
@@ -169,7 +166,11 @@ def generate_launch_description():
169166
ros2_control_node = Node(
170167
package="controller_manager",
171168
executable="ros2_control_node",
172-
parameters=[robot_description, robot_controllers, {"robot_sn": robot_sn}],
169+
parameters=[
170+
robot_description,
171+
ParameterFile(robot_controllers, allow_substs=True),
172+
{"robot_sn": robot_sn},
173+
],
173174
remappings=[("joint_states", "flexiv_arm/joint_states")],
174175
output="both",
175176
)
@@ -250,6 +251,8 @@ def generate_launch_description():
250251
package="controller_manager",
251252
executable="spawner",
252253
arguments=["gpio_controller", "--controller-manager", "/controller_manager"],
254+
parameters=[{"robot_sn": robot_sn}],
255+
condition=UnlessCondition(use_fake_hardware),
253256
)
254257

255258
# Delay rviz start after `joint_state_broadcaster`

0 commit comments

Comments
 (0)