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 worldframe in the .yaml parameters file from map to odom navsattransform 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 worldframe everything is fine. The only change is the worldframe 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")]
),
])
Asked by DanielRobotics on 2020-04-29 04:27:42 UTC
Answers
Any chance this is a red herring? That message is literally just printing out your GPS lat/long:
Maybe look at all the GPS messages being generated and make sure it's sending out the correct data?
Asked by Tom Moore on 2020-06-24 02:26:11 UTC
Comments
The message is not printed when having world_frame: map in the .yaml file and then data is published, as expected, to /odometry/filtered and /odometry/gps. But when changing to world_frame: odom, no data is published to /odometry/filtered and /odometry/gps.
Since switching to world_frame: map have it running with no problems I do not believe that the GPS messages are the problem.
Asked by DanielRobotics on 2020-06-24 02:47:43 UTC
OK, but the fact remains that the code is directly printing out the message it receives, and that printout is showing garbage. Regardless, as with all r_l questions, please include sample sensor messages from every sensor input.
Asked by Tom Moore on 2020-06-24 02:49:37 UTC
Comments