IMU¶
Imu Sensor¶
Imu sensor script enables you to get Accelerometer, Gyro and Orientation measurements in the MARUS simulator. It represents basic implementation of 9DOF (degrees of freedom) IMU sensor without included noise.
Add script to any game object you want to make IMU. If you set this IMU object as child of an object with a Vehicle tag, name of that object will be automatically inserted as namespace to Frame Id parameter. In the image above Parent object of IMU sensor is called “Boat”. This object has Tag set to Vehicle as visible in the next image. If Debug option is set values will of the Imu will be displayed in the inspector.
It is possible to remove gravity from IMU measurements by setting the With Gravity parameter. IMU measurements will be arriving with frequency set in Sample Frequency parameter.
Using Accelerometer Noise, Gyro Noise and Orientation Noise it is possible to set different noise types for different segments of IMU sensor measurements.
Imu ROS¶
Imu ROS script publishes IMU measurements from simulated IMU sensor to the ROS topic.
This script should be added to a game object which has Imu Sensor script attached to it. If Imu Sensor script does not exist in the object it will be automatically added together with Imu ROS script. Tf streamer script will also be included automatically, even though it is not required for Imu ROS script to work.
Imu ROS script has only two parameters that need to be set. Address parameter in the name of the ROS topic and Update Frequency is the frequency at which it will be published.
To get topic back to ROS make sure ROS server is launched. This is included in grpc_ros_adapter (link) package and can be called from terminal with roslaunch grpc_ros_adapter launch_server.launch.
Server should be live when simulation is started. At this point you should be able to see your topic being published in ROS.