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

Tried to publish before configured topic id 125

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

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

3 Answers

Sort by » oldest newest most voted

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

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 -0600 )edit

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

Zero gravatar image Zero  ( 2016-10-21 03:19:57 -0600 )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 -0600 )edit

hi guys, can you give us a more detail info

ramizdayi18.04 gravatar image ramizdayi18.04  ( 2023-05-30 06:05:23 -0600 )edit

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

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

answered 2022-05-23 15:03:01 -0600

axn337 gravatar image

I had the same issue. Installing ros-kinetic-genpy solved the problem for me. Just:

sudo apt install ros-kinetic-genpy

and rerun the serial node:

rosrun rosserial_python /dev/ttyACM0

edit flag offensive delete link more

Question Tools

1 follower


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

Seen: 8,660 times

Last updated: Apr 20 '16