Symmetric IMU gyroscope and accelerometer data and oscillating time_stamp

asked 2020-08-20 07:27:43 -0500

alexantosh gravatar image

Hello. Am wondering why the gazebo ros plugin is giving symmetric data for all kinds of motion. gyroscope z readings give something expected but x and y Dont make any sense to me yet. Similarly, the accelerometer values. I dont understand why i would even be having accelerometer z values of this magnitude given the fact that they are attached to a car robot moving on straight forwards and backwards on a road. If they indeed are values from the IMU sensor then how best can I process them to at least have graphs that reflect whats going on with the robot?

Another important point is the time_stamp : It is not continously increasing, instead it is just osicilating. Increases for a few frames then resets! Why is this? That is why i used the sequence number of the header to make these plots

Otherwise understandable gibberish is obtained. thanks

gyroscope: x values = angular velocity / x gyroscope y values gyroscope z values Accelerometer x values : linear velocity /x Accelerometer y values iAccelerometer z values

below is the callback that retrieves the data from the rostopic:

>  def cmd_cb(data):
      cmd_data_x = data.angular.x
      cmd_data_y = data.angular.y
      cmd_data_z = data.angular.z
      cmd_linearx = data.linear.x
      cmd_lineary = data.linear.y
      cmd_linearz = data.linear.z
      csv_file = open("v1_cmd.csv", "a")
     csv_file.write(("%f, %f, %f, %f, %f, %f \n")%(cmd_linearx, cmd_lineary,
 cmd_linearz, cmd_data_x, cmd_data_y,
 cmd_data_z))

 csv_file.close()

Sensor calibration details:

base_link2imu:
  x: 0.0
  y: 0.0
  z: 2.6
  roll: 0.0
  pitch: 0.0
  yaw: 0.0

And the corresponding xacro:

<xacro:imu_macro suffix="imu" parent="base_link" namespace=""
                   x="${calibration['base_link2imu']['x']}"
                   y="${calibration['base_link2imu']['y']}"
                   z="${calibration['base_link2imu']['z']}"
                   roll="${calibration['base_link2imu']['roll']}"
                   pitch="${calibration['base_link2imu']['pitch']}"
                   yaw="${calibration['base_link2imu']['yaw']}"
                   fps="100" />
edit retag flag offensive close merge delete