Skip to content

Commit cbad870

Browse files
Release/Flexiv ROS 2 Humble 0.10 (#33)
1 parent 5449e07 commit cbad870

File tree

11 files changed

+91
-52
lines changed

11 files changed

+91
-52
lines changed

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, 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.
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/launch/rizon.launch.py

Lines changed: 23 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -13,12 +13,20 @@
1313

1414

1515
def generate_launch_description():
16+
rizon_type_param_name = "rizon_type"
17+
robot_ip_param_name = "robot_ip"
18+
local_ip_param_name = "local_ip"
19+
start_rviz_param_name = "start_rviz"
20+
use_fake_hardware_param_name = "use_fake_hardware"
21+
fake_sensor_commands_param_name = "fake_sensor_commands"
22+
robot_controller_param_name = "robot_controller"
23+
1624
# Declare arguments
1725
declared_arguments = []
1826

1927
declared_arguments.append(
2028
DeclareLaunchArgument(
21-
"rizon_type",
29+
rizon_type_param_name,
2230
description="Type of the Flexiv Rizon robot.",
2331
default_value="rizon4",
2432
choices=["rizon4", "rizon4s", "rizon10"],
@@ -27,37 +35,37 @@ def generate_launch_description():
2735

2836
declared_arguments.append(
2937
DeclareLaunchArgument(
30-
"robot_ip",
38+
robot_ip_param_name,
3139
description="IP address of the robot server (remote).",
3240
)
3341
)
3442

3543
declared_arguments.append(
3644
DeclareLaunchArgument(
37-
"local_ip",
45+
local_ip_param_name,
3846
description="IP address of the workstation PC (local).",
3947
)
4048
)
4149

4250
declared_arguments.append(
4351
DeclareLaunchArgument(
44-
"start_rviz",
52+
start_rviz_param_name,
4553
default_value="true",
4654
description="start RViz automatically with the launch file",
4755
)
4856
)
4957

5058
declared_arguments.append(
5159
DeclareLaunchArgument(
52-
"use_fake_hardware",
60+
use_fake_hardware_param_name,
5361
default_value="false",
5462
description="Start robot with fake hardware mirroring command to its states.",
5563
)
5664
)
5765

5866
declared_arguments.append(
5967
DeclareLaunchArgument(
60-
"fake_sensor_commands",
68+
fake_sensor_commands_param_name,
6169
default_value="false",
6270
description="Enable fake command interfaces for sensors used for simple simulations. \
6371
Used only if 'use_fake_hardware' parameter is true.",
@@ -66,29 +74,20 @@ def generate_launch_description():
6674

6775
declared_arguments.append(
6876
DeclareLaunchArgument(
69-
"controllers_file",
70-
default_value="rizon_controllers.yaml",
71-
description="YAML file with the controllers configuration.",
72-
)
73-
)
74-
75-
declared_arguments.append(
76-
DeclareLaunchArgument(
77-
"robot_controller",
77+
robot_controller_param_name,
7878
default_value="rizon_arm_controller",
7979
description="Robot controller to start. Available: forward_position_controller, rizon_arm_controller, joint_impedance_controller.",
8080
)
8181
)
8282

8383
# Initialize Arguments
84-
rizon_type = LaunchConfiguration("rizon_type")
85-
robot_ip = LaunchConfiguration("robot_ip")
86-
local_ip = LaunchConfiguration("local_ip")
87-
start_rviz = LaunchConfiguration("start_rviz")
88-
use_fake_hardware = LaunchConfiguration("use_fake_hardware")
89-
fake_sensor_commands = LaunchConfiguration("fake_sensor_commands")
90-
controllers_file = LaunchConfiguration("controllers_file")
91-
robot_controller = LaunchConfiguration("robot_controller")
84+
rizon_type = LaunchConfiguration(rizon_type_param_name)
85+
robot_ip = LaunchConfiguration(robot_ip_param_name)
86+
local_ip = LaunchConfiguration(local_ip_param_name)
87+
start_rviz = LaunchConfiguration(start_rviz_param_name)
88+
use_fake_hardware = LaunchConfiguration(use_fake_hardware_param_name)
89+
fake_sensor_commands = LaunchConfiguration(fake_sensor_commands_param_name)
90+
robot_controller = LaunchConfiguration(robot_controller_param_name)
9291

9392
# Get URDF via xacro
9493
flexiv_urdf_xacro = PathJoinSubstitution(
@@ -139,7 +138,7 @@ def generate_launch_description():
139138

140139
# Robot controllers
141140
robot_controllers = PathJoinSubstitution(
142-
[FindPackageShare("flexiv_bringup"), "config", controllers_file]
141+
[FindPackageShare("flexiv_bringup"), "config", "rizon_controllers.yaml"]
143142
)
144143

145144
# Controller Manager

flexiv_bringup/launch/rizon_moveit.launch.py

Lines changed: 59 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,9 @@
33
from ament_index_python.packages import get_package_share_directory
44

55
from launch import LaunchDescription
6-
from launch.actions import DeclareLaunchArgument
6+
from launch.actions import DeclareLaunchArgument, RegisterEventHandler
77
from launch.conditions import IfCondition
8+
from launch.event_handlers import OnProcessExit
89
from launch.substitutions import (
910
Command,
1011
FindExecutable,
@@ -29,12 +30,21 @@ def load_yaml(package_name, file_path):
2930

3031

3132
def generate_launch_description():
33+
rizon_type_param_name = "rizon_type"
34+
robot_ip_param_name = "robot_ip"
35+
local_ip_param_name = "local_ip"
36+
start_rviz_param_name = "start_rviz"
37+
use_fake_hardware_param_name = "use_fake_hardware"
38+
fake_sensor_commands_param_name = "fake_sensor_commands"
39+
warehouse_sqlite_path_param_name = "warehouse_sqlite_path"
40+
start_servo_param_name = "start_servo"
41+
3242
# Declare command-line arguments
3343
declared_arguments = []
3444

3545
declared_arguments.append(
3646
DeclareLaunchArgument(
37-
"rizon_type",
47+
rizon_type_param_name,
3848
description="Type of the Flexiv Rizon robot.",
3949
default_value="rizon4",
4050
choices=["rizon4", "rizon4s", "rizon10"],
@@ -43,37 +53,37 @@ def generate_launch_description():
4353

4454
declared_arguments.append(
4555
DeclareLaunchArgument(
46-
"robot_ip",
56+
robot_ip_param_name,
4757
description="IP address of the robot server (remote).",
4858
)
4959
)
5060

5161
declared_arguments.append(
5262
DeclareLaunchArgument(
53-
"local_ip",
63+
local_ip_param_name,
5464
description="IP address of the workstation PC (local).",
5565
)
5666
)
5767

5868
declared_arguments.append(
5969
DeclareLaunchArgument(
60-
"start_rviz",
70+
start_rviz_param_name,
6171
default_value="true",
6272
description="start RViz automatically with the launch file",
6373
)
6474
)
6575

6676
declared_arguments.append(
6777
DeclareLaunchArgument(
68-
"use_fake_hardware",
78+
use_fake_hardware_param_name,
6979
default_value="false",
7080
description="Start robot with fake hardware mirroring command to its states.",
7181
)
7282
)
7383

7484
declared_arguments.append(
7585
DeclareLaunchArgument(
76-
"fake_sensor_commands",
86+
fake_sensor_commands_param_name,
7787
default_value="false",
7888
description="Enable fake command interfaces for sensors used for simple simulations. \
7989
Used only if 'use_fake_hardware' parameter is true.",
@@ -82,28 +92,28 @@ def generate_launch_description():
8292

8393
declared_arguments.append(
8494
DeclareLaunchArgument(
85-
"warehouse_sqlite_path",
95+
warehouse_sqlite_path_param_name,
8696
default_value=os.path.expanduser("~/.ros/warehouse_ros.sqlite"),
8797
description="Path to the sqlite database used by the warehouse_ros package.",
8898
)
8999
)
90100

91101
declared_arguments.append(
92102
DeclareLaunchArgument(
93-
"start_servo",
103+
start_servo_param_name,
94104
default_value="false",
95105
description="Start the MoveIt servo node?",
96106
)
97107
)
98108

99-
rizon_type = LaunchConfiguration("rizon_type")
100-
robot_ip = LaunchConfiguration("robot_ip")
101-
local_ip = LaunchConfiguration("local_ip")
102-
start_rviz = LaunchConfiguration("start_rviz")
103-
use_fake_hardware = LaunchConfiguration("use_fake_hardware")
104-
fake_sensor_commands = LaunchConfiguration("fake_sensor_commands")
105-
warehouse_sqlite_path = LaunchConfiguration("warehouse_sqlite_path")
106-
start_servo = LaunchConfiguration("start_servo")
109+
rizon_type = LaunchConfiguration(rizon_type_param_name)
110+
robot_ip = LaunchConfiguration(robot_ip_param_name)
111+
local_ip = LaunchConfiguration(local_ip_param_name)
112+
start_rviz = LaunchConfiguration(start_rviz_param_name)
113+
use_fake_hardware = LaunchConfiguration(use_fake_hardware_param_name)
114+
fake_sensor_commands = LaunchConfiguration(fake_sensor_commands_param_name)
115+
warehouse_sqlite_path = LaunchConfiguration(warehouse_sqlite_path_param_name)
116+
start_servo = LaunchConfiguration(start_servo_param_name)
107117

108118
# Get URDF via xacro
109119
flexiv_urdf_xacro = PathJoinSubstitution(
@@ -295,6 +305,17 @@ def generate_launch_description():
295305
],
296306
)
297307

308+
# Run tcp pose state broadcaster
309+
tcp_pose_state_broadcaster_spawner = Node(
310+
package="controller_manager",
311+
executable="spawner",
312+
arguments=[
313+
"tcp_pose_state_broadcaster",
314+
"--controller-manager",
315+
"/controller_manager",
316+
],
317+
)
318+
298319
# Servo node for realtime control
299320
servo_yaml = load_yaml(
300321
"flexiv_moveit_config", "config/rizon_moveit_servo_config.yaml"
@@ -313,14 +334,33 @@ def generate_launch_description():
313334
output="screen",
314335
)
315336

337+
# Delay rviz start after `joint_state_broadcaster`
338+
delay_rviz_after_joint_state_broadcaster_spawner = RegisterEventHandler(
339+
event_handler=OnProcessExit(
340+
target_action=joint_state_broadcaster_spawner,
341+
on_exit=[rviz_node],
342+
)
343+
)
344+
345+
# Delay start of robot_controller after `joint_state_broadcaster`
346+
delay_robot_controller_spawner_after_joint_state_broadcaster_spawner = (
347+
RegisterEventHandler(
348+
event_handler=OnProcessExit(
349+
target_action=joint_state_broadcaster_spawner,
350+
on_exit=[robot_controller_spawner],
351+
)
352+
)
353+
)
354+
316355
nodes = [
317356
move_group_node,
318357
robot_state_publisher_node,
319358
ros2_control_node,
320359
joint_state_broadcaster_spawner,
321-
robot_controller_spawner,
322-
rviz_node,
360+
tcp_pose_state_broadcaster_spawner,
323361
servo_node,
362+
delay_rviz_after_joint_state_broadcaster_spawner,
363+
delay_robot_controller_spawner_after_joint_state_broadcaster_spawner,
324364
]
325365

326366
return LaunchDescription(declared_arguments + nodes)

flexiv_bringup/package.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
<?xml-model href="http://download.ros.org/schema/package_format3.xsd" schematypens="http://www.w3.org/2001/XMLSchema"?>
33
<package format="3">
44
<name>flexiv_bringup</name>
5-
<version>0.9.1</version>
5+
<version>0.10.0</version>
66
<description>Package with launch files and run-time configurations for Flexiv robots with `ros2_control`</description>
77
<maintainer email="[email protected]">Mun Seng Phoon</maintainer>
88
<license>Apache License 2.0</license>

flexiv_controllers/package.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
<?xml-model href="http://download.ros.org/schema/package_format3.xsd" schematypens="http://www.w3.org/2001/XMLSchema"?>
33
<package format="3">
44
<name>flexiv_controllers</name>
5-
<version>0.9.1</version>
5+
<version>0.10.0</version>
66
<description>Flexiv custom ros2 controllers</description>
77
<maintainer email="[email protected]">Mun Seng Phoon</maintainer>
88
<license>Apache License 2.0</license>

flexiv_description/package.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
<?xml-model href="http://download.ros.org/schema/package_format3.xsd" schematypens="http://www.w3.org/2001/XMLSchema"?>
33
<package format="3">
44
<name>flexiv_description</name>
5-
<version>0.9.1</version>
5+
<version>0.10.0</version>
66
<description>URDF description for Flexiv robots</description>
77
<maintainer email="[email protected]">Mun Seng Phoon</maintainer>
88
<license>Apache License 2.0</license>

flexiv_hardware/package.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
<?xml-model href="http://download.ros.org/schema/package_format3.xsd" schematypens="http://www.w3.org/2001/XMLSchema"?>
33
<package format="3">
44
<name>flexiv_hardware</name>
5-
<version>0.9.1</version>
5+
<version>0.10.0</version>
66
<description>Hardware interfaces to Flexiv robots for ROS 2 control</description>
77
<maintainer email="[email protected]">Mun Seng Phoon</maintainer>
88
<license>Apache 2.0</license>

flexiv_moveit_config/package.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
<?xml-model href="http://download.ros.org/schema/package_format3.xsd" schematypens="http://www.w3.org/2001/XMLSchema"?>
33
<package format="3">
44
<name>flexiv_moveit_config</name>
5-
<version>0.9.1</version>
5+
<version>0.10.0</version>
66
<description>MoveIt2 configuration and launch files for Flexiv Rizon robots</description>
77
<maintainer email="[email protected]">Mun Seng Phoon</maintainer>
88
<license>Apache 2.0</license>

flexiv_msgs/package.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
<?xml-model href="http://download.ros.org/schema/package_format3.xsd" schematypens="http://www.w3.org/2001/XMLSchema"?>
33
<package format="3">
44
<name>flexiv_msgs</name>
5-
<version>0.9.1</version>
5+
<version>0.10.0</version>
66
<description>Robot states messages definiton used in RDK</description>
77
<maintainer email="[email protected]">Mun Seng Phoon</maintainer>
88
<license>Apache License 2.0</license>

0 commit comments

Comments
 (0)