ROS2 package for the ICM-20948 with Seeeduino XIAO.
Older version: old-devel
$ cd ~/colcon_ws/src
$ git clone -b humble-devel https://github.com/Alpaca-zip/icm_20948.git
$ wstool merge icm_20948/icm_20948.rosinstall
$ wstool update
$ cd ~/colcon_ws
$ rosdep install -r -y -i --from-paths .
$ colcon build
Get the latest version from the download page.
ICM-20948 | Seeeduino XIAO |
---|---|
GND | GND |
3V3 | VIN |
DA | SDA |
CL | SCL |
After Arduino IDE is run, click File -> Preferences
in the top menu of the IDE. When the Preferences window appears, copy and paste following link to the Additional Boards Manager URLs textbox.
https://files.seeedstudio.com/arduino/package_seeeduino_boards_index.json
Click Tools -> Board -> Boards Manager
..., print keyword "Seeeduino XIAO" in the searching blank. Here comes the "Seeed SAMD Boards". Install it.
Click Tools -> Board
, find "Seeeduino XIAO M0" and select it. Now you have already set up the board of Seeeduino XIAO for Arduino IDE. Then, Select the serial device of the Arduino board from Tools -> Port
menu. This is likely to be COM3 or higher.
Click Sketch -> Include Library -> Manage Libraries
..., print keyword " ICM 20948" in the searching blank. Here comes the "SparkFun 9DoF IMU Breakout - ICM-20948". Install it.
*Important note:
By default the DMP functionality is disabled in the library as the DMP firmware takes up 14301 Bytes of program memory.
To use the DMP, you will need to:
- Edit ICM_20948_C.h
- Uncomment line 29: #define ICM_20948_USE_DMP
- Save changes
If you are using Windows, you can find ICM_20948_C.h in:
Documents\Arduino\libraries\SparkFun_ICM-20948_ArduinoLibrary\src\util
Open the “firmware/firmware.ino”. Then, simply click the Upload
button in the environment. Wait a few seconds and if the upload is successful, the message "Done uploading." will appear in the status bar.
To run the node with a different port, for example on /dev/ttyACM0, you must specify the “port” parameters on the command line:
$ ros2 launch icm_20948 run.launch.xml port:=/dev/ttyACM0 debug:=true