Gazebo simulator - how to get correct robot heading using GazeboRosMagnetic plugin?

618 views
Skip to first unread message

nerdyTurtle

unread,
Feb 6, 2017, 12:12:36 PM2/6/17
to ROS/Orocos Robot Control Special Interest Group

Hi,

I am using GazeboRosMagnetic sensor plugin from hector_gazebo_plugins and due to some reason it seems to be mounted backwards. Because after reading the heading value, my robot turns and goes backwards when I need it to be facing and moving forwards. I tried changing the offset parameter but that didn't seem to help, maybe I am not using the correct values?

Here's my code:

<plugin name="magnetometer" filename="libhector_gazebo_ros_magnetic.so">
    <updateRate>20.0</updateRate>
    <bodyname>base_footprint</bodyname>
    <topicName>magnetometerStatus</topicName>
    <referenceHeading>0.0</referenceHeading>
    <declination>3.0333</declination>
    <inclination>60.0</inclination>
    <offset>0 0 0</offset>
    <driftFrequency>0 0 0</driftFrequency>
    <gaussianNoise>0 0 0</gaussianNoise>
</plugin>


Any help with this will be highly appreciated!

Many thanks

Johannes Meyer

unread,
Feb 6, 2017, 1:58:19 PM2/6/17
to nerdyTurtle, ROS/Orocos Robot Control Special Interest Group
Hi,

your question is not related to Orocos nor ROS control and does not really fit to this group. You should either open an issue at https://github.com/tu-darmstadt-ros-pkg/hector_gazebo/issues if you think it's a bug or post your question at http://answers.gazebosim.org/.

Anyway: The hector_gazebo_ros_magnetic plugin publishes the constant, 3-dimensional earth magnetic field vector relative to the moving model's base frame or whatever other frame you gave in the <bodyName> tag. So it is expected that if the robot turns clock-wise, the vector rotates counter-clockwise and vice-versa. Please add some more details on how you get to a magnetic heading estimate from this information and how this heading would affect your controllers. Also check your spelling: As far as I know SDF tags are case-sensitive.

Kind regards,
Johannes


--
You received this message because you are subscribed to the Google Groups "ROS/Orocos Robot Control Special Interest Group" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ros-sig-robot-control+unsub...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.



--
Johannes Meyer, Roboticist
+32 468 139828
Intermodalics - Gaston Geenslaan 9, 3001 Heverlee - BELGIUM
www.intermodalics.eu
Reply all
Reply to author
Forward
0 new messages