Way to modify messages in rostopic without tweaking stuffs in ros driver
This is an example sensor message from my robot topic (/base_imu/data):
header:
seq: 286841
stamp:
secs: 1634593671
nsecs: 585787017
frame_id: "base_imu_frame"
orientation:
x: 0.000403192
y: 0.019378814
z: -0.9942339840000001
w: 0.105465872
orientation_covariance: [0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0]
angular_velocity:
x: 0.00122173
y: -0.0002138
z: 0.0
angular_velocity_covariance: [0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0]
linear_acceleration:
x: -0.05120641
y: -0.39003008
z: 9.7951648
linear_acceleration_covariance: [0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0]
As shown above, the covariance matrices are blank and I want to fill this message with my own experimental values. The problem is that I'm currently setting these values by 1) subscribing the topic 2) set the values and publish because I cannot access to a ros driver of this robot and modify the code. However, I personally don't like this method (redundancy & message filtering) and want to try any better way to directly set those values. I appreciate if someone can give me some information regarding this.