Does rosbridge_suite support sensor_msgs/Imu ?
I'm trying to publish a sensor_msgs/Imu message via rosbridge_suite, but it seems that it gets hung up on the orientation_covariance field, which is of type double[9].
Here's the json that I've sent:
{
"op": "publish",
"topic": "/imu_raw",
"msg": {
"header": {
"stamp": {
"sec": 1587154682,
"nanosec": 508394240
},
"frame_id": "imu"
},
"orientation": {
"x": 0.000125964405015111,
"y": 0.000125781516544521,
"z": 0.707106590270996,
"w": 0.707106947898865
},
"orientation_covariance": [0, 0, 0, 0, 0, 0, 0, 0, 0],
"angular_velocity": {
"x": 1.54979915123477e-7,
"y": -6.26098639600059e-8,
"z": 7.72354888378679e-11
},
"angular_velocity_covariance": [0, 0, 0, 0, 0, 0, 0, 0, 0],
"linear_acceleration": {
"x": -0.00349057815037668,
"y": -0.00000256077805715904,
"z": -9.80999851226807
},
"linear_acceleration_covariance": [0, 0, 0, 0, 0, 0, 0, 0, 0]
}
}
I put in a debug statement here:
print("1>>> %s %s %s %s %s | %s %s " %
(json.dumps(msg[field_name]), field_rostype, roottype, field_inst, field_stack, type(msg[field_name]), type(field_inst)))
Here's the relevant output:
1>>> [0, 0, 0, 0, 0, 0, 0, 0, 0] double[9] sensor_msgs/Imu [ 0. 0. 0. 0. 0. 0. 0. 0. 0.] ['orientation_covariance'] | <class 'list'> <class 'numpy.ndarray'>
The sensor_msgs/Imu orientation_covariance field is of type numpy.ndarray, which _to_inst doesn't handle, so it gets passed to _to_object_inst which only handles 'dict' types, and this exception gets thrown.
So I think formatted the json poorly or the rosbridge_suite doesn't support fixed-length arrays? Maybe something else? Guidance would be really appreciated. :)