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

navsat_transform node doesn't publish utm_transform

asked 2023-06-22 15:33:32 -0500

Dan__2022 gravatar image

updated 2023-06-23 13:36:24 -0500

Hi, please, help me with following issue, i've been trying to solve it for a week already...

Can't make my navsat_transform node publishing utm_transform. And odometry/filtered from EKF always has Pose-Position X Y and Z = 0 (although Orientation on Z isn't 0) - is it right at all?

gps/filtered and odometry/gps are published correctly by navsat_transform node

demo/imu plugin publishes demo/imu topic
demo/gps plugin publishes demo/gps topic

no errors, output is

[navsat_transform_node-5] [INFO] [1687465374.225880796] [navsat_transform_node]: Datum (latitude, longitude, altitude) is (, , *) what is wrong with my configuration? Thanks!

launch file extract:

  robot_localization_node = launch_ros.actions.Node(
         package='robot_localization',
         executable='ekf_node',
         name='ekf_filter_node',
         output='screen',
         parameters=[os.path.join(pkg_share, 'config/ekf.yaml'), {'use_sim_time': LaunchConfiguration('use_sim_time')}]
    )
 navsat_transform_node = launch_ros.actions.Node(
             package='robot_localization',
             executable='navsat_transform_node',
             name='navsat_transform_node',
             output='screen',
             parameters=[os.path.join(pkg_share, 'config/navsat_transform.yaml'),{'use_sim_time':
LaunchConfiguration('use_sim_time')}],
             remappings=[('gps/fix', 'demo/gps'),('imu', 'demo/imu')]
        )

navsat_transform.yaml

navsat_transform:
  ros__parameters:
    use_sim_time: true
    frequency: 10.0
    delay: 3.0
    magnetic_declination_radians: 0.2008874  
    yaw_offset: 1.5707963
    zero_altitude: true
    broadcast_utm_transform: true  
    broadcast_utm_transform_as_parent_frame: true
    publish_filtered_gps: true
    use_odometry_yaw: false
    wait_for_datum: true

ekf.yaml

ekf_filter_node:
    ros__parameters:

        use_sim_time: true
        frequency: 30.0
        sensor_timeout: 0.1
        transform_time_offset: 0.0
        transform_timeout: 0.0
        two_d_mode: true
        publish_acceleration: true
        publish_tf: true
        print_diagnostics: true
        debug: false
        reset_on_time_jump: true


        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
        imu0_remove_gravitational_acceleration: true
        use_control: false

[EDIT]
Timothee, thank you so much!
I've had no error like "What strange is that you should have gotten a RCLCPP WARN saying : Parameter 'broadcast_utm_transform' has been deprecated. Please use 'broadcast_cartesian_transform' instead."

Maybe somthing is totally wrong with some global set-up in my system?

reconfiguring like

map_frame: map             
 odom_frame: base_link   
 base_link_frame: base_link     
 world_frame: map

resulted in error [ekf_filter_node]: Invalid frame configuration! The values for map_frame, odom_frame, and base_link_frame must be unique. If using a base_link_frame_output values, it must not match the map_frame or odom_frame.

2nd EKF, as far as I got, not useful with only IMU without wheels odometry. I'm not going to use wheels odometry in my robot... so changed it to

  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: map           # Defaults to the value of odom_frame if unspecified

In navsat yaml replaced utm* with

broadcast_cartesian_transform_: true  
broadcast_cartesian_transform_as_parent_frame_: true

provided map->odom transform from topic odometry/gps as

self.create_subscription(Odometry, 'odometry/gps', self.__og_sensor_callback, 10)
....
 def __og_sensor_callback(self, msg):
  self.get_logger().info('Publishing TF odom -> base_link ')
        t = TransformStamped()
        t.header.stamp = self.get_clock().now().to_msg()
        t.header.frame_id = 'odom ...
(more)
edit retag flag offensive close merge delete

2 Answers

Sort by » oldest newest most voted
0

answered 2023-06-24 08:59:48 -0500

Dan__2022 gravatar image

Found the error For those, who has the same problem. In launch file the name of the node was name='navsat_transform_node', and in yaml file "navsat_transform" both names should be the same - navsat_transform_node in this case.

edit flag offensive delete link more
0

answered 2023-06-22 17:55:35 -0500

Timothée gravatar image

updated 2023-06-23 04:13:20 -0500

I think your problem is that you should have two different nodes publishing two different transform :

  1. The first one fuse all continuous data (usually odometry and IMU) and publish the odom -> base_link transform
  2. The second fuse all data and publish map -> odom transform

Now what's really important is that the map -> odom transform doesn't represent anything on its own. It exist purely because the tf2 system cannot have two parent to a frame. In fact, the map -> base_link transform (that go through odom) and the odom -> base_link transform are the one representing something. The map -> base_link transform represent the best localization estimation but can jump, while the odom -> base_link transform is the best continuous estimation that you have.

Knowing all this, your problem mighth be that you have nothing publishing the map -> odom transform.

To solve your issue without adding a node, you could go with this parameter for your ekf :

 map_frame: map             
 odom_frame: base_link
 base_link_frame: base_link  
 world_frame: map

Tell me if this did the trick !


Can't make my navsat_transform node publishing utm_transform. And odometry/filtered from EKF always has Pose-Position X Y and Z = 0 (although Orientation on Z isn't 0) - is it right at all?

Your pose.position represent your position, not orientation, so Z = 0 means your at a zero level altitude, but I think it just because you don't have anything giving your ekf an altitude. If you want to get it from the gps, your imu0 config should be three true on the first line.


I also believe that the documentation of navsat transform node is not updated according to all the changes made and that the parameter you need to set to true might not be broadcast_utm_transform: truebut broadcast_cartesian_transform_: true (along with broadcast_cartesian_transform_as_parent_frame_: true)

What strange is that you should have gotten a RCLCPP WARN saying : Parameter 'broadcast_utm_transform' has been deprecated. Please use 'broadcast_cartesian_transform' instead.

edit flag offensive delete link more

Comments

Timothee, thank you so much! added [EDIT] to my first post

Dan__2022 gravatar image Dan__2022  ( 2023-06-23 13:10:50 -0500 )edit

Question Tools

1 follower

Stats

Asked: 2023-06-22 15:33:32 -0500

Seen: 133 times

Last updated: Jun 24 '23