Changing world_frame in robot_localization to odom instead of map causes gps problems
Setup I have a TurtleBot3 robot with a GPS receiver. I am running ROS2 Dashing on Ubuntu 18.04 and a Raspberry Pi 3 Model B+
Problem
When I change my world_frame in the .yaml parameters file from map to odom navsat_transform node produces info message:
[navsat_transform_node-4] [INFO] [navsat_transform]: Datum (latitude, longitude, altitude) is (-1246152232, -1246031536, -518309968)
[navsat_transform_node-4] [INFO] [navsat_transform]: Datum UTM coordinate is (-124615232, -1246031536)
and no data is published to /odometry/filtered and /odometry/gps. When I have map as world_frame everything is fine. The only change is the world_frame paramater being set to odom that causes this issue. Any ideas to why this is happening?
Yaml param file for ekf_node
ekf_filter_node_map:
ros__parameters:
frequency: 30.0
sensor_timeout: 0.1
two_d_mode: true
transform_time_offset: 0.0
transform_timeout: 0.0
print_diagnostics: true
debug: false
map_frame: map
odom_frame: odom
base_link_frame: base_link
world_frame: map ##Changing this to odom causes the problem.
odom0: odom
odom0_config: [false, false, false,
false, false, true,
false, true, false,
false, false, false,
false, false, false]
odom0_queue_size: 10
odom0_nodelay: true
odom0_differential: false
odom0_relative: false
odom1: odometry/gps
odom1_config: [true, true, false,
false, false, false,
false, false, false,
false, false, false,
false, false, false]
odom1_queue_size: 10
odom1_nodelay: true
odom1_differential: false
odom1_relative: false
Yaml param file for navsat_transform node
navsat_transform:
ros__parameters:
frequency: 30.0
magnetic_declination_radians: 0.0849975346 # For lat/long 57.452989, 10.021515
yaw_offset: 0.0
zero_altitude: false
broadcast_utm_transform: true
publish_filtered_gps: true
use_odometry_yaw: false
wait_for_datum: false
Launch file
from launch import LaunchDescription
from ament_index_python.packages import get_package_share_directory
import launch_ros.actions
import os
import yaml
from launch.substitutions import EnvironmentVariable
import pathlib
import launch.actions
from launch.actions import DeclareLaunchArgument
def generate_launch_description():
return LaunchDescription([
launch.actions.ExecuteProcess(
cmd=['ros2', 'run', 'tf2_ros', "static_transform_publisher",
"-0.08", "0.00", "0.23", "0", "0", "0", "base_link", "gps"],
output='screen'
),
launch_ros.actions.Node(
package='localization',
node_executable='gps',
node_name='gps_node',
output='screen',
),
launch_ros.actions.Node(
package='robot_localization',
node_executable='ekf_node',
node_name='ekf_filter_node_map',
output='screen',
parameters=[os.path.join('/home/ubuntu/loc_nav_ws/src/turtle_localization/params', 'ekf_filter_map.yaml')],
),
launch_ros.actions.Node(
package='robot_localization',
node_executable='navsat_transform_node',
node_name='navsat_transform',
output='screen',
parameters=[os.path.join('/home/ubuntu/loc_nav_ws/src/turtle_localization/params', 'navsat_transform.yaml')],
remappings=[("imu/data", "imu")]
),
])