Skip to content

Commit 8a082a9

Browse files
committed
Improve: panda_moveit: Add parameters for perception tutorial
1 parent fe43f7b commit 8a082a9

1 file changed

Lines changed: 21 additions & 3 deletions

File tree

panda_moveit_config/launch/demo.launch.py

Lines changed: 21 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,31 @@
11
import os
22
from launch import LaunchDescription
33
from launch.actions import DeclareLaunchArgument
4-
from launch.substitutions import LaunchConfiguration
4+
from launch.substitutions import LaunchConfiguration, PathJoinSubstitution
55
from launch.conditions import IfCondition, UnlessCondition
6+
import launch_ros
67
from launch_ros.actions import Node
78
from launch.actions import ExecuteProcess
89
from ament_index_python.packages import get_package_share_directory
910
from moveit_configs_utils import MoveItConfigsBuilder
1011

12+
_PANDA_MOVEIT_CONFIG_RSC = "moveit_resources_panda_moveit_config"
13+
14+
def _octomap_launch_params():
15+
_path_panda_sensor_conf = PathJoinSubstitution(
16+
[
17+
launch_ros.substitutions.FindPackageShare(_PANDA_MOVEIT_CONFIG_RSC),
18+
"config",
19+
"sensors_kinect_pointcloud.yaml"
20+
])
21+
_params = [
22+
launch_ros.parameter_descriptions.ParameterFile(
23+
param_file=_path_panda_sensor_conf,
24+
allow_substs=True),
25+
{"octomap_frame": "odom_combined"},
26+
{"octomap_resolution": "0.05"},
27+
{"max_range": "5.0"}]
28+
return _params
1129

1230
def generate_launch_description():
1331

@@ -49,14 +67,14 @@ def generate_launch_description():
4967
package="moveit_ros_move_group",
5068
executable="move_group",
5169
output="screen",
52-
parameters=[moveit_config.to_dict()],
70+
parameters=[moveit_config.to_dict()] + _octomap_launch_params(),
5371
arguments=["--ros-args", "--log-level", "info"],
5472
)
5573

5674
# RViz
5775
tutorial_mode = LaunchConfiguration("rviz_tutorial")
5876
rviz_base = os.path.join(
59-
get_package_share_directory("moveit_resources_panda_moveit_config"), "launch"
77+
get_package_share_directory(_PANDA_MOVEIT_CONFIG_RSC), "launch"
6078
)
6179
rviz_full_config = os.path.join(rviz_base, "moveit.rviz")
6280
rviz_empty_config = os.path.join(rviz_base, "moveit_empty.rviz")

0 commit comments

Comments
 (0)