Skip to content

Issue with Go Message generation for ROS bags #34

@cjds

Description

@cjds

Describe the bug
Go message generation doesn't have the correct message definition in the message. It behaves the correct way in most cases but has an issue when being pushed into bags

It causes this issue downstream
ros/common_msgs#20

or in rosjs here
cruise-automation/rosbag.js#69

To Reproduce
Take any bag that records complex topic (one that isn't made up of only primitives) from rosgo. For example diagnostic_msgs/DiagnosticArray recorded causes this. Run this python script against the rospy:

import rosbag

def test(topic, datatype, md5sum, msg_def, header):
    if msg_def == """# This message is used to send diagnostic information about the state of the robot
Header header #for timestamp
DiagnosticStatus[] status # an array of components being reported on""":
        print topic
        return True
    return False

bag = rosbag.Bag('/etc/fetchcore/result/test.bag')
x = bag.read_messages(connection_filter=test)
for msg in x:
    print msg
bag.close()

Expected behavior
Expected behaviour is the diagnostic_msgs/DiagnosticArray will echo and the msg_def will look similar to the C++ and Python ones

Header header #for timestamp
DiagnosticStatus[] status # an array of components being reported on
================================================================================
MSG: std_msgs/Header
# Standard metadata for higher-level stamped data types.
# This is generally used to communicate timestamped data
# in a particular coordinate frame.
#
# sequence ID: consecutively increasing ID
uint32 seq
#Two-integer timestamp that is expressed as:
# * stamp.sec: seconds (stamp_secs) since epoch (in Python the variable is called 'secs')
# * stamp.nsec: nanoseconds since stamp_secs (in Python the variable is called 'nsecs')
# time-handling sugar is provided by the client library
time stamp
#Frame this data is associated with
string frame_id

================================================================================
MSG: diagnostic_msgs/DiagnosticStatus
# This message holds the status of an individual component of the robot.
#

# Possible levels of operations
byte OK=0
byte WARN=1
byte ERROR=2
byte STALE=3

byte level # level of operation enumerated above
string name # a description of the test/component reporting
string message # a description of the status
string hardware_id # a hardware unique string
KeyValue[] values # an array of values associated with the status



================================================================================
MSG: diagnostic_msgs/KeyValue
string key # what to label this value when viewing
string value # a value to track over time

versus what rosgo makes

# This message is used to send diagnostic information about the state of the robot
Header header #for timestamp
DiagnosticStatus[] status # an array of components being reported on

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions