Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

catkin build error #173

Open
curious-energy opened this issue Aug 27, 2021 · 7 comments
Open

catkin build error #173

curious-energy opened this issue Aug 27, 2021 · 7 comments

Comments

@curious-energy
Copy link

When I build this project, some error occur

Errors     << flightgoggles_car_dynamics:make /home/lx/goggles_ws/logs/flightgoggles_car_dynamics/build.make.001.log
In file included from /opt/ros/melodic/include/ros/serialization.h:37:0,
                 from /opt/ros/melodic/include/ros/publisher.h:34,
                 from /opt/ros/melodic/include/ros/node_handle.h:32,
                 from /opt/ros/melodic/include/ros/ros.h:45,
                 from /home/lx/goggles_ws/src/flightgoggles/flightgoggles_car_dynamics/src/flightgoggles_car_dynamics_node.hpp:12,
                 from /home/lx/goggles_ws/src/flightgoggles/flightgoggles_car_dynamics/src/flightgoggles_car_dynamics_node.cpp:8:
/opt/ros/melodic/include/ros/message_traits.h: In instantiation of ‘static const char* ros::message_traits::MD5Sum<M>::value(const M&) [with M = ros::Time]’:
/opt/ros/melodic/include/ros/message_traits.h:254:102:   required from ‘const char* ros::message_traits::md5sum(const M&) [with M = ros::Time]’
/opt/ros/melodic/include/ros/publisher.h:116:38:   required from ‘void ros::Publisher::publish(const M&) const [with M = ros::Time]’
/home/lx/goggles_ws/src/flightgoggles/flightgoggles_car_dynamics/src/flightgoggles_car_dynamics_node.cpp:137:35:   required from here
/opt/ros/melodic/include/ros/message_traits.h:125:14: error: ‘const class ros::Time’ has no member named ‘__getMD5Sum’
     return m.__getMD5Sum().c_str();
            ~~^~~~~~~~~~~
/opt/ros/melodic/include/ros/message_traits.h: In instantiation of ‘static const char* ros::message_traits::DataType<M>::value(const M&) [with M = ros::Time]’:
/opt/ros/melodic/include/ros/message_traits.h:263:104:   required from ‘const char* ros::message_traits::datatype(const M&) [with M = ros::Time]’
/opt/ros/melodic/include/ros/publisher.h:118:11:   required from ‘void ros::Publisher::publish(const M&) const [with M = ros::Time]’
/home/lx/goggles_ws/src/flightgoggles/flightgoggles_car_dynamics/src/flightgoggles_car_dynamics_node.cpp:137:35:   required from here
/opt/ros/melodic/include/ros/message_traits.h:142:14: error: ‘const class ros::Time’ has no member named ‘__getDataType’
     return m.__getDataType().c_str();
            ~~^~~~~~~~~~~~~
make[2]: *** [CMakeFiles/flightgoggles_car_dynamics_node.dir/src/flightgoggles_car_dynamics_node.cpp.o] Error 1
make[1]: *** [CMakeFiles/flightgoggles_car_dynamics_node.dir/all] Error 2
make: *** [all] Error 2
cd /home/lx/goggles_ws/build/flightgoggles_car_dynamics; catkin build --get-env flightgoggles_car_dynamics | catkin env -si  /usr/bin/make --jobserver-fds=4,5 -j; cd -

...............................................................................
Failed     << flightgoggles_car_dynamics:make                [ Exited with code 2 ]
Failed    <<< flightgoggles_car_dynamics                     [ 1.7 seconds ]   
_______________________________________________________________________________
Errors     << flightgoggles_uav_dynamics:make /home/lx/goggles_ws/logs/flightgoggles_uav_dynamics/build.make.001.log
In file included from /opt/ros/melodic/include/ros/serialization.h:37:0,
                 from /opt/ros/melodic/include/ros/publisher.h:34,
                 from /opt/ros/melodic/include/ros/node_handle.h:32,
                 from /opt/ros/melodic/include/ros/ros.h:45,
                 from /home/lx/goggles_ws/src/flightgoggles/flightgoggles_uav_dynamics/src/flightgoggles_uav_dynamics_node.hpp:14,
                 from /home/lx/goggles_ws/src/flightgoggles/flightgoggles_uav_dynamics/src/flightgoggles_uav_dynamics_node.cpp:10:
/opt/ros/melodic/include/ros/message_traits.h: In instantiation of ‘static const char* ros::message_traits::MD5Sum<M>::value(const M&) [with M = ros::Time]’:
/opt/ros/melodic/include/ros/message_traits.h:254:102:   required from ‘const char* ros::message_traits::md5sum(const M&) [with M = ros::Time]’
/opt/ros/melodic/include/ros/publisher.h:116:38:   required from ‘void ros::Publisher::publish(const M&) const [with M = ros::Time]’
/home/lx/goggles_ws/src/flightgoggles/flightgoggles_uav_dynamics/src/flightgoggles_uav_dynamics_node.cpp:278:35:   required from here
/opt/ros/melodic/include/ros/message_traits.h:125:14: error: ‘const class ros::Time’ has no member named ‘__getMD5Sum’
     return m.__getMD5Sum().c_str();
            ~~^~~~~~~~~~~
/opt/ros/melodic/include/ros/message_traits.h: In instantiation of ‘static const char* ros::message_traits::DataType<M>::value(const M&) [with M = ros::Time]’:
/opt/ros/melodic/include/ros/message_traits.h:263:104:   required from ‘const char* ros::message_traits::datatype(const M&) [with M = ros::Time]’
/opt/ros/melodic/include/ros/publisher.h:118:11:   required from ‘void ros::Publisher::publish(const M&) const [with M = ros::Time]’
/home/lx/goggles_ws/src/flightgoggles/flightgoggles_uav_dynamics/src/flightgoggles_uav_dynamics_node.cpp:278:35:   required from here
/opt/ros/melodic/include/ros/message_traits.h:142:14: error: ‘const class ros::Time’ has no member named ‘__getDataType’
     return m.__getDataType().c_str();
            ~~^~~~~~~~~~~~~
make[2]: *** [CMakeFiles/flightgoggles_uav_dynamics_node.dir/src/flightgoggles_uav_dynamics_node.cpp.o] Error 1
make[1]: *** [CMakeFiles/flightgoggles_uav_dynamics_node.dir/all] Error 2
make: *** [all] Error 2
cd /home/lx/goggles_ws/build/flightgoggles_uav_dynamics; catkin build --get-env flightgoggles_uav_dynamics | catkin env -si  /usr/bin/make --jobserver-fds=4,5 -j; cd -

...............................................................................
Failed     << flightgoggles_uav_dynamics:make                [ Exited with code 2 ]
Failed    <<< flightgoggles_uav_dynamics                     [ 1.9 seconds ]   

system:
ubuntu 18.04
ros melodic

reference: ROS Client

@bedaberner
Copy link

I encounter the same build error using the same setup (18.04,melodic)

@maulanaazhari
Copy link

maulanaazhari commented Sep 20, 2021

Hi @bedaberner @curious-energy, this problem happened because the code tries to publish non-message object, particularly in the file flightgoggles/flightgoggles_uav_dynamics/src/flightgoggles_uav_dynamics_node.cpp and flighgoggles/flightgoggles_car_dynamics/src/flightgoggles_car_dynamics_node.cpp. you can solve this problem by changing every line of clockPub_.publish(currentTime_); in those files to this:

std_msgs::Time time_msg;
time_msg.data = currentTime_;
clockPub_.publish(time_msg);

However, I still don't know whether it is the correct message object, but in my local machine, it works in the roslaunch flightgoggles teleopExample.launch run

note: in the publisher definition, clockPub_ uses the rosgraph_msgs/Clock message object, but when I changed the message object, I got another error in the flightgoggles_marker_visualizer_node.

@mhathiyari
Copy link

@curious-energy @bedaberner Any updates on the solution to your problem. Does @maulanaazhari solution work?

@maulanaazhari
Copy link

@mhathiyari worth to try, let us know the result!

@mhathiyari
Copy link

@maulanaazhari It didn't. wondering how the others above solved it.

@mhathiyari
Copy link

Just an update used docker with ros kinetic, and you dont get the above error. Thus you can run the flight googles code in the docker and unity env on your local machine. You can use docker --net host -it NAME command to make sure your host and container share the same network thus allowing the simulation code and unity engine to communicate.

@tenghooi
Copy link

For me changing to the following works,

rosgraph_msgs::Clock clock;
clock.clock = currentTime_;
clockPub_.publish(clock);

Cheers.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants