Skip to content

Commit 1c75051

Browse files
authored
Change RewrittenYaml to AdaptedYaml and improve launch logic. (#349)
* Change RewrittenYaml to AdaptedYaml. Signed-off-by: Jelmer de Wolde <jelmer.de.wolde@alliander.com> * Fix global costmap and improve launch file logic. Signed-off-by: Jelmer de Wolde <jelmer.de.wolde@alliander.com> --------- Signed-off-by: Jelmer de Wolde <jelmer.de.wolde@alliander.com>
1 parent 740d7ec commit 1c75051

5 files changed

Lines changed: 261 additions & 200 deletions

File tree

ros2_ws/src/rcdt_launch/rcdt_launch/predefined_configurations.py

Lines changed: 40 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,7 @@ def wrapper(fn: ConfigurationFunction) -> ConfigurationFunction:
6666
return wrapper
6767

6868

69+
# Sensors:
6970
@register_configuration("")
7071
def config_empty() -> None: # noqa: D103
7172
pass
@@ -101,17 +102,18 @@ def config_zed() -> None: # noqa: D103
101102
Camera("zed", [0, 0, 0.5], namespace="zed")
102103

103104

105+
# Franka:
104106
@register_configuration("franka")
105107
def config_franka() -> None: # noqa: D103
106108
if not EnvironmentConfiguration.simulation:
107109
Rviz.load_motion_planning_plugin = True
108110
Arm("franka", [0, 0, 0], gripper=True, moveit=True, ip_address="172.16.0.2")
109111

110112

111-
@register_configuration("franka_axis")
112-
def config_franka_axis() -> None: # noqa: D103
113-
franka = Arm("franka", [0, 0, 0], [0, 0, 20])
114-
Platform("axis", [0, 0, 0.1], [0, 20, 0], parent=franka)
113+
@register_configuration("franka_realsense")
114+
def config_franka_realsense() -> None: # noqa: D103
115+
arm = Arm("franka", [0, 0, 0], moveit=True)
116+
Camera("realsense", [0.05, 0, 0], [0, -90, 180], parent=arm)
115117

116118

117119
@register_configuration("franka_double")
@@ -133,34 +135,12 @@ def config_franka_planning() -> None: # noqa: D103
133135
Camera("realsense", [0.05, 0, 0], [0, -90, 180], parent=arm)
134136

135137

136-
@register_configuration("franka_realsense")
137-
def config_franka_realsense() -> None: # noqa: D103
138-
arm = Arm("franka", [0, 0, 0], moveit=True)
139-
Camera("realsense", [0.05, 0, 0], [0, -90, 180], parent=arm)
140-
141-
138+
# Panther:
142139
@register_configuration("panther")
143140
def config_panther() -> None: # noqa: D103
144141
Vehicle("panther", [0, 0, 0.2], namespace="panther")
145142

146143

147-
@register_configuration("panther_axis")
148-
def config_panther_axis() -> None: # noqa: D103
149-
vehicle = Vehicle("panther", [0, 0, 0.2], orientation=[0, 0, 90])
150-
Platform("axis", [0, 0, 0.2], [20, 0, 0], parent=vehicle)
151-
152-
153-
@register_configuration("panther_gps")
154-
def config_panther_gps() -> None: # noqa: D103
155-
EnvironmentConfiguration.world = "map_5.940906_51.966960"
156-
EnvironmentConfiguration.use_vizanti = True
157-
panther = Vehicle(
158-
"panther", [0, 0, 0.2], navigation=True, use_gps=True, window_size=50
159-
)
160-
GPS("nmea", [0, 0, 0.2], parent=panther)
161-
Lidar("velodyne", [0.13, -0.13, 0.35], parent=panther)
162-
163-
164144
@register_configuration("panther_realsense")
165145
def config_panther_realsense() -> None: # noqa: D103
166146
panther = Vehicle("panther", [0, 0, 0.2])
@@ -175,17 +155,46 @@ def config_panther_zed() -> None: # noqa: D103
175155

176156
@register_configuration("panther_velodyne")
177157
def config_panther_velodyne() -> None: # noqa: D103
178-
EnvironmentConfiguration.use_vizanti = True
179-
panther = Vehicle("panther", [0, 0, 0.2], navigation=True)
158+
panther = Vehicle("panther", [0, 0, 0.2])
180159
Lidar("velodyne", [0.13, -0.13, 0.35], parent=panther)
181160

182161

183162
@register_configuration("panther_ouster")
184163
def config_panther_ouster() -> None: # noqa: D103
185-
panther = Vehicle("panther", [0, 0, 0.2], navigation=True)
164+
panther = Vehicle("panther", [0, 0, 0.2])
186165
Lidar("ouster", [0.13, -0.13, 0.35], parent=panther)
187166

188167

168+
@register_configuration("panther_collision_monitor")
169+
def config_panther_collision_monitor() -> None: # noqa: D103
170+
panther = Vehicle("panther", [0, 0, 0.2], collision_monitor=True)
171+
Lidar("velodyne", [0.13, -0.13, 0.35], parent=panther)
172+
173+
174+
@register_configuration("panther_slam")
175+
def config_panther_slam() -> None: # noqa: D103
176+
panther = Vehicle("panther", [0, 0, 0.2], slam=True)
177+
Lidar("velodyne", [0.13, -0.13, 0.35], parent=panther)
178+
179+
180+
@register_configuration("panther_lidar_navigation")
181+
def config_panther_lidar_navigation() -> None: # noqa: D103
182+
panther = Vehicle("panther", [0, 0, 0.2], navigation=True)
183+
Lidar("velodyne", [0.13, -0.13, 0.35], parent=panther)
184+
185+
186+
@register_configuration("panther_gps_navigation")
187+
def config_panther_gps() -> None: # noqa: D103
188+
EnvironmentConfiguration.world = "map_5.940906_51.966960"
189+
EnvironmentConfiguration.use_vizanti = True
190+
panther = Vehicle(
191+
"panther", [0, 0, 0.2], navigation=True, use_gps=True, window_size=50
192+
)
193+
Lidar("velodyne", [0.13, -0.13, 0.35], parent=panther)
194+
GPS("nmea", [0, 0, 0.2], parent=panther)
195+
196+
197+
# Mobile Manipulators:
189198
@register_configuration("mm")
190199
def config_mm() -> None: # noqa: D103
191200
panther = Vehicle("panther", [0, 0, 0.2])
@@ -217,6 +226,7 @@ def config_mm_gps() -> None: # noqa: D103
217226
GPS("nmea", [0, 0, 0.2], parent=panther)
218227

219228

229+
# Multiple non-connected platforms:
220230
@register_configuration("panther_and_franka")
221231
def config_panther_and_franka() -> None: # noqa: D103
222232
Vehicle("panther", [0, -0.5, 0.2])

ros2_ws/src/rcdt_panther/config/nav2/global_costmap.yaml

Lines changed: 36 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -4,36 +4,39 @@
44

55
# Based on: https://docs.nav2.org/configuration/packages/configuring-costmaps.html
66

7-
always_send_full_costmap: true
8-
rolling_window: substitute_me
9-
width: substitute_me
10-
height: substitute_me
11-
update_frequency: 30.0
12-
publish_frequency: 30.0
13-
robot_base_frame: substitute_me
14-
footprint: "[[0.4045, 0.424], [0.4045, -0.424], [-0.4045, -0.424], [-0.4045, 0.424]]"
15-
plugins: ["static_layer", "obstacle_layer", "inflation_layer"]
16-
static_layer:
17-
plugin: "nav2_costmap_2d::StaticLayer"
18-
obstacle_layer:
19-
plugin: "nav2_costmap_2d::ObstacleLayer"
20-
enabled: True
21-
observation_sources: scan
22-
footprint_clearing_enabled: true
23-
max_obstacle_height: 2.0
24-
combination_method: 1
25-
scan:
26-
topic: substitute_me
27-
obstacle_max_range: substitute_me
28-
obstacle_min_range: 0.0
29-
raytrace_max_range: substitute_me
30-
raytrace_min_range: 0.0
31-
max_obstacle_height: 2.0
32-
min_obstacle_height: 0.0
33-
clearing: True
34-
marking: True
35-
data_type: "LaserScan"
36-
inf_is_valid: false
37-
inflation_layer:
38-
plugin: "nav2_costmap_2d::InflationLayer"
39-
inflation_radius: 1.0
7+
global_costmap:
8+
global_costmap:
9+
ros__parameters:
10+
always_send_full_costmap: true
11+
rolling_window: substitute_me
12+
width: substitute_me
13+
height: substitute_me
14+
update_frequency: 30.0
15+
publish_frequency: 30.0
16+
robot_base_frame: substitute_me
17+
footprint: "[[0.4045, 0.424], [0.4045, -0.424], [-0.4045, -0.424], [-0.4045, 0.424]]"
18+
plugins: ["static_layer", "obstacle_layer", "inflation_layer"]
19+
static_layer:
20+
plugin: "nav2_costmap_2d::StaticLayer"
21+
obstacle_layer:
22+
plugin: "nav2_costmap_2d::ObstacleLayer"
23+
enabled: True
24+
observation_sources: scan
25+
footprint_clearing_enabled: true
26+
max_obstacle_height: 2.0
27+
combination_method: 1
28+
scan:
29+
topic: substitute_me
30+
obstacle_max_range: substitute_me
31+
obstacle_min_range: 0.0
32+
raytrace_max_range: substitute_me
33+
raytrace_min_range: 0.0
34+
max_obstacle_height: 2.0
35+
min_obstacle_height: 0.0
36+
clearing: True
37+
marking: True
38+
data_type: "LaserScan"
39+
inf_is_valid: false
40+
inflation_layer:
41+
plugin: "nav2_costmap_2d::InflationLayer"
42+
inflation_radius: 1.0

ros2_ws/src/rcdt_panther/config/nav2/local_costmap.yaml

Lines changed: 13 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,16 @@
44

55
# Based on: https://docs.nav2.org/configuration/packages/configuring-costmaps.html
66

7-
global_frame: substitute_me
8-
robot_base_frame: substitute_me
9-
rolling_window: substitute_me
10-
plugins: ["static_layer", "obstacle_layer", "inflation_layer"]
11-
static_layer:
12-
plugin: "nav2_costmap_2d::StaticLayer"
13-
obstacle_layer:
14-
plugin: "nav2_costmap_2d::ObstacleLayer"
15-
inflation_layer:
16-
plugin: "nav2_costmap_2d::InflationLayer"
7+
local_costmap:
8+
local_costmap:
9+
ros__parameters:
10+
global_frame: substitute_me
11+
robot_base_frame: substitute_me
12+
rolling_window: substitute_me
13+
plugins: ["static_layer", "obstacle_layer", "inflation_layer"]
14+
static_layer:
15+
plugin: "nav2_costmap_2d::StaticLayer"
16+
obstacle_layer:
17+
plugin: "nav2_costmap_2d::ObstacleLayer"
18+
inflation_layer:
19+
plugin: "nav2_costmap_2d::InflationLayer"

0 commit comments

Comments
 (0)