Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Pr mag #120

Open
wants to merge 3 commits into
base: humble
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 22 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -157,6 +157,13 @@ Optional parameters:
```
ros2 launch linorobot2_bringup bringup.launch.py base_serial_port:=/dev/ttyACM1
```

- **micro_ros_baudrate** - micro-ROS serial baudrate. default 115200.

```
ros2 launch linorobot2_bringup bringup.launch.py base_serial_port:=/dev/ttyUSB0 micro_ros_baudrate:=921600
```

- **micro_ros_transport** - micro-ROS transport. default serial.
- **micro_ros_port** - micro-ROS udp/tcp port number. default 8888.

Expand All @@ -165,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
8 changes: 7 additions & 1 deletion linorobot2_bringup/launch/default_robot.launch.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,12 @@ def generate_launch_description():
description='Linorobot Base Serial Port'
),

DeclareLaunchArgument(
name='micro_ros_baudrate',
default_value='115200',
description='micro-ROS baudrate'
),

DeclareLaunchArgument(
name='micro_ros_transport',
default_value='serial',
Expand All @@ -55,7 +61,7 @@ def generate_launch_description():
executable='micro_ros_agent',
name='micro_ros_agent',
output='screen',
arguments=['serial', '--dev', LaunchConfiguration("base_serial_port")]
arguments=['serial', '--dev', LaunchConfiguration("base_serial_port"), '--baudrate', LaunchConfiguration("micro_ros_baudrate")]
),

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
14 changes: 14 additions & 0 deletions linorobot2_navigation/config/navigation.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -396,3 +396,17 @@ waypoint_follower:
plugin: "nav2_waypoint_follower::WaitAtWaypoint"
enabled: true
waypoint_pause_duration: 200

velocity_smoother:
ros__parameters:
smoothing_frequency: 20.0
scale_velocities: False
feedback: "OPEN_LOOP"
max_velocity: [0.5, 0.0, 2.5]
min_velocity: [-0.5, 0.0, -2.5]
max_accel: [2.5, 0.0, 3.2]
max_decel: [-2.5, 0.0, -3.2]
odom_topic: "odom"
odom_duration: 0.1
deadband_velocity: [0.0, 0.0, 0.0]
velocity_timeout: 1.0
14 changes: 14 additions & 0 deletions linorobot2_navigation/config/navigation_sim.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -396,3 +396,17 @@ waypoint_follower:
plugin: "nav2_waypoint_follower::WaitAtWaypoint"
enabled: true
waypoint_pause_duration: 200

velocity_smoother:
ros__parameters:
smoothing_frequency: 20.0
scale_velocities: False
feedback: "OPEN_LOOP"
max_velocity: [0.5, 0.0, 2.5]
min_velocity: [-0.5, 0.0, -2.5]
max_accel: [2.5, 0.0, 3.2]
max_decel: [-2.5, 0.0, -3.2]
odom_topic: "odom"
odom_duration: 0.1
deadband_velocity: [0.0, 0.0, 0.0]
velocity_timeout: 1.0