|
| 1 | +# Hardware Testing - AnkleMotus M1 Ankle Robot |
| 2 | + |
| 3 | +This page introduces the M1DemoMachine and M1ROSDemoMachine, two example CORC apps showing the basic use of the M1 ankle rehabilitation robot. |
| 4 | + |
| 5 | +The M1 is a one DoF admittance based robot developed by Fourier Intelligence: |
| 6 | + |
| 7 | + |
| 8 | +AnkleMotus M1 and torque control framework. |
| 9 | + |
| 10 | +The state machine code can be found in the folder `src/apps/M1DemoMachine`. |
| 11 | + |
| 12 | +It demonstrates the use of: |
| 13 | +- The different control modes of M1 (position, velocity, or torque) |
| 14 | +- The use of the force measurements |
| 15 | + |
| 16 | +The state machine code can be found in the folder `src/apps/M1ROSDemoMachine`. |
| 17 | + |
| 18 | +It demonstrates the use of: |
| 19 | +- The different control modes of M1 in ROS system (position, velocity, or torque) |
| 20 | +- The use of the force measurements |
| 21 | + |
| 22 | +## Setup instruction |
| 23 | + |
| 24 | +It is assumed that an Ubuntu PC is used and ROS is installed. If this is not the case for you, please visit [here](InstallLinux.md) and [here](InstallROS.md). |
| 25 | + |
| 26 | +If not already installed, install ros_control: |
| 27 | +```bash |
| 28 | +$ sudo apt-get install ros-<melodic or noetic>-ros-control ros-<melodic or noetic>-ros-controllers |
| 29 | +``` |
| 30 | + |
| 31 | +Create a catkin workspace if you don't have one yet: |
| 32 | +```bash |
| 33 | +$ mkdir -p ~/catkin_ws/src |
| 34 | +$ cd ~/catkin_ws/ |
| 35 | +$ catkin build |
| 36 | +``` |
| 37 | + |
| 38 | +Clone CORC and the required packages into your workspace: |
| 39 | +```bash |
| 40 | +$ cd ~/catkin_ws/src |
| 41 | +$ git clone --recurse-submodules https://github.com/UniMelbHumanRoboticsLab/CANOpenRobotController.git |
| 42 | +``` |
| 43 | + |
| 44 | +## Build and run M1DemoMachine |
| 45 | + |
| 46 | +Configure the CMakeList.txt, select the M1DemoMachine, and set the flags for using a real robot without ROS support: |
| 47 | + |
| 48 | +```cmake |
| 49 | +#set (STATE_MACHINE_NAME "ExoTestMachine") |
| 50 | +set (STATE_MACHINE_NAME "M1DemoMachine") |
| 51 | +#set (STATE_MACHINE_NAME "M2DemoMachine") |
| 52 | +#set (STATE_MACHINE_NAME "M3DemoMachine") |
| 53 | +#set (STATE_MACHINE_NAME "X2DemoMachine") |
| 54 | +#set (STATE_MACHINE_NAME "LoggingDevice") |
| 55 | +# Comment to use actual hardware, uncomment for a nor robot (virtual) app |
| 56 | +set(NO_ROBOT OFF) |
| 57 | +# ROS Flag. set ON if you want to use ROS. Else, set OFF. |
| 58 | +set(USE_ROS OFF) |
| 59 | +``` |
| 60 | + |
| 61 | +Build CORC: |
| 62 | +```bash |
| 63 | +$ cd ~/catkin_ws |
| 64 | +$ catkin build CORC |
| 65 | +$ source devel/setup.bash |
| 66 | +``` |
| 67 | + |
| 68 | +Initialize the CAN device (No need to repeat this step, unless you restart your PC): |
| 69 | + |
| 70 | +```bash |
| 71 | +$ cd script |
| 72 | +$ ./initCAN0.sh |
| 73 | +``` |
| 74 | + |
| 75 | +Run the compiled executable file: |
| 76 | +```bash |
| 77 | +$ cd ~/catkin_ws |
| 78 | +$ sudo ./build/CORC/M1DemoMachine_APP |
| 79 | +``` |
| 80 | + |
| 81 | +Use keyboard to explore different controllers: |
| 82 | +- Key S: start zeroing/calibration |
| 83 | +- Key X: start monitoring torque reading |
| 84 | +- Key A: position, velocity, and torque controller demonstrations |
| 85 | +- Key Q: return to idle state |
| 86 | + |
| 87 | +## Build and run M1ROSDemoMachine (To be tested) |
| 88 | + |
| 89 | +Configure the CMakeList.txt, select the M1DemoMachine, and set the flags for using a real robot without ROS support: |
| 90 | + |
| 91 | +```cmake |
| 92 | +#set (STATE_MACHINE_NAME "ExoTestMachine") |
| 93 | +#set (STATE_MACHINE_NAME "M1DemoMachine") |
| 94 | +#set (STATE_MACHINE_NAME "M2DemoMachine") |
| 95 | +#set (STATE_MACHINE_NAME "M3DemoMachine") |
| 96 | +#set (STATE_MACHINE_NAME "X2DemoMachine") |
| 97 | +set (STATE_MACHINE_NAME "M1ROSDemoMachine") |
| 98 | +#set (STATE_MACHINE_NAME "LoggingDevice") |
| 99 | +# Comment to use actual hardware, uncomment for a nor robot (virtual) app |
| 100 | +set(NO_ROBOT OFF) |
| 101 | +# ROS Flag. set ON if you want to use ROS. Else, set OFF. |
| 102 | +set(USE_ROS ON) |
| 103 | +``` |
| 104 | + |
| 105 | +Build CORC: |
| 106 | +```bash |
| 107 | +$ cd ~/catkin_ws |
| 108 | +$ catkin build CORC |
| 109 | +$ source devel/setup.bash |
| 110 | +``` |
| 111 | + |
| 112 | +Initialize the CAN device (No need to repeat this step, unless you restart your PC): |
| 113 | + |
| 114 | +```bash |
| 115 | +$ cd script |
| 116 | +$ ./initCAN0.sh |
| 117 | +``` |
| 118 | + |
| 119 | +Run the compiled executable file: |
| 120 | +```bash |
| 121 | +$ cd ~/catkin_ws |
| 122 | +$ roslaunch CORC m1_real.launch |
| 123 | +``` |
0 commit comments