rospy types of message subfields
Hi,
I generate an empty instance of a message type, e.g via genpy.message.get_message_class('sensor_msgs/JointState') and convert it to a string, which results in:
header:
seq: 0
stamp:
secs: 0
nsecs: 0
frame_id: ''
name: []
position: []
velocity: []
effort: []
I would like to fill the arrays with default values, similar to what a "rostopic pub .." call on the command line would give me:
header:
seq: 0
stamp: {secs: 0, nsecs: 0}
frame_id: ''
name: ['']
position: [0]
velocity: [0]
effort: [0]
However, on the python side I don't know how to find out what the types of the lists are, since a type() call on the individual subfields only yields 'list'. Does anyone know how to find out the type of specific fields in messages?