Quantcast
Channel: ROS Answers: Open Source Q&A Forum - RSS feed
Viewing all articles
Browse latest Browse all 84

Custom msg: strange error during building

$
0
0
Hi, I really don t understand what is wrong in my program. I cannot get a custom msg working, I think it depends on the dependecies with the other packages. Here is my bone program: a simple publisher that should output a float32 just for testing: #include #include "msg/customMsg.msg" int main( int argc, char **argv ) { ros::init( argc, argv, "node_anadyr" ); ros::NodeHandle node; ros::Publisher pub = node.advertise( "topic_alpha", 100 ); ros::Rate rate( 2 ); while( ros::ok() ) { msg::customMsg message; message.data = 3.3; pub.publish( message ); rate.sleep(); } } Of course i created a folder in my package: jack@D-21:~/workspace_ros/src/anadyr$ ls -l | grep msg drwxrwxr-x 2 jack jack 4096 Jul 25 23:26 msg inside I put the following file customMsg.msg containing the following line: float32 data but when I run the catkin_make I get the following error .... .... #### #### Running command: "make -j1 -l1" in "/home/wilhem/workspace_ros/build" #### Scanning dependencies of target anadyr [ 10%] Building CXX object anadyr/CMakeFiles/anadyr.dir/main.cpp.o In file included from /home/wilhem/workspace_ros/src/anadyr/main.cpp:2:0: /home/wilhem/workspace_ros/src/anadyr/msg/customMsg.msg:1:1: error: ‘float32’ does not name a type float32 data ^ make[2]: *** [anadyr/CMakeFiles/anadyr.dir/main.cpp.o] Fehler 1 make[1]: *** [anadyr/CMakeFiles/anadyr.dir/all] Fehler 2 make: *** [all] Fehler 2 Invoking "make" failed Here is my CMakelist.txt cmake_minimum_required(VERSION 2.8.3) project(anadyr) find_package(catkin REQUIRED COMPONENTS roscpp message_generation std_msgs) ## Generate messages in the 'msg' folder add_message_files( FILES customMsg.msg ) ## Generate added messages and services with any dependencies listed here generate_messages( DEPENDENCIES std_msgs ) catkin_package( CATKIN_DEPENDS message_runtime std_msgs ) # add_executable(anadyr_node src/anadyr_node.cpp) add_executable(anadyr main.cpp) target_link_libraries(anadyr ${catkin_LIBRARIES}) and here my package.xml: anadyr0.0.0The anadyr packagewilhemTODOcatkinroscppmessage_generationstd_msgsroscppmessage_runtimestd_msgs I read all the tutorials I could find, but it didnt work. What worng in my dependencies?!? What should I do to use custom messages in my application? Regards

Viewing all articles
Browse latest Browse all 84

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>