You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Expected behavior: After setting the spherical_coordinates to a latitude and longitude of my region, I expect the Magnetometer system to follow the rotations of the link it is attached to. For example, if I start a simulation with the magnetometer sensor initial pose of <pose>0 0 0 0 0 0</pose>, it is equivalent to say that the x axis is pointing to the North, the y axis is pointing to the East and the magnetic field message should read
as it does, because the Magnetometer system uses a NED reference frame. If that sensor is rotated in Gazebo 90° anti-clockwise by modifying the pose to <pose>0 0 0 0 0 1.570796</pose>, now the x axis ends pointing West, y axis pointing to the North and the magnetic field should read
Actual behavior: It seems that the Magnetometer system rotates in the opposite way, making the x, y and z readings not accurate. When I rotate the model 90° anti-clockwise in Gazebo, setting the pose to <pose>0 0 0 0 0 1.570796</pose>, the magnetic field measurements I get are
Which correspond to a rotation of -90°. I think that the rotation angle in Gazebo reference frame should be transformed from ENU to NED before using it for the magnetic field calculation.
Steps to reproduce
Create a ROS workspace
Download the test code from magnetometer_demos into the src folder of the workspace
Run ros2 launch magnetometer_demos magnetometer.launch.py
Edit simple_mag.world on lines 92 to 95. Leave one of them without any comments
Environment
Description
According to NOAA Magnetic Field Calculators the magnetic field intensity for my location is
spherical_coordinates
to a latitude and longitude of my region, I expect the Magnetometer system to follow the rotations of the link it is attached to. For example, if I start a simulation with the magnetometer sensor initial pose of<pose>0 0 0 0 0 0</pose>
, it is equivalent to say that thex
axis is pointing to the North, they
axis is pointing to the East and the magnetic field message should readas it does, because the Magnetometer system uses a NED reference frame. If that sensor is rotated in Gazebo 90° anti-clockwise by modifying the pose to
<pose>0 0 0 0 0 1.570796</pose>
, now thex
axis ends pointing West,y
axis pointing to the North and the magnetic field should readx
,y
andz
readings not accurate. When I rotate the model 90° anti-clockwise in Gazebo, setting the pose to<pose>0 0 0 0 0 1.570796</pose>
, the magnetic field measurements I get areWhich correspond to a rotation of -90°. I think that the rotation angle in Gazebo reference frame should be transformed from ENU to NED before using it for the magnetic field calculation.
Steps to reproduce
src
folder of the workspaceros2 launch magnetometer_demos magnetometer.launch.py
simple_mag.world
on lines 92 to 95. Leave one of them without any commentscolcon build
to update the workspacePlease let me know if you need any modification to the provided code of if I am missing something.
The text was updated successfully, but these errors were encountered: