This routine was reposted by RobStride Dynamics from DR.MuShibo. Sincere gratitude goes to DR.MuShibo for their development and sharing.
- canable (cantact clone): http://canable.io/ (STM32F042C6)
- 灵足的串口转CAN模块只适用于灵足的上位机,Ubuntu上使用需要额外的canable模块。
- 注意自己的ros2版本号,自行修改
sudo apt-get install net-tools
sudo apt-get install can-utils
sudo apt-get install ros-humble-can-msgs
sudo apt-get install ros-humble-socketcan-bridgesudo modprobe can
sudo modprobe can_raw
sudo modprobe can_dev
sudo ip link set can0 type can bitrate 1000000
sudo ip link set can0 up
sudo ifconfig can0 txqueuelen 100- 在工作空间中运行如下命令:
colcon build
source ./install/setup.zsh (or bash)
ros2 run rs_motor_ros2 rs_motor_ros2