0
$\begingroup$

Rosanswers logo

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 (*, ***, ***) [navsat_transform_node-5] [INFO] [1687465374.226410996] [navsat_transform_node]: Datum UTM coordinate is (37U, ***.81, *.65) [navsat_transform_node-5] [INFO] [1687465374.303980897] [navsat_transform_node]: Corrected for magnetic declination of 0, user-specified offset of 0 and meridian convergence of -0.0255208. Transform heading factor is now -0.0255726

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' 
        t.child_frame_id = 'base_link'  
        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)

map->odom is published as static transform like

  self.tf_publisher = StaticTransformBroadcaster(self)
    tf = TransformStamped()
    tf.header.stamp = self.get_clock().now().to_msg()
    tf.header.frame_id = 'map'
    tf.child_frame_id = 'odom'
    tf.transform.translation.x = 0.0
    tf.transform.translation.y = 0.0
    tf.transform.translation.z = 0.0
    self.tf_publisher.sendTransform(tf)

get map->odom->base_link->... all setup on TF-tree clear and in proper order, can be traced with ros2 run tf2_ros tf2_echo map odom and ros2 run tf2_ros tf2_echo odom base_link

still no UTM(or cartesian) -> map transform... nothing

and what else i noticed.. although i have "magnetic_declination_radians: 0.2008874" in my navsat_transform.yaml, the output is " Corrected for magnetic declination of 0, user-specified offset of 0 and meridian convergence of -0.0255208. Transform heading factor is now -0.0255722" - and that's not what I set, not 0.2008874.

Should it be like this at all?


Originally posted by Dan__2022 on ROS Answers with karma: 26 on 2023-06-22

Post score: 0

$\endgroup$

1 Answer 1

0
$\begingroup$

Rosanswers logo

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.


Originally posted by Dan__2022 with karma: 26 on 2023-06-24

This answer was ACCEPTED on the original site

Post score: 0

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.