openarm_ros2/openarm_hardware/setup.bash
thomason 595fbe7745
Implement openarm ros2_control support with openarm_hardware and openarm_bringup (#2)
- openarm_bringup: ros2_control bringup
- openarm_hardware: hardware interface for ros2_control
2025-03-28 18:05:38 +09:00

20 lines
401 B
Bash
Executable File

#!/bin/bash
CAN_INTERFACE=can0
for DEVICE in /dev/ttyACM*; do
if [ -e "$DEVICE" ]; then
echo "Using device: $DEVICE"
break
fi
done
if [ -z "$DEVICE" ]; then
echo "No /dev/ttyACM* device found."
exit 1
fi
sudo pkill -f slcand
sudo slcand -o -c -s8 "$DEVICE" "$CAN_INTERFACE"
sudo ip link set "$CAN_INTERFACE" up type can bitrate 1000000
ip link show "$CAN_INTERFACE"