ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question
0

How to use geometry_msgs/Twist.h ?

asked 2012-04-01 04:07:55 -0500

CoderKai gravatar image

updated 2014-01-28 17:11:49 -0500

ngrennan gravatar image

Hello, I'm trying to use stage with ROS. So I have modified the talker.cpp code, from the tutorial, to control the robot of the stage's tutorial. I have changed the declaration of the publisher to this:

 ros::Publisher chatter_pub = n.advertise<geometry_msgs::Twist>("cmd_vel", 1000);

And I add this too:

#include <geometry_msgs/Twist.h>

My problem is that the code cant compile because this library cant be found. The error given by the compiler is :

ros_workspace/stage_controllers/src/talker.cpp:4:33: error fatal: geometry_msgs/Twist.h: No existe el archivo o el directorio compilación terminada.

Its in spanish, but it means: fatal error: geometry_msgs/Twist.h: The file or directory doesn't exist, compilation finished.

I have tried to add the route of this file to the $PATH (/opt/ros/electric/stacks/common_msgs/geometry_msgs/msg_gen/cpp/include/geometry_msgs/Twist.h) and have done all the ros.org tutorial. So where should I add this route to makes it compile? Thanks for your time

edit retag flag offensive close merge delete

Comments

Please always copy-paste the error messages you get. It's hard to guess what's going wrong. http://www.ros.org/wiki/Support#Guidelines_for_asking_a_question_.28Please_read_before_posting.29

Lorenz gravatar image Lorenz  ( 2012-04-01 09:08:16 -0500 )edit

1 Answer

Sort by » oldest newest most voted
2

answered 2012-04-01 09:36:29 -0500

tfoote gravatar image

You need to have a dependency on geometry_msgs in you manifest, geometry_msgs needs to be in your ROS_PACKAGE_PATH and geometry_msgs needs to have been built. If you rosmake with it in you dependencies this will be done for you.

edit flag offensive delete link more

Question Tools

Stats

Asked: 2012-04-01 04:07:55 -0500

Seen: 10,357 times

Last updated: Apr 01 '12