This project aims to develop and maintain ROS2 drivers for the IM1R product.
- Ubuntu 22.04 / ROS2 Humble
- Ubuntu 20.04 / ROS2 Foxy
-
Install ROS2: Please refer to the ROS2 Documentation for detailed instructions.
-
Install Dependencies:
Run the following commands to install dependencies based on your system's Python version:
```shell sudo apt update sudo apt install python3-pip pip3 install pyserial ``` -
Create ROS2 workspace:
mkdir -p ~/ros2_ws/src -
Clone the project repository to the src directory of your catkin workspace:
cd ~/ros2_ws/src git clone https://github.com/DAISCHSensor/im1r_ros2_driver.git git clone https://github.com/DAISCHSensor/im1r_ros2_interface.git
-
Install ROS dependencies:
cd ~/ros2_ws rosdep install --from-paths src --ignore-src -r -y
-
Build the driver:
cd ~/ros2_ws/ colcon build
-
Update the
.bashrcfile:⚠️ Note: If you've already added these lines to your .bashrc, do not add them again to avoid duplicates.For ROS 2 Foxy
echo "source /opt/ros/foxy/setup.bash" >> ~/.bashrc echo "source ~/ros2_ws/install/setup.bash" >> ~/.bashrc source ~/.bashrc
For ROS 2 Humble
echo "source /opt/ros/humble/setup.bash" >> ~/.bashrc echo "source ~/ros2_ws/install/setup.bash" >> ~/.bashrc source ~/.bashrc
-
Connect IM1R via UART1 data cable.
-
Identify the serial port for the IM1R device:
sudo dmesg | grep ttyAssuming the IM1R device is connected to /dev/ttyUSB0:
sudo chmod 666 /dev/ttyUSB0
-
Confirm the baud rate of the IM1R device. The default baud rate is 115200, which can be modified via the host computer software DS_RVision.
-
Launch the driver node:
- Assume the serial port connected to the IM1R is
/dev/ttyUSB0 - Assume the baud rate used by the IM1R is
115200
ros2 run im1r_ros2_driver im1r_node --ros-args -p serial_port:=/dev/ttyUSB0 -p baud_rate:=115200
- Assume the serial port connected to the IM1R is
-
List all the topic:
ros2 topic list
-
echo the specific topic:
ros2 topic echo /imu/data
imu/data(sensor_msgs/Imu) quaternion, angular velocity and linear accelerationtemperature(sensor_msgs/Temperature) temperature from deviceim1r/extra(DAISCH Custom Topic) extra params from IM1R
| Variable | Supported |
|---|---|
time header.stamp |
✔️ |
string header.frame_id |
✔️ |
float64 orientation.x |
✔️ |
float64 orientation.y |
✔️ |
float64 orientation.z |
✔️ |
float64 orientation.w |
✔️ |
float64[9] orientation_covariance |
✘ |
float64 angular_velocity.x |
✔️ |
float64 angular_velocity.y |
✔️ |
float64 angular_velocity.z |
✔️ |
float64[9] angular_velocity_covariance |
✘ |
float64 linear_acceleration.x |
✔️ |
float64 linear_acceleration.y |
✔️ |
float64 linear_acceleration.z |
✔️ |
float64[9] linear_acceleration_covariance |
✘ |
| Variable | Supported |
|---|---|
time header.stamp |
✔️ |
string header.frame_id |
✔️ |
float64 temperature |
✔️ |
float64 variance |
✘ |
| Variable | Type | Definition | Unit | Remarks |
|---|---|---|---|---|
count |
uint8 | Message counter | - | 0~255 cyclic increment |
timestamp |
uint64 | Timestamp of the measurement | microseconds (µs) | UNIX time |
pitch |
float64 | Pitch angle | degrees (°) | |
roll |
float64 | Roll angle | degrees (°) | |
yaw |
float64 | Yaw angle | degrees (°) | |
imu_status |
uint8 | IMU status indicator | - | Bit 0: Acceleration valid (0) / invalid (1) Bit 2: Angular velocity valid (0) / invalid (1) Higher bits are not defined |
gyro_bias_x |
float64 | Gyroscope bias along the X axis | radians/second (rad/s) | |
gyro_bias_y |
float64 | Gyroscope bias along the Y axis | radians/second (rad/s) | |
gyro_bias_z |
float64 | Gyroscope bias along the Z axis | radians/second (rad/s) | |
gyro_static_bias_x |
float64 | Static gyroscope bias along the X axis | radians/second (rad/s) | |
gyro_static_bias_y |
float64 | Static gyroscope bias along the Y axis | radians/second (rad/s) | |
gyro_static_bias_z |
float64 | Static gyroscope bias along the Z axis | radians/second (rad/s) |
