README.md 2.23 KB
Newer Older
Lab Computer's avatar
Lab Computer committed
1
# Twins Controller
Jayant Khatkar's avatar
Jayant Khatkar committed
2
3

Includes the following important components:
4
- connecting with single arm through ros
Lab Computer's avatar
Lab Computer committed
5
6
- calibration
- connecting with extruder through ros
7

8
9
10
11
### Dependencies
- Ubuntu 18
- ROS Melodic
- MoveIt for ROS Melodic
Lab Computer's avatar
Lab Computer committed
12
- Miniconda
13

14

15
### Installation
16
```bash
Lab Computer's avatar
Lab Computer committed
17
# get repo
Lab Computer's avatar
Lab Computer committed
18
git clone --recurse-submodules https://code.research.uts.edu.au/bigprint/twins-controller.git
Lab Computer's avatar
Lab Computer committed
19
cd twins-controller
20

Lab Computer's avatar
Lab Computer committed
21
22
23
# create conda env
conda create -n ros python=2.7
conda activate ros
24

Lab Computer's avatar
Lab Computer committed
25
26
# install depenedencies
sudo apt install ros-melodic-moveit python-rosdep
27
28
source /opt/ros/melodic/setup.zsh
rosdep install --from-path catkin_ws/src --ignore-src -y
Lab Computer's avatar
Lab Computer committed
29
pip install -r requirements.txt
30
pip install git+https://code.research.uts.edu.au/bigprint/gcode2contour.git
Lab Computer's avatar
Lab Computer committed
31
32

# make catkin workspace
33
34
35
36
37
cd catkin_ws
catkin_make
cd ..
```

38
### Running on Hardware
39
```bash
Lab Computer's avatar
Lab Computer committed
40
41
42
# source catkin workspace in every shell
source ./catkin_ws/devel/setup.zsh

43
44
### Run the following 2 or 3 commands in separate tabs

45
# Connect to the UR5e and launch a controller service
46
47
48
roslaunch launch/r1_bringup.launch
# roslaunch launch/r2_bringup.launch #Cannot do both simultaneously
# NOTE: if the IPs change, add robot_ip:=xxxx to the end of the above commands
49
50
51

# OR to connect to both arms simultaneously
roslaunch launch/2xbringup.launch
52
53
54
55
56
57
58
59
60
61
62
```

On the UR tablet do the following steps:
1. Turn tablet on
2. Turn robot on - select bottom left "Power Off"
3. Turn robot on - click ON and then START
3. Run Program
4. Load Program
5. select 'External Controller.urp'
6. Play button (bottom centre-right) > Play from beginning

63

64
```bash
65
66
# Optional: Launch RViz to Visualise the arm
roslaunch ur5_e_moveit_config moveit_rviz.launch config:=true
67

68
# Run the main code
Lab Computer's avatar
Lab Computer committed
69
cd src
Jayant Khatkar's avatar
Jayant Khatkar committed
70
ipython -i main.py
71
```
72

73
### Running in Simulation
74
75
76

```bash
# Launch simulated ur5e with moveit and visualisation 
Lab Computer's avatar
Lab Computer committed
77
roslaunch ur5_e_moveit_config demo.launch
Jayant Khatkar's avatar
Jayant Khatkar committed
78

79
# Run the main code
80
cd src
Jayant Khatkar's avatar
Jayant Khatkar committed
81
82
ipython -i main.py
```
Jayant Khatkar's avatar
Jayant Khatkar committed
83
84
85
86
87
88
89
90
91
92
93

### Debugging

##### Extrusion Port
Make sure the Extrusion port is set to the correct address. If There is a permission denied
error, you will need to change the permissions for 'Others' to match the following:

```
crw-rw-rw- 1 root dialout 166, 0 Jan 29 12:21 /dev/ttyACM0 # This works
crw-rw---- 1 root dialout 166, 1 Jan 29 12:20 /dev/ttyACM1 # This doesn't
```