ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question
1

Changing world_frame in robot_localization to odom instead of map causes gps problems

asked 2020-04-29 04:27:42 -0600

DanielRobotics gravatar image

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")]
        ),
    ])
edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
1

answered 2020-06-24 02:26:11 -0600

Tom Moore gravatar image

Any chance this is a red herring? That message is literally just printing out your GPS lat/long:

https://github.com/cra-ros-pkg/robot_...

Maybe look at all the GPS messages being generated and make sure it's sending out the correct data?

edit flag offensive delete link more

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.

DanielRobotics gravatar image DanielRobotics  ( 2020-06-24 02:47:43 -0600 )edit

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.

Tom Moore gravatar image Tom Moore  ( 2020-06-24 02:49:37 -0600 )edit

Question Tools

3 followers

Stats

Asked: 2020-04-29 04:27:42 -0600

Seen: 399 times

Last updated: Jun 24 '20