Can not retrieve parameters.
I am running ur5_moveit_config demo.launch
from ros-industrial's universal robot
package and I'd like to control it from my node. For that purpose I need to retrieve several parameters from parameter server. The first one is planning_plugin
.
Calling rosparam list | grep planning_plugin
gives /move_group/planning_plugin
. Which means that parameter exists.
Here is my node initialization code:
#include <ros/ros.h>
#include <pluginlib/class_loader.h>
/* Moveit includes */
#include <moveit/robot_model/robot_model.h>
#include <moveit/robot_model_loader/robot_model_loader.h>
#include <moveit/planning_scene/planning_scene.h>
#include <moveit/planning_interface/planning_interface.h>
#include <moveit_msgs/DisplayTrajectory.h>
#include <moveit_msgs/PlanningScene.h>
#include <moveit/kinematic_constraints/utils.h>
#include <iostream>
#include <boost/scoped_ptr.hpp>
int main(int argc, char **argv) {
ros::init(argc, argv, "arm_control_node");
ros::AsyncSpinner spinner(1);
spinner.start();
ros::NodeHandle node_handle("/move_group/arm_control");
std::string planner_plugin_name; //= "ompl_interface/OMPLPlanner";
if (!node_handle.getParam("planning_plugin", planner_plugin_name)) {
ROS_FATAL_STREAM("Could not find planner plugin name");
}
return 0;
}
Launching executable with rosrun arm_control arm_control_node
prints [FATAL] [1508419005.957461571]: Could not find planner plugin name
. However rosparam get /move_group/planning_plugin
outputs ompl_interface/OMPLPlanner
.
I have tried to hardcode plugin name as a result I have got an error about retrieving other parameters. It seems like the node can not get access to them but why is a mystery for me.
looking at your
#include
s: are you planning to load planning plugins directly? That is possible, but just wanted to make sure you are aware there is a ROS API (ie: services and actions) available that is probably much easier to use.@gvdhoorn Thanks again! Gonna take a look. It is just a part of the
motion_planning_api_tutorial
from moveit page. Wonder why do they use direct plugin loading if there are easier methods to do so.