diff --git a/website/docs/software/setup/2-can-setup.mdx b/website/docs/software/setup/2-can-setup.mdx index c7e0697..2694fd5 100644 --- a/website/docs/software/setup/2-can-setup.mdx +++ b/website/docs/software/setup/2-can-setup.mdx @@ -13,7 +13,14 @@ The [electrical BOM](/hardware/bill-of-materials/electrical) contains the device Before proceeding, ensure you have the required tools installed: ```bash -sudo apt install can-utils iproute2 +sudo apt install -y software-properties-common +sudo add-apt-repository -y ppa:openarm/main +sudo apt update +sudo apt install -y \ + can-utils \ + iproute2 \ + libopenarm-can-dev \ + openarm-can-utils ``` ## Find Your CAN Interface @@ -28,7 +35,19 @@ ip link show Replace `can0` with your actual CAN interface name and use a baudrate supported by you interfaces for the steps. -### Option 1: setup manually +### Option 1: use OpenArm CAN library + +The OpenArm CAN library includes convenient setup commands, example usage: + +```bash +# For CAN 2.0 +openarm-can-configure-socketcan can0 + +# For CAN FD at 5mbps (recommended) +openarm-can-configure-socketcan can0 -fd -b 1000000 -d 5000000 +``` + +### Option 2: setup manually **CAN 2.0 Mode** @@ -47,23 +66,6 @@ sudo ip link set can0 type can bitrate 1000000 dbitrate 5000000 fd on sudo ip link set can0 up ``` -### Option 2: use setup scripts - -The OpenArm CAN library includes convenient setup scripts, example usage: - -```bash -# Navigate to openarm_can directory -wget https://github.com/enactic/openarm_can/releases/download/{{OPENARM_CAN_VERSION}}/openarm-can-{{OPENARM_CAN_VERSION}}.tar.gz -tar xf openarm-can-{{OPENARM_CAN_VERSION}}.tar.gz -cd openarm-can-{{OPENARM_CAN_VERSION}}/setup - -# For CAN 2.0 -./configure_socketcan.sh can0 - -# For CAN FD at 5mbps (recommended) -./configure_socketcan.sh can0 -fd -b 1000000 -d 5000000 -``` - ## Verify Configuration Check that your CAN interface is properly configured: diff --git a/website/docs/software/setup/5-motor-config.mdx b/website/docs/software/setup/4-motor-config.mdx similarity index 77% rename from website/docs/software/setup/5-motor-config.mdx rename to website/docs/software/setup/4-motor-config.mdx index 485ce5a..1ad34ae 100644 --- a/website/docs/software/setup/5-motor-config.mdx +++ b/website/docs/software/setup/4-motor-config.mdx @@ -1,17 +1,16 @@ --- -title: '5. Motor Configuration' -sidebar_position: 6 +title: '4. Motor Configuration' +sidebar_position: 5 --- import BlockImage from '@site/src/components/BlockImage'; -# Step 5: Motor Configuration +# Step 4: Motor Configuration :::info **Prerequisites:** Before proceeding, ensure you have: - ✅ Motor IDs configured (Step 1) - ✅ CAN interface configured (Step 2) - ✅ Basic communication tested (Step 3) -- ✅ OpenArm CAN library built (Step 4) ::: ## Overview @@ -33,13 +32,13 @@ Set the baudrate for each motor (replace `1` with your motor CAN ID and `5000000 Set temporarily: ```bash -python3 change_baudrate.py --baudrate 5000000 --canid 1 --socketcan can0 +openarm-can-change-baudrate --baudrate 5000000 --canid 1 --socketcan can0 ``` Save permanently: ```bash -python3 change_baudrate.py --baudrate 5000000 --canid 1 --socketcan can0 --flash +openarm-can-change-baudrate --baudrate 5000000 --canid 1 --socketcan can0 --flash ``` **Important:** After completing the baudrate configuration, reconfigure your CAN interface to match the motor's new baudrate setting for proper communication if necessary. @@ -70,25 +69,23 @@ For grippers, the closed position is used as zero by default. Safety First! The robot will move automatically when calibration starts. Wear safety gear, clear the workspace, and be ready to emergency stop. ::: -**Prerequisites:** Ensure you have completed the [Python binding](https://github.com/enactic/openarm_can#4-python--experimental---temporary-) installation before proceeding with calibration. - The zero position calibration runs **one arm at a time**. Run the zero position calibration (this defaults to can 0, right arm): ```bash -python3 setup/zero_position_calibration.py +openarm-can-zero-position-calibration ``` For specific arms, run: ```bash # Leader-side Left -python3 setup/zero_position_calibration.py --canport can1 --arm_side left_arm +openarm-can-zero-position-calibration --canport can1 --arm_side left_arm ``` ```bash # Follower-side Right -python3 setup/zero_position_calibration.py --canport can2 --arm_side right_arm +openarm-can-zero-position-calibration --canport can2 --arm_side right_arm ``` ```bash # Follower-side Left -python3 setup/zero_position_calibration.py --canport can3 --arm_side left_arm +openarm-can-zero-position-calibration --canport can3 --arm_side left_arm ```