Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Namespace issue when library loads config parameters #103

Open
timling96 opened this issue Jul 16, 2021 · 0 comments
Open

Namespace issue when library loads config parameters #103

timling96 opened this issue Jul 16, 2021 · 0 comments

Comments

@timling96
Copy link

timling96 commented Jul 16, 2021

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant