0
$\begingroup$

Rosanswers logo

Hi I am using rosserial arduino, from the tutorial link text I made my custom message file which contains string and integer data types in catkin_ws/src/beginner_tutorials/msg/Datatype.msg and converted it into a header file Datatype.h, After that I ran following commandrosrun rosserial_arduino make_libraries.py . It created header datatype.h in /sketchbook/libraries/roslib/beginner_tutorials. Now I am able to compile my header file . But while running serial_node.py I am getting following errors:

pankaj@pankaj-HP-Pavilion-dv4-Notebook-PC:~$ rosrun rosserial_python serial_node.py /dev/ttyACM0`[INFO] [WallTime: 1461149079.336082] ROS Serial Python Node
[INFO] [WallTime: 1461149079.343509] Connecting to /dev/ttyACM0 at 57600 baud
[ERROR] [WallTime: 1461149082.330481] Creation of publisher failed: beginner_tutorials
`ROS path [0]=/opt/ros/indigo/share/ros
ROS path [1]=/opt/ros/indigo/share
ROS path [2]=/opt/ros/indigo/stacks
[ERROR] [WallTime: 1461149083.266678] Tried to publish before configured, topic id 125
[ERROR] [WallTime: 1461149083.266678] Tried to publish before configured, topic id 125
[ERROR] [WallTime: 1461149083.266678] Tried to publish before configured, topic id 125

Other examples of arduino like Hello world are working fine. I am getting error only when I use my custom message header.`Why am I getting this error ? please help.


Originally posted by pankaj patel on ROS Answers with karma: 11 on 2016-04-20

Post score: 1

$\endgroup$

2 Answers 2

0
$\begingroup$

Rosanswers logo

Can serial_node.py access the msg definition? Looks like you haven't run message generation through catkin for your custom message package. Or you haven't added devel/install space into your path.

Tutorial here: http://wiki.ros.org/ROS/Tutorials/CreatingMsgAndSrv#Creating_a_msg


Originally posted by vmatos with karma: 124 on 2016-04-20

This answer was ACCEPTED on the original site

Post score: 3


Original comments

Comment by pankaj patel on 2016-04-20:
Hey Vmato thanks a lot. I was forgetting to add install path. It worked now.

Comment by Zero on 2016-10-21:
Hi patel, may I know your detail steps to solve this problem?

Comment by mertwlf on 2020-03-25:
hello, can you share how exactly you solved it please. I am having the same problem and ı am unable to solve it?

Comment by ramizdayi18.04 on 2023-05-30:
hi guys, can you give us a more detail info

$\endgroup$
0
$\begingroup$

Rosanswers logo

I had a similar topic when publishing anything but std_msgs from rosserial_arduino. Specifically, I am publishing sensor_msgs/JointState messages. For me adding nh.negotiateTopics after all nh.advertise and nh.subscribe calls did the trick:

# subscribe and advertise topics
nh.subscribe(position_sub);
nh.advertise(joint_pub);
# give serial_node.py a chance to get to know the topics
nh.negotiateTopics();

Originally posted by Tuebel with karma: 31 on 2020-09-11

This answer was NOT ACCEPTED on the original site

Post score: 3

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.