Can't create MoveGroupInterface object in my own class
Hi, I have a project requirement where I want object of moveit::planning_interface::MoveGroupInterface class inside my own class as a class member. But I couldn't' as it gives the following error. I tried some digging but can't figure it out myself. I tried inheritance but it doesn't work and makes things too much complicated. Please help to create a working object of MoveGroupInterface class inside my own class ROS1.Kinetic - Ubuntu 16.04LTS , c++11 Errors:
- expected identifier before string constant moveit::planning_interface::MoveGroupInterface move_group("arm_torso");
‘move_group’ does not name a type move_group.setPoseReferenceFrame("base_footprint");
#include <moveit/move_group_interface/move_group_interface.h> class Move_operations_class { public: int a,b; moveit::planning_interface::MoveGroupInterface move_group("arm_torso"); //The following format works below but doesn't let me use any MoveGroupInterface class fucntions //moveit::planning_interface::MoveGroupInterface move_group(const std::string name="arm_torso"); //This does'nt work in any case //movegroup.setPoseReferenceFrame("base_footprint"); //Constructor Move_operations_class(const std::string &move_group_name) { //The below line works but the variable gets deleted after constructor call moveit::planning_interface::MoveGroupInterface move_group(name); } }; int main(int argc, char** argv) { ros::init(argc, argv, "move_operations"); ROS_INFO("Starting application ..."); ros::NodeHandle nh; ros::AsyncSpinner spinner(1); spinner.start(); //This line works fine though moveit::planning_interface::MoveGroupInterface move_group_main("arm_torso"); Move_operations_class move_op("arm_torso"); return 0; }