error when catkin_make package
I write a node to subscribe /movegroup/displayplannedpath to get the path,and publish to /mavros/setpointposition/local.
But when i catkin_make the package,there is an error.
/home/sean/test/src/controller/src/controller.cpp: In member function ‘void Controller::traj_callback(const ConstPtr&)’:
/home/sean/test/src/controller/src/controller.cpp:42:22: error: ‘const _trajectory_type’ has no member named ‘joint_trajectory’
if(traj->trajectory.joint_trajectory.joint_names=="virtual_joint" && traj->trajectory[0].joint_trajectory.points.size()>0){
^
/home/sean/test/src/controller/src/controller.cpp:56:37: error: no matching function for call to ‘Controller::print_curr_pose(geometry_msgs::PoseStamped&)’
print_curr_pose(curr_pose_msg);
^
/home/sean/test/src/controller/src/controller.cpp:56:37: note: candidate is:
/home/sean/test/src/controller/src/controller.cpp:26:7: note: void Controller::print_curr_pose(const ConstPtr&)
void print_curr_pose(const geometry_msgs::PoseStamped::ConstPtr& pcp);
^
/home/sean/test/src/controller/src/controller.cpp:26:7: note: no known conversion for argument 1 from ‘geometry_msgs::PoseStamped’ to ‘const ConstPtr& {aka const boost::shared_ptr<const geometry_msgs::PoseStamped_<std::allocator<void> > >&}’
/home/sean/test/src/controller/src/controller.cpp:57:37: error: no matching function for call to ‘Controller::print_next_pose(geometry_msgs::PoseStamped&)’
print_next_pose(pub_traj_pose);
^
/home/sean/test/src/controller/src/controller.cpp:57:37: note: candidate is:
/home/sean/test/src/controller/src/controller.cpp:27:7: note: void Controller::print_next_pose(const ConstPtr&)
void print_next_pose(const geometry_msgs::PoseStamped::ConstPtr& pnp);
^
/home/sean/test/src/controller/src/controller.cpp:27:7: note: no known conversion for argument 1 from ‘geometry_msgs::PoseStamped’ to ‘const ConstPtr& {aka const boost::shared_ptr<const geometry_msgs::PoseStamped_<std::allocator<void> > >&}’
make[2]: *** [controller/CMakeFiles/controller.dir/src/controller.cpp.o] Error 1
make[1]: *** [controller/CMakeFiles/controller.dir/all] Error 2
make: *** [all] Error 2
Invoking "make -j4 -l4" failed
I have added includedirectories( ${catkinINCLUDE_DIRS} ) to CMakeList. But the error still appear.
Could any one help me with this error? My ROS version is indigo with Ubuntu 14.04
Asked by sean819 on 2016-08-16 15:11:51 UTC
Comments
Can you post the source code to controller.cpp?
Asked by alexvs on 2016-08-16 15:44:24 UTC
Hi,i just solve this problem. I had confuse message type of moveit_msgs. So the problem is i set the wrong message type. I set ConstPtr when i want to get the string message. I have to set a string if i want to get joint_name. That's all. Thank you for reply.
Asked by sean819 on 2016-08-18 12:55:00 UTC