You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: setup_guides/odom/setup_robot_localization.rst
+13-13Lines changed: 13 additions & 13 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -6,9 +6,9 @@ In this tutorial, we will discuss how various sources of odometry can be fused t
6
6
7
7
The ``robot_localization`` package is used to provide a fused and locally accurate smooth odometry information from the data provided by ``N`` odometry sensor inputs. These information can be provided to the package through ``nav_msgs/Odometry``, ``sensor_msgs/Imu``, ``geometry_msgs/PoseWithCovarianceStamped``, and ``geometry_msgs/TwistWithCovarianceStamped`` messages.
8
8
9
-
A usual robot setup consists of at least the wheel encoders and IMU as its odometry sensor sources. When multiple sources are provided to ``robot_localization``, it is able to fuse the odometry information given by the sensors through the use of state estimation nodes. These nodes make use of either an Extended Kalman filter (``ekf_filter_node``) or an Unscented Kalman Filter (``ukf_node``) to implement this fusion. In addition, the package also implements a ``navsat_transform_node`` which transforms geographic coordinates into the robot’s world frame when working with GPS.
9
+
A usual robot setup consists of at least the wheel encoders and IMU as its odometry sensor sources. When multiple sources are provided to ``robot_localization``, it is able to fuse the odometry information given by the sensors through the use of state estimation nodes. These nodes make use of either an Extended Kalman filter (``ekf_node``) or an Unscented Kalman Filter (``ukf_node``) to implement this fusion. In addition, the package also implements a ``navsat_transform_node`` which transforms geographic coordinates into the robot’s world frame when working with GPS.
10
10
11
-
Fused sensor data is published by the ``robot_localization`` package through the ``odometry/filtered`` and the ``accel/filtered`` topics, if enabled in its configuration. In addition, it can also publish the ``odom`` => ``base_link`` transform on the ``/tf`` topic. Do note that if you followed :ref:`setup_odom_gz`, you will need to remove the /tf bridge in ``bridge_config.yaml`` to get the transforms from ``ekf_filter_node`` instead of Gazebo.
11
+
Fused sensor data is published by the ``robot_localization`` package through the ``odometry/filtered`` and the ``accel/filtered`` topics, if enabled in its configuration. In addition, it can also publish the ``odom`` => ``base_link`` transform on the ``/tf`` topic. Do note that if you followed :ref:`setup_odom_gz`, you will need to remove the /tf bridge in ``bridge_config.yaml`` to get the transforms from ``ekf_node`` instead of Gazebo.
12
12
13
13
.. seealso::
14
14
More details on ``robot_localization`` can be found in the official `Robot Localization Documentation <http://docs.ros.org/en/noetic/api/robot_localization/html/index.html>`_.
@@ -23,20 +23,20 @@ For the rest of this section, we will show how to use ``robot_localization`` to
23
23
Configuring Robot Localization
24
24
==============================
25
25
26
-
Let us now configure the ``robot_localization`` package to use an Extended Kalman Filter (``ekf_filter_node``) to fuse odometry information and publish the ``odom`` => ``base_link`` transform.
26
+
Let us now configure the ``robot_localization`` package to use an Extended Kalman Filter (``ekf_node``) to fuse odometry information and publish the ``odom`` => ``base_link`` transform.
27
27
28
28
First, install the ``robot_localization`` package using your machines package manager or by executing the following command:
Next, we specify the parameters of the ``ekf_filter_node`` using a YAML file. Create a directory named ``config`` at the root of your project and create a file named ``ekf.yaml``. Copy the following lines of code into your ``ekf.yaml`` file.
34
+
Next, we specify the parameters of the ``ekf_node`` using a YAML file. Create a directory named ``config`` at the root of your project and create a file named ``ekf.yaml``. Copy the following lines of code into your ``ekf.yaml`` file.
35
35
36
36
.. code-block:: yaml
37
37
38
38
### ekf config file ###
39
-
ekf_filter_node:
39
+
ekf_node:
40
40
ros__parameters:
41
41
# The frequency, in Hz, at which the filter will output a position estimate. Note that the filter will not begin
42
42
# computation until it receives at least one message from one of the inputs. It will then run continuously at the
@@ -85,7 +85,7 @@ Next, we specify the parameters of the ``ekf_filter_node`` using a YAML file. Cr
85
85
86
86
In this configuration, we defined the parameter values of ``frequency``, ``two_d_mode``, ``publish_acceleration``, ``publish_tf``, ``map_frame``, ``odom_frame``, ``base_link_frame``, and ``world_frame``. For more information on the other parameters you can modify, see `Parameters of state estimation nodes <http://docs.ros.org/en/melodic/api/robot_localization/html/state_estimation_nodes.html#parameters>`_, and a sample ``efk.yaml`` can be found `here <https://github.com/cra-ros-pkg/robot_localization/blob/ros2/params/ekf.yaml>`_.
87
87
88
-
To add a sensor input to the ``ekf_filter_node``, add the next number in the sequence to its base name (odom, imu, pose, twist). In our case, we have one ``nav_msgs/Odometry`` and one ``sensor_msgs/Imu`` as inputs to the filter, thus we use ``odom0`` and ``imu0``. We set the value of ``odom0`` to ``demo/odom``, which is the topic that publishes the ``nav_msgs/Odometry``. Similarly, we set the value of ``imu0`` to the topic that publishes ``sensor_msgs/Imu``, which is ``demo/imu``.
88
+
To add a sensor input to the ``ekf_node``, add the next number in the sequence to its base name (odom, imu, pose, twist). In our case, we have one ``nav_msgs/Odometry`` and one ``sensor_msgs/Imu`` as inputs to the filter, thus we use ``odom0`` and ``imu0``. We set the value of ``odom0`` to ``demo/odom``, which is the topic that publishes the ``nav_msgs/Odometry``. Similarly, we set the value of ``imu0`` to the topic that publishes ``sensor_msgs/Imu``, which is ``demo/imu``.
89
89
90
90
To understand how ``robot_localization`` is configured and understand the reasoning behind the config have a look at `Configuring robot_localization <http://docs.ros.org/en/melodic/api/robot_localization/html/configuring_robot_localization.html>`_.
91
91
@@ -96,14 +96,14 @@ To understand how ``robot_localization`` is configured and understand the reason
96
96
Launch and Build Files
97
97
======================
98
98
99
-
Now, let us add the ``ekf_filter_node`` into the launch file. Open ``launch/display.launch.py`` and paste the following lines before the ``return launch.LaunchDescription([`` line.
99
+
Now, let us add the ``ekf_node`` into the launch file. Open ``launch/display.launch.py`` and paste the following lines before the ``return launch.LaunchDescription([`` line.
@@ -175,17 +175,17 @@ You can also check the subscriber count of these topics again by executing:
175
175
176
176
You should see that ``/demo/imu`` and ``/demo/odom`` now both have 1 subscriber each.
177
177
178
-
To verify that the ``ekf_filter_node`` are the subscribers of these topics, execute:
178
+
To verify that the ``ekf_node`` are the subscribers of these topics, execute:
179
179
180
180
.. code-block:: shell
181
181
182
-
ros2 node info /ekf_filter_node
182
+
ros2 node info /ekf_node
183
183
184
184
You should see an output as shown below.
185
185
186
186
.. code-block:: shell
187
187
188
-
/ekf_filter_node
188
+
/ekf_node
189
189
Subscribers:
190
190
/demo/imu: sensor_msgs/msg/Imu
191
191
/demo/odom: nav_msgs/msg/Odometry
@@ -201,7 +201,7 @@ You should see an output as shown below.
201
201
Service Servers:
202
202
...
203
203
204
-
From the output above, we can see that the ``ekf_filter_node`` is subscribed to ``/demo/imu`` and ``/demo/odom``. We can also see that the ``ekf_filter_node`` publishes on the ``odometry/filtered``, ``accel/filtered``, and ``/tf`` topics.
204
+
From the output above, we can see that the ``ekf_node`` is subscribed to ``/demo/imu`` and ``/demo/odom``. We can also see that the ``ekf_node`` publishes on the ``odometry/filtered``, ``accel/filtered``, and ``/tf`` topics.
205
205
206
206
You may also verify that ``robot_localization`` is publishing the ``odom`` => ``base_link`` transform by using the tf2_echo utility. Run the following command in a separate command line terminal:
0 commit comments