Skip to content

Commit

Permalink
bringup: add madgwick support
Browse files Browse the repository at this point in the history
Enable madgwick filter to fuse imu and magnetometer.

Signed-off-by: Thomas Chou <thomas@wytron.com.tw>
  • Loading branch information
hippo5329 committed May 13, 2024
1 parent e496178 commit 86addee
Show file tree
Hide file tree
Showing 3 changed files with 40 additions and 1 deletion.
15 changes: 15 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -172,6 +172,21 @@ Optional parameters:
ros2 launch linorobot2_bringup bringup.launch.py micro_ros_transport:=udp4 micro_ros_port:=8888
```

- **madgwick** - Set to true to enable magnetometer support. The madgwick filter will fuse imu/data_raw and imu/mag to imu/data. You may visualize the IMU and manetometer by [enable the IMU and magetometer plug-ins](https://automaticaddison.com/how-to-publish-imu-data-using-ros-and-the-bno055-imu-sensor/) in RVIZ2. The ekf filter configuration will need update, as only 'vyaw' is enabled in the default configuration. Both IMU and magnetometer must be calibrated, otherwise the robot's pose will rotate.

```
# enable magnetometer support
ros2 launch linorobot2_bringup bringup.launch.py madgwick:=true orientation_stddev:=0.01
linorobot2_ws/src/linorobot2/linorobot2_base/config/ekf.yaml
imu0: imu/data
imu0_config: [false, false, false,
false, false, true,
false, false, false,
false, false, true,
true, true, false]
```

- **joy** - Set to true to run the joystick node in the background. (Tested on Logitech F710).

Always wait for the microROS agent to be connected before running any application (ie. creating a map or autonomous navigation). Once connected, the agent will print:
Expand Down
25 changes: 24 additions & 1 deletion linorobot2_bringup/launch/bringup.launch.py
Original file line number Diff line number Diff line change
Expand Up @@ -86,13 +86,36 @@ def generate_launch_description():
default_value='/odom',
description='EKF out odometry topic'
),


DeclareLaunchArgument(
name='madgwick',
default_value='false',
description='Use madgwick to fuse imu and magnetometer'
),

DeclareLaunchArgument(
name='orientation_stddev',
default_value='0.003162278',
description='Madgwick orientation stddev'
),

DeclareLaunchArgument(
name='joy',
default_value='false',
description='Use Joystick'
),

Node(
condition=IfCondition(LaunchConfiguration("madgwick")),
package='imu_filter_madgwick',
executable='imu_filter_madgwick_node',
name='madgwick_filter_node',
output='screen',
parameters=[
{'orientation_stddev' : LaunchConfiguration('orientation_stddev')}
]
),

Node(
package='robot_localization',
executable='ekf_node',
Expand Down
1 change: 1 addition & 0 deletions linorobot2_bringup/package.xml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
<url type="repository">https://github.com/linorobot/linorobot2</url>
<url type="bugtracker">https://github.com/linorobot/linorobot2/issues</url>
<buildtool_depend>ament_cmake</buildtool_depend>
<exec_depend>imu_tools</exec_depend>
<exec_depend>robot_localization</exec_depend>
<exec_depend>joy_linux</exec_depend>
<exec_depend>teleop_twist_joy</exec_depend>
Expand Down

0 comments on commit 86addee

Please sign in to comment.