Bluefox2 IMU
This is a package for publishing the data from the IMU mounted on a Bluefox2 MRS module.
Installation
The driver is part of the full installation of the mrs system (ros-jazzy-mrs-uav-system-full
).
If missing, install it by running the following command (it is part of the mrs_serial
package together with other nodes):
sudo apt install ros-jazzy-mrs-serial
Startup
First, you have to define environment variable 'UAV_NAME'. For example, you can do it by:
export UAV_NAME=uav1
or you can add it to your .bashrc to make it more permanent:
echo "export UAV_NAME=uav1" >> ~/.bashrc
If you do not have this environment variable set, you will see this error message:
Caught exception in launch (see debug for traceback): environment variable 'UAV_NAME' does not exist
Now you can launch the IMU node:
ros2 launch mrs_serial vio_imu.launch.py
The default device for the IMU is /dev/ttyACM0
. If the node can't find this device and you are seeing coresponding error messages in the terminal, you can search for the IMU device and specify it:
ros2 launch mrs_serial vio_imu.launch.py device:=/dev/tty...
Alternatively, you can define the udev rule for your device.
Custom configs
You can provide a custom config to the launch file as
ros2 launch bluefox2 single.launch.py custom_config:=custom_config.yaml
The custom configs allows you to define your own parameters and also to remap the outgoing topics:
uav_name: uav1
enable_profiler: false
portname: /dev/ttyACM0
baudrate: 460800
verbose: false
use_timeout: false
serial_rate: 460800
desired_publish_rate: 200 # 1000, 500, 200, 100, 50... floor(1000/desired_publish_rate)
Note: You cannot specify namespace in your custom config because this node is running as a composable node.
The desired_publish_rate
determines how many messages will be skipped. If it is set to 500
, then every other message is published. If it is set to 100, then only every 10th message is published. Skip factor is computed as floor(1000/desired_publish_rate)
, so it makes sense to only use the integer divisors: 1000, 500, 200, 100, 50...
More info
Check the following sources