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

joy node build bug when building from source [closed]

asked 2011-08-01 20:21:50 -0500

tom gravatar image

updated 2011-08-02 07:56:04 -0500

mmwise gravatar image


I just tried to build the joy package after checking out the whole joystick_drivers stack and got a following error:

  [100%] Building CXX object CMakeFiles/joy_node.dir/joy_node.o
  /home/ubuntu/ros_packages/joystick_drivers/joy/joy_node.cpp:39:29: fatal error: sensor_msgs/Joy.h: No such file or directory
  compilation terminated.
  make[3]: *** [CMakeFiles/joy_node.dir/joy_node.o] Error 1

so it appears the build system looks for Joy.h in std_msgs, whereas it can be found under joy/msg_gen/cpp/include/joy/Joy.h. What change to I have to make to make the build go without errors?

BTW, I also found another difference between package install and the source. The lines:

  <depend package="sensor_msgs"/>

  <depend package="rosbag"/>
    <rosbag migration_rule_file="migration_rules/Joy.bmr"/>

appear in manifest.xml in source but don't come up in a joy version installed from ubuntu packages. Of course removing the above lines doesn't fix the error.

EDIT: So I copied joy/msg/Joy.msg to sensor_msgs/msg and rebuilt the whole thing, but this didn't help either, as Joy.msg obviously changed and after doing what I just mentioned I got:

[100%] Building CXX object CMakeFiles/joy_node.dir/joy_node.o
  /home/ubuntu/ros_packages/joystick_drivers/joy/joy_node.cpp: In member function ‘int Joystick::main(int, char**)’:
  /home/ubuntu/ros_packages/joystick_drivers/joy/joy_node.cpp:217:19: error: ‘struct sensor_msgs::Joy’ has no member named ‘header’
  make[3]: *** [CMakeFiles/joy_node.dir/joy_node.o] Error 1

So I'll probably just revert to some older joy version until fixed.

edit retag flag offensive reopen merge delete

Closed for the following reason the question is answered, right answer was accepted by mmwise
close date 2011-08-02 07:56:15


Do you know how to use a normal joystick to control a turtlebot based kobuki?I have some trouble with it . I refer to this website:

Jie Sky gravatar image Jie Sky  ( 2014-11-25 22:31:32 -0500 )edit

3 Answers

Sort by » oldest newest most voted

answered 2011-08-02 06:46:41 -0500

mmwise gravatar image

Joy.msg is currently in tick tock, which may cause confusion for some people. Joy.msg is in the process of migrating to sensor_msgs. If you would like to use trunk for joystick_drivers you must also use the trunk or electric beta of common_msgs which contains sensor_msgs. The old Joy.msg is still in joy package to give everyone who is still using the old Joy.msg time to migrate.

edit flag offensive delete link more

answered 2011-08-01 20:32:14 -0500

dornhege gravatar image

AFAIK, the message was recently moved to sensor_msgs. For me (from packages) it is still in the joy package. If you use the one from source and build this against the ubuntu packages ROS, you will need to copy the msg to the joy/msg in the source until there are updated packages or use the sensor_msgs from source.

edit flag offensive delete link more


I'm using sensor_msgs from source, I updated it with svn up, I'm on revision 37696 and nothing changed, ie. Joy.msg is still not there. So probably I need to copy Joy.msg from joy/msg to sensor_msgs/msg and rebuild sensor_msgs, I'll try that and let know, thanks.
tom gravatar image tom  ( 2011-08-01 20:40:31 -0500 )edit
Unfortunetely this didn't help, I edited my question.
tom gravatar image tom  ( 2011-08-01 21:19:39 -0500 )edit

answered 2011-08-01 21:34:20 -0500

tom gravatar image

updated 2011-08-01 21:38:35 -0500

Ok fixed. If you happen to have similar problems, just take this Joy.msg and put it in sensor_msgs/msg:

# Reports the state of a joysticks axes and buttons.
Header header           # timestamp in the header is the time the data is received from the joystick
float32[] axes          # the axes measurements from a joystick
int32[] buttons         # the buttons measurements from a joystick

It's copied from unstable sensor_msgs.

Opened a ticket #5103 for that.

edit flag offensive delete link more

Question Tools


Asked: 2011-08-01 20:21:50 -0500

Seen: 1,987 times

Last updated: Aug 02 '11