Ask Your Question

Tried to publish before configured topic id 125

asked 2016-04-20 06:24:07 -0500

pankaj patel gravatar image

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 . It created header datatype.h in /sketchbook/libraries/roslib/beginner_tutorials. Now I am able to compile my header file . But while running I am getting following errors:

pankaj@pankaj-HP-Pavilion-dv4-Notebook-PC:~$ rosrun rosserial_python /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.

edit retag flag offensive close merge delete

2 Answers

Sort by » oldest newest most voted

answered 2016-04-20 09:10:20 -0500

vmatos gravatar image

Can 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:

edit flag offensive delete link more


Hey Vmato thanks a lot. I was forgetting to add install path. It worked now.

pankaj patel gravatar image pankaj patel  ( 2016-04-20 11:36:20 -0500 )edit

Hi patel, may I know your detail steps to solve this problem?

Zero gravatar image Zero  ( 2016-10-21 03:19:57 -0500 )edit

hello, can you share how exactly you solved it please. I am having the same problem and ı am unable to solve it?

mertwlf gravatar image mertwlf  ( 2020-03-25 06:43:23 -0500 )edit

answered 2020-09-11 07:42:49 -0500

Tuebel gravatar image

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
# give a chance to get to know the topics
edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

1 follower


Asked: 2016-04-20 06:24:07 -0500

Seen: 5,726 times

Last updated: Apr 20 '16