Skip to content

Commit a4d9fe6

Browse files
authored
Merge pull request #246 from JdeRobot/add-rviz-config
Add rviz2 config
2 parents 0bfaa7a + d2da0f6 commit a4d9fe6

File tree

1 file changed

+33
-2
lines changed

1 file changed

+33
-2
lines changed

manager/manager/launcher/launcher_rviz.py

Lines changed: 33 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,18 +20,24 @@ def run(self, config_file, callback):
2020
DRI_PATH = self.get_dri_path()
2121
ACCELERATION_ENABLED = self.check_device(DRI_PATH)
2222

23+
config = "ros2 run rviz2 rviz2"
24+
25+
if config_file != None:
26+
config = f'ros2 launch {config_file}'
27+
28+
print(config)
2329
if ACCELERATION_ENABLED:
2430
self.console_vnc.start_vnc_gpu(
2531
self.display, self.internal_port, self.external_port, DRI_PATH
2632
)
2733
# Write display config and start the console
28-
console_cmd = f"export VGL_DISPLAY={DRI_PATH}; export DISPLAY={self.display}; vglrun ros2 run rviz2 rviz2"
34+
console_cmd = f"export VGL_DISPLAY={DRI_PATH}; export DISPLAY={self.display}; vglrun {config}"
2935
else:
3036
self.console_vnc.start_vnc(
3137
self.display, self.internal_port, self.external_port
3238
)
3339
# Write display config and start the console
34-
console_cmd = f"export DISPLAY={self.display};ros2 run rviz2 rviz2"
40+
console_cmd = f"export DISPLAY={self.display};{config}"
3541

3642
console_thread = DockerThread(console_cmd)
3743
console_thread.start()
@@ -62,3 +68,28 @@ def terminate(self):
6268

6369
def died(self):
6470
pass
71+
72+
73+
# rviz_node_full = Node(
74+
# package="rviz2",
75+
# executable="rviz2",
76+
# name="rviz2",
77+
# output="log",
78+
# arguments=["-d", rviz_full_config],
79+
# parameters=[
80+
# robot_description,
81+
# robot_description_semantic,
82+
# kinematics_yaml,
83+
84+
# pilz_planning_pipeline_config,
85+
86+
# joint_limits,
87+
# pilz_cartesian_limits,
88+
89+
# trajectory_execution,
90+
# moveit_controllers,
91+
# planning_scene_monitor_parameters,
92+
# move_group_capabilities,
93+
# {"use_sim_time": True},
94+
# ]
95+
# )

0 commit comments

Comments
 (0)