Namespace issue when library loads config parameters
timling96 opened this issue · 0 comments
I am building and launching the node which uses the grasps library directly from IDE instead of the launch file.
The parameters however are still being loaded in the launchfile.
<param name="ee_group_name" value="hand"/>
<param name="planning_group_name" value="panda_arm"/>
<rosparam command="load" file="$(find moveit_grasps)/config_robot/panda_grasp_data.yaml"/>
<rosparam command="load" file="$(find moveit_grasps)/config/moveit_grasps_config.yaml"/>
I noticed, that in order for the rosparam_shortcuts::get() functionality in the grasps library to work, I needed to edit the source code of grasp_filter.cpp grasp_gnerator.cpp and grasp_planner.cpp file.
Otherwise, it would prepend the namespace of my node before the actual parameter name to search for. This would result in the grasps functionality not working as it could not find the paramters.
I had to remove the "~" character in the constructors so that the rosparam_shortcuts::get() function searches for the parameters using the private namespace.
Example of change:
GraspFilter::GraspFilter(robot_state::RobotStatePtr robot_state,
moveit_visual_tools::MoveItVisualToolsPtr& visual_tools)
: visual_tools_(visual_tools), nh_("~/moveit_grasps/filter")
{... }
GraspFilter::GraspFilter(robot_state::RobotStatePtr robot_state,
moveit_visual_tools::MoveItVisualToolsPtr& visual_tools)
: visual_tools_(visual_tools), nh_("/moveit_grasps/filter")
{...}
Is there an easier solution to this issue, without changing the actual source code of the library?
Because I don't want to launch my node using the launch file.
Thanks in advance