Gazebo | Ignition | Community
Ask Your Question
0

Using an IMU Sensor without ros?

asked 2022-05-25 14:59:38 -0500

kgz gravatar image

Ive tried looking through various discussions/docs, etc to find an example of attaching an IMU to a model in Gazebo 11 without using ROS to no avail. I believe this should be possible, but Ive not been able to do it in a way where the appropriate topic shows up in the list of topics.

Here is one example of an attempt, based off a post in these forums:

<?xml version='1.0'?>
<sdf version ='1.5'>
  <model name ='box2'>
    <pose>1 2 0 0 0 0</pose>
    <link name ='link'>
      <pose>0 0 .5 0 0 0</pose>
      <collision name ='collision'>
        <geometry>
          <box><size>1 1 1</size></box>
        </geometry>
      </collision>
      <visual name ='visual'>
        <geometry>
          <box><size>1 1 1</size></box>
        </geometry>
      </visual>
    </link>
   <gazebo reference="link">
        <sensor name="imu" type="imu">
         <always_on>1</always_on>
         <update_rate>1000</update_rate>
         <visualize>true</visualize>
         <topic>__default_topic__</topic>
         <imu>
          <noise>
           <type>gaussian</type>
            <rate>
             <mean>0.0</mean>
             <stddev>2e-4</stddev>
             <bias_mean>0.0000075</bias_mean>
             <bias_stddev>0.0000008</bias_stddev>
            </rate>
            <accel>
             <mean>0.0</mean>
             <stddev>1.7e-2</stddev>
             <bias_mean>0.1</bias_mean>
             <bias_stddev>0.001</bias_stddev>
            </accel>
          </noise>
         </imu>
        </sensor>
        </gazebo>
  </model>
</sdf>

Does anyone know if what I am trying to do is actually possible / have an example of using an IMU without any reliance on ROS?

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
0

answered 2022-05-25 15:48:04 -0500

kgz gravatar image

So in typical fashion, after not being able to figure it out for hours, I almost immediately figured it out right after asking for help.

To fix this issue, you just need to embed sensor inside the actual link, as follows:

 <?xml version='1.0'?>
<sdf version ='1.5'>
  <model name ='box2'>
    <pose>1 2 0 0 0 0</pose>
    <link name ='link'>
      <pose>0 0 .5 0 0 0</pose>
      <collision name ='collision'>
        <geometry>
          <box><size>1 1 1</size></box>
        </geometry>
      </collision>
      <visual name ='visual'>
        <geometry>
          <box><size>1 1 1</size></box>
        </geometry>
      </visual>
      <sensor name="imu" type="imu">
         <always_on>1</always_on>
         <update_rate>1000</update_rate>
         <visualize>true</visualize>
         <topic>__default_topic__</topic>
         <imu>
          <noise>
           <type>gaussian</type>
            <rate>
             <mean>0.0</mean>
             <stddev>2e-4</stddev>
             <bias_mean>0.0000075</bias_mean>
             <bias_stddev>0.0000008</bias_stddev>
            </rate>
            <accel>
             <mean>0.0</mean>
             <stddev>1.7e-2</stddev>
             <bias_mean>0.1</bias_mean>
             <bias_stddev>0.001</bias_stddev>
            </accel>
          </noise>
         </imu>
        </sensor>
    </link>
  </model>
</sdf>
edit flag offensive delete link more
Login/Signup to Answer

Question Tools

1 follower

Stats

Asked: 2022-05-25 14:59:38 -0500

Seen: 10 times

Last updated: May 25