Why while moving backwards the Odometry/gps/Pose/Pose/position/x increasing
Hello, I have navsattransformnode which takes data from GPS and odometry/filtered from ekffilternode.
Can't understand, why when my virtual robot moves backwards, the odometry/gps X increased? And when it crosses 0 on X the odometry/gps X instead of being negative becomes some crazy 667955
map->odom is translated as
map_transform = launch_ros.actions.Node(
package='tf2_ros',
executable='static_transform_publisher',
output='screen',
arguments = ['--frame-id','map','--child-frame-id', 'odom']
)
base_link->odom: (msg is subscription to Odometry from /odometry/gps)
self.create_subscription(Odometry, '/odometry/gps', self.__og_sensor_callback, 10)
def __og_sensor_callback(self, msg):
t = TransformStamped()
t.header.stamp = self.get_clock().now().to_msg()
t.header.frame_id = 'base_link' # here if header is 'odom' and child - 'base_link', in Gazebo
t.child_frame_id = 'odom' #robot moves forward, and in Rviz - backward. strange
t.transform.translation.x = msg.pose.pose.position.x
t.transform.translation.y = msg.pose.pose.position.y
t.transform.translation.z = 0.0
t.transform.rotation=msg.pose.pose.orientation
self.tf_broadcaster.sendTransform(t)
ekf config is
map_frame: map # Defaults to "map" if unspecified
odom_frame: odom # Defaults to "odom" if unspecified
base_link_frame: base_link # Defaults to "base_link" if unspecified
world_frame: odom # Defaults to the value of odom_frame if unspecified
odom0: /odometry/gps
odom0_config: [true, true, false,
false, false, false,
false, false, false,
false, false, false,
false, false, false]
odom0_queue_size: 10
odom0_nodelay: false
odom0_differential: false
odom0_relative: false
imu0: /demo/imu
imu0_config: [false, false, false,
true, true, true,
false, false, false,
true, true, true,
true, true, true]
imu0_nodelay: false
imu0_differential: false
odom0_relative: false
imu0_queue_size: 7
use_control: false
navsat_transform is
navsat_transform:
ros__parameters:
use_sim_time: true
frequency: 30.0
magnetic_declination_radians: 0.0849975346 # For lat/long 57.452989, 10.021515
yaw_offset: 1.5707963
zero_altitude: true
broadcast_utm_transform: false
publish_filtered_gps: true
use_odometry_yaw: false
wait_for_datum: false
[EDIT] Tried to mirror base_joint on 180deg in my URDF - no effect robot moves backward, Odometry/gps X coordinate increasing (as well as Y is inverted in the same way)
please, help
Asked by Dan__2022 on 2023-06-17 15:14:26 UTC
Answers
I found the solution, in the world .sdf file heading_deg should be rotated on 180deg in spherical_coordinates section.
<spherical_coordinates>
<surface_model>EARTH_WGS84</surface_model>
........
<heading_deg>180</heading_deg>
</spherical_coordinates>
maybe it should be highlighted in some docs related to GPS in Gazebo.
Asked by Dan__2022 on 2023-06-18 13:10:10 UTC
Comments