# Arm Launch Sequence
The Octo Arm package consists of three main functionalities/nodes.
1. Individual acuator controller of the Arm
2. Arm movement automation from home position to work position and vice versa.
3. Arm Teleoperation
#### Create remote.bash file in ~/.
``` bash
#filename=remote.bash (GroundStation)
export ROS_MASTER_URI=http://10.223.240.0:11311
export ROS_IP=10.223.240.0
```
#### Source remote.bash
```bash
source ~/remote.bash
```
### Arm Controlling Instructions
* Arm should rest at either work or home configuration before or after completing the operation.
* All three nodes can't work at once(currently). Stop one node before starting another.
* Give enough space for the arm to initialize itself before teleoperation.
## Scara Arm Launch Sequence
* In the first terminal, launch roscore
``` bash
roscore
```
* In second terminal, launch am_controller_full. This starts both teleop and work-home nodes.
``` bash
#filename=am_controller_full.launch
roslaunch octo_arm_controller am_controller_full.launch
```
* To move arm from home to work position, initialize motors and call go_to_work service.
``` bash
rossevice call /work_home_config/init_motors
rossevice call /work_home_config/goto_work
```
* After reaching work, stop the motors and start teleop node.
``` bash
rossevice call /work_home_config/stop_motors
rossevice call /octo_arm_controller/init_teleop
```
* After completing operation, use return_to_home service in teleop node to bring the arm back to WORK config and stop teleop.
``` bash
rossevice call /octo_arm_controller/return_to_home
rosservice call /octo_arm_controller/stop_teleop
```
* Go back to home
``` bash
rossevice call /work_home_config/init_motors
rossevice call /work_home_config/goto_home
rossevice call /work_home_config/stop_motors
```
## Copter Arm Launch Sequence
* In the first terminal, launch roscore
``` bash
roscore
```
* In second terminal, launch am_controller_full. This starts work-home node.
``` bash
#filename=am_controller_full.launch
roslaunch octo_arm_teleop work_home_arm_config.launch
```
* To move arm from home to work position, initialize motors and call go_to_work service.
``` bash
rossevice call /work_home_config/init_motors
rossevice call /work_home_config/goto_work
```
* After reaching work, stop the motors and start teleop node.
``` bash
rossevice call /work_home_config/stop_motors
roslaunch octo_arm_teleop octo_arm_teleop.launch
rossevice call /octo_arm_teleop/init_teleop
```
* After completing operation, use return_to_home service in teleop node to bring the arm back to WORK config and stop teleop.
``` bash
rossevice call /octo_arm_teleop/return_to_home
rosservice call /octo_arm_teleop/stop_teleop
```
* Go back to home
``` bash
roslaunch octo_arm_teleop work_home_arm_config.launch
rossevice call /work_home_config/init_motors
rossevice call /work_home_config/goto_home
rossevice call /work_home_config/stop_motors
```