Ask Your Question

morten's profile - activity

2022-01-20 14:07:08 -0600 marked best answer robot_localization posting datum messages and never starting map localization

I ma trying to use the robot_localization package to fuse odometry, imu, and gps data according to link.

As such I have two ekf nodes and a navsat transform node. In the documentation it says that the navsat transform node can work by using the first GPS reading as the datum, as far as I am aware this then means that the wait_for_datum parameter should be set to false.

For me, this results in a neverending loop where ekf_localization_map waits on /odometry_gps from navsat_transform, navsat_transform then waits on /odometry/filtered/map from ekf_localization_map. The whole time navsat_transform spams with messages of

[navsat_transform_node-8] [INFO] [1641296576.110339410] [navsat_transform]: Datum (latitude, longitude, altitude) is (37.50, -122.00, 0.03)
[navsat_transform_node-8] [INFO] [1641296576.110379312] [navsat_transform]: Datum UTM coordinate is (10S, 588391.24, 4150810.87)

I'm not really sure how to set this up properly? Note, I think my setup more or less corresponds to the example param and launch files from the robot_localization github repo.

My config and launch files: config file

# For parameter descriptions, please refer to the template parameter files for each node.
ekf_localization_odom:
  ros__parameters:
    frequency: 30.0
    sensor_timeout: 0.0 #0.1
    two_d_mode: true
    transform_time_offset: 0.0 #0.01
    transform_timeout: 0.0
    print_diagnostics: true
    debug: false

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

    odom0: odometry/wheel
    odom0_config: [false, false, false,
                   false, false, false,
                   true,  true,  false,
                   false, false, true,
                   false, false, false]
    odom0_queue_size: 10
    odom0_nodelay: true
    odom0_differential: false
    odom0_relative: false

    imu0: imu/data
    imu0_config: [false, false, false,
                  true,  true,  true,
                  false, false, false,
                  true,  true,  true,
                  true,  true,  true]
    imu0_nodelay: true # false
    imu0_differential: false
    imu0_relative: false
    imu0_queue_size: 10
    imu0_remove_gravitational_acceleration: true # trying false with 2d_mode: true

    use_control: false

ekf_localization_map:
  ros__parameters:
    frequency: 30.0
    sensor_timeout: 0.0 #0.1
    two_d_mode: true
    transform_time_offset: 0.0 #0.01
    transform_timeout: 0.0
    print_diagnostics: true
    debug: false

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

    odom0: odometry/wheel
    odom0_config: [false, false, false,
                   false, false, false,
                   true,  true,  false,
                   false, false, true,
                   false, false, false]
    odom0_queue_size: 10
    odom0_nodelay: true
    odom0_differential: false
    odom0_relative: false

    odom1: odometry/gps
    odom1_config: [true,  true,  true,
                   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

    imu0: imu/data
    imu0_config: [false, false, false,
                  true,  true,  true,
                  false, false, false,
                  true,  true,  true,
                  true,  true,  true]
    imu0_nodelay: true
    imu0_differential: false
    imu0_relative: false
    imu0_queue_size: 10
    imu0_remove_gravitational_acceleration: true # trying false with 2d_mode: true

    use_control: false

navsat_transform:
  ros__parameters:
# Frequency of the main run loop
        frequency: 30.0

# Delay time, in seconds, before we calculate the transform from the UTM frame to your world frame. This is especially
# important if you have use_odometry_yaw set to true. Defaults to 0.
        delay: 3.0

# PLEASE READ: Like all nodes in robot_localization, this node assumes that your IMU data is reported in the ENU frame.
# Many IMUs report data in the NED frame, so you'll want to verify that your data is in the correct frame before using
# it. 

# If your IMU does not account for magnetic declination ...
(more)
2022-01-18 09:10:50 -0600 asked a question Intra-Process Communication between Components in Container

Intra-Process Communication between Components in Container Is it possible to take advantage of Intra Process Comms (IPC

2022-01-17 06:21:18 -0600 received badge  Notable Question (source)
2022-01-12 02:58:54 -0600 commented answer Setting up parameters for selective application of nav2 libraries

Still unsure about the previous comment. I agree with you that I don't want to use the planner, but my path is 50-50 AB

2022-01-12 02:55:45 -0600 received badge  Popular Question (source)
2022-01-11 09:01:34 -0600 received badge  Popular Question (source)
2022-01-09 08:15:38 -0600 received badge  Popular Question (source)
2022-01-07 03:31:30 -0600 received badge  Popular Question (source)
2022-01-04 07:34:09 -0600 asked a question Publisher/Subscriber dropping messages

Publisher/Subscriber dropping messages I have a publisher/subscriber pair which seem to occasionally be dropping message

2022-01-04 05:52:33 -0600 edited question robot_localization posting datum messages and never starting map localization

robot_localization posting datum messages and never starting map localization I ma trying to use the robot_localization

2022-01-04 05:48:00 -0600 asked a question robot_localization posting datum messages and never starting map localization

robot_localization posting datum messages and never starting map localization I ma trying to use the robot_localization

2022-01-04 02:57:43 -0600 commented answer Using NavigateThroughPoses in foxy

That was what I had expected, I had considered porting it myself but perhaps this will be relatively laborious given the

2022-01-03 07:00:50 -0600 asked a question Using NavigateThroughPoses in foxy

Using NavigateThroughPoses in foxy I am still pretty new to behavior trees and nav2, I am using foxy and would like to u

2021-12-28 09:34:50 -0600 received badge  Notable Question (source)
2021-12-11 12:13:42 -0600 received badge  Popular Question (source)
2021-12-09 03:49:18 -0600 commented answer Setting up parameters for selective application of nav2 libraries

Using the planner necessitates a map though, right? So the path I have generated needs to be appropriate for the control

2021-12-09 03:49:05 -0600 commented answer Setting up parameters for selective application of nav2 libraries

Using the planner necessitates a map though, right? So the path I have generated needs to be appropriate for the control

2021-12-09 03:48:10 -0600 commented answer nav2 Controller server not receiving poses sent through `FollowPath` action

I've tried setting navigation targets through rviz, and this works fine. The point I'm sending through FollowPath is mor

2021-12-08 07:02:43 -0600 asked a question nav2 Controller server not receiving poses sent through `FollowPath` action

nav2 Controller server not receiving poses sent through `FollowPath` action I am trying to send paths, i.e. nav_msgs::ms

2021-12-08 05:38:50 -0600 commented answer Setting up parameters for selective application of nav2 libraries

So, if I understand you right. By changing the BT I can use, for example, the DWB controller without maps, planners, or

2021-12-06 04:36:53 -0600 edited question Setting up parameters for selective application of nav2 libraries

Setting up parameters for selective application of nav2 libraries I want to use the tracking controllers from nav2 as pa

2021-12-06 04:35:15 -0600 edited question Setting up parameters for selective application of nav2 libraries

Setting up parameters for selective application of nav2 libraries I want to use the tracking controllers from nav2 as pa

2021-12-06 03:26:22 -0600 commented question Navigation Stack with in a Vicon environment?

Would also be interested in seeing the solution

2021-12-06 03:22:20 -0600 edited question Setting up parameters for selective application of nav2 libraries

Setting up parameters for very specialized nav2 application I want to use the tracking controllers from nav2 as part of

2021-12-06 03:21:53 -0600 edited question Setting up parameters for selective application of nav2 libraries

Setting up paramerters for very specialized nav2 application I want to use the tracking controllers from nav2 as part of

2021-12-06 03:21:42 -0600 asked a question Setting up parameters for selective application of nav2 libraries

Setting up paramerters for very specialized nav2 application I want to use the tracking controllers from nav2 as part of

2021-12-02 04:31:51 -0600 received badge  Notable Question (source)
2021-12-02 03:56:26 -0600 commented answer tf2 starts saying frame doesn't exist

Ah okay, thanks.

2021-12-02 03:35:27 -0600 edited question tf2 starts saying frame doesn't exist

tf2 starts saying frame doesn't exist I have a problem where whenever I ask for a transform, the very first tf2 message

2021-12-02 03:35:00 -0600 edited question tf2 starts saying frame doesn't exist

tf2 starts saying frame doesn't exist I have a problem where whenever I ask for a transform, the very first tf2 message

2021-12-02 03:34:48 -0600 edited question tf2 starts saying frame doesn't exist

tf2 starts saying frame doesn't exist I have a problem where whenever I ask for a transform, the very first tf2 message

2021-12-02 03:21:36 -0600 edited question tf2 starts saying frame doesn't exist

tf2 starts saying frame doesn't exist I have a problem where whenever I ask for a transform, the very first tf2 message

2021-12-02 03:21:16 -0600 edited question tf2 starts saying frame doesn't exist

tf2 starts saying frame doesn't exist I have a problem where whenever I ask for a transform, the very first tf2 message

2021-12-02 03:17:35 -0600 edited question tf2 starts saying frame doesn't exist

tf2 starts saying frame doesn't exist I have a problem where whenever I ask for a transform, the very first tf2 message

2021-12-02 03:16:22 -0600 edited question tf2 starts saying frame doesn't exist

tf2 starts saying frame doesn't exist I have a problem where whenever I ask for a transform, the very first tf2 message

2021-12-02 02:41:10 -0600 received badge  Popular Question (source)
2021-12-01 16:51:51 -0600 commented answer tf2 starts saying frame doesn't exist

Ye okay I see what you mean, I think I maybe just hadn't considered what was happening under the head with ros2 run tf2_

2021-12-01 16:49:40 -0600 commented answer tf2 starts saying frame doesn't exist

Ye okay I see what you mean, I think I maybe just hadn't considered what was happening under the head with ros2 run tf2_

2021-12-01 14:10:21 -0600 commented answer tf2 starts saying frame doesn't exist

It's for an action, so I figure waitForTransform is probably the best fit. I'll give that a try. That being said, the f

2021-12-01 14:03:52 -0600 answered a question Problem compiling with PCL after recent release

Not really sure what the solution was, after a bout of frustration, many reinstalls, and re-building it works.

2021-12-01 14:03:52 -0600 received badge  Rapid Responder (source)
2021-12-01 08:54:35 -0600 asked a question tf2 starts saying frame doesn't exist

tf2 starts saying frame doesn't exist I have a problem where whenever I ask for a transform, the very first tf2 message

2021-12-01 02:27:45 -0600 commented question Problem compiling with PCL after recent release

Hi, In the last code example I demonstrated that I can still build non-ros c++ projects which use PCL, here there is no

2021-12-01 02:14:14 -0600 commented question Problem compiling with PCL after recent release

Hi, In the last code example I demonstrated that I can still build non-ros c++ projects which use PCL, here there is no

2021-12-01 01:45:57 -0600 received badge  Popular Question (source)
2021-11-30 08:38:11 -0600 asked a question Problem compiling with PCL after recent release

Problem compiling with PCL after recent release I ended up upgrading my foxy release today and with it came a slew of pr

2021-11-26 06:54:11 -0600 received badge  Nice Answer (source)
2021-11-26 06:54:06 -0600 received badge  Notable Question (source)
2021-11-26 06:41:39 -0600 marked best answer Robot localization ekf capped at 10Hz

I'm using the ekf in robot_localization, for some reason it doesn't seem to want to go above the odd 10Hz. I've checked my imu and odometry rates, and they're both 50Hz as I've set them.

I launch the ekf node by ros2 launch tractor_gazebo ekf.launch.py use_sim_time:=true and I check the individual frequencies:

$ ros2 param get /ekf_localization_odom frequency 
Double value is: 30.0
$ ros2 topic hz /imu/data 
average rate: 49.887
    min: 0.020s max: 0.021s std dev: 0.00020s window: 51
$ ros2 topic hz /odometry/wheel 
average rate: 49.910
    min: 0.020s max: 0.021s std dev: 0.00018s window: 51
average rate: 49.853
    min: 0.020s max: 0.021s std dev: 0.00020s window: 101
$ ros2 topic hz /odometry/filtered/odom 
average rate: 9.956
    min: 0.100s max: 0.101s std dev: 0.00033s window: 11
average rate: 9.961
    min: 0.099s max: 0.101s std dev: 0.00043s window: 21

with the launch and config files added at the bottom.

Note: I have tried setting the ekf frequency to less than 10Hz, and this is can follow fine. So, e.g. changing the parameter in the yaml to 5Hz results in publishing to /odometry/filtered/odom at 5Hz, setting it to 15Hz instead results in the topic publishing at 10Hz. This is the core of the problem

ekf.launch.py:

import os
from ament_index_python.packages import get_package_share_directory

from launch import LaunchDescription
from launch.actions import DeclareLaunchArgument
from launch.substitutions import LaunchConfiguration

from launch_ros.actions import Node

def generate_launch_description():
    # get directories
    tractor_gazebo_dir = get_package_share_directory("tractor_gazebo")

    # Create the launch configuration variables
    use_sim_time = LaunchConfiguration("use_sim_time")

    # declare launch arguments
    declare_use_sim_time = DeclareLaunchArgument("use_sim_time")

    # Specify the actions
    robot_localization_odom = Node(
        package="robot_localization",
        executable="ekf_node",
        name="ekf_localization_odom",
        output="screen",
        parameters=[
            {"use_sim_time": use_sim_time},
            os.path.join(
                tractor_gazebo_dir,
                "config",
                "dual_ekf_navsat_toolcarrier.yaml",
            ),
        ],
        remappings=[("odometry/filtered", "odometry/filtered/odom")],
    )

    return LaunchDescription(
        [
            declare_use_sim_time,
            robot_localization_odom,
        ]
    )

config file:

ekf_localization_odom:
  ros__parameters:
    frequency: 30.0
    sensor_timeout: 0.0 #0.1
    two_d_mode: true
    transform_time_offset: 0.0 #0.01
    transform_timeout: 0.0
    print_diagnostics: true
    debug: false

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

    odom0: odometry/wheel
    odom0_config: [false, false, false,
                   false, false, false,
                   true,  true,  false,
                   false, false, true,
                   false, false, false]
    odom0_queue_size: 10
    odom0_nodelay: true
    odom0_differential: false
    odom0_relative: false

    imu0: imu/data
    imu0_config: [false, false, false,
                  true,  true,  true,
                  false, false, false,
                  true,  true,  true,
                  true,  true,  true]
    imu0_nodelay: false
    imu0_differential: false
    imu0_relative: false
    imu0_queue_size: 10
    imu0_remove_gravitational_acceleration: true

    use_control: false

Edit: Following @osilva's comments I have checked the sim time parameter of all the nodes:

morten@agrirobot:~$ ros2 param list
/ackermann_drive:
  use_sim_time
/camera_controller_front:
  use_sim_time
/camera_controller_middle:
  use_sim_time
/controller_manager:
  use_sim_time
/ekf_localization_odom:
  use_sim_time
/gazebo:
  use_sim_time
/gazebo_ros2_control:
  use_sim_time
/velodyne_front/gazebo_ros_laser_controller:
  use_sim_time
/gps:
  use_sim_time
/imu:
  use_sim_time
/joint_state_publisher:
  use_sim_time
/robot_state_publisher:
  use_sim_time

Note, I've trimmed the other parameters so as not to go on too long, I have checked each and every one of these:

morten@agrirobot:~$ ros2 param get /ackermann_drive use_sim_time 
Boolean value is: True
morten@agrirobot:~$ ros2 param get /camera_controller_front use_sim_time 
Boolean value is: True ...
(more)