-
Notifications
You must be signed in to change notification settings - Fork 2
InstallingRaspberryPi
The OpenBMP utilizes a ROS node on a raspberry pi 4B for converting and relaying latched commands and data from the main ROS system to the CAN network. The ODrive v3.6 units are daisy chained to the CAN network via the MCP2515 Stand-Alone CAN Controller with SPI Interface. This system is responsible for controlling the 8 DoF upper arms of the robot, from shoulder folding to elbow bending.
Important
Things you will need: 1. CAN Bus Hat for Raspberry Pi 2. Raspberry Pi 4, 4GB or above 3. Ethernet cable 4. Router
[!ToDo] upload the schematics for the custom MCP2515 CAN hat used
To begin, install Ubuntu Desktop (22.04) or Ubuntu Server for arm64 We used Ubuntu 22.04.4 LTS desktop version
Note
The server version can be used to configure a more lightweight and headless setup.
Ubuntu for RPI download page WIP
Attach the hat. Alternatives include Waveshare RS485 CAN HAT
edit .bashrc to include:
export ROS_MASTER_URI=http://192.168.1.100:11311/
export ROS_IP=192.168.1.102
source /opt/ros/noetic/setup.bash
source ~/catkin_ws/devel/setup.bash
edit the files /boot/config.txt, syscfg.txt, and usercfg.txt to enable spi for raspberry pi boards
the line:
dtoverlay=mcp2515-can0,oscillator=16000000,interrupt=25 Update oscillator frequency according to your hat, same with the interrupt pin
Once the can0 connection is setup via SPI, reboot and use the following to check the status of the connection:
ip -det link show can0
ip -details -statistics link show can0
we need to reduce the tx queue length to make sure the most recent data is being broadcasted onto the CAN network from ROS First, we need to shut down can0
sudo ip link set can0 down
Then we can edit the interface's properties
sudo ip link set can0 up type can bitrate 1000000
sudo ip link set can0 txqueuelen 1000
sudo ip link set can0 txqueuelen 1
To make the change effective, restart the systemd-networkd
sudo systemctl enable systemd-networkd
sudo systemctl start systemd-networkd
sudo systemctl restart systemd-networkd
Now running ip -details -statistics link show can0, we should see the txqueuelen reduced to 1
This can happen if txqueuelen is not 1 and system has been left on for a while...
Here are some useful commands to monitor your CANBUS
dmesg | grep -i spi
dmesg | grep -i can
rosrun socketcan_interface socketcan_dump can0
canbusload can0@1000000
python3 -m can.viewer -c "can0" -i "socketcan"
candump can0 -xct z -n 10
copy content of catkin_ws/src into rpi
WIP
sudo apt install git
