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

Sentence.msg Header Missing

asked 2017-08-11 14:21:12 -0600

vschmidt gravatar image

I'm trying to use the nmea_msgs/Sentence message and I'm stumped on what is probably a python problem.

I've built the package and I can see the results in devel/

$ ls ~/catkin_ws/devel/lib/python2.7/dist-packages/nmea_msgs/msg  __init__.pyc  _Sentence.pyc

And it shows up fine with rosmsg:

$ rosmsg show nmea_msgs/Sentence
std_msgs/Header header
  uint32 seq
  time stamp
  string frame_id
string sentence

But if I source devel/setup.bash and then run ipython, and then import the module I don't actually get a proper Sentence class. For example:

In [1]: from nmea_msgs.msg import Sentence
In [2]: a = Sentence
In [3]: print a.header
<member 'header' of 'Sentence' objects>

Although there is a "header" object, it is not a "Header" object in the sense of a ROS message definition. That is, it has none of the attributes of 'stamp', 'seq' and 'frame_id' for the Header message.

I cannot figure out why.


edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted

answered 2017-08-11 14:34:20 -0600

vschmidt gravatar image

I found the problem!!!

I should have defined the message in iPython like this:

a = Sentence()


edit flag offensive delete link more

Question Tools

1 follower


Asked: 2017-08-11 14:21:12 -0600

Seen: 400 times

Last updated: Aug 11 '17