# Twins Controller Includes the following important components: - connecting with single arm through ros - calibration - connecting with extruder through ros ### Dependencies - Ubuntu 18 - ROS Melodic - MoveIt for ROS Melodic - Miniconda ### Installation ```bash # get repo git clone --recurse-submodules https://code.research.uts.edu.au/bigprint/twins-controller.git cd twins-controller # create conda env conda create -n ros python=2.7 conda activate ros # install depenedencies sudo apt install ros-melodic-moveit python-rosdep source /opt/ros/melodic/setup.zsh rosdep install --from-path catkin_ws/src --ignore-src -y pip install -r requirements.txt pip install git+https://code.research.uts.edu.au/bigprint/gcode2contour.git # make catkin workspace cd catkin_ws catkin_make cd .. ``` ### Running on Hardware ```bash # source catkin workspace in every shell source ./catkin_ws/devel/setup.zsh ### Run the following 2 or 3 commands in separate tabs # Connect to the UR5e and launch a controller service 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 # OR to connect to both arms simultaneously roslaunch launch/2xbringup.launch ``` 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 ```bash # Optional: Launch RViz to Visualise the arm roslaunch ur5_e_moveit_config moveit_rviz.launch config:=true # Run the main code cd src ipython -i main.py ``` ### Running in Simulation ```bash # Launch simulated ur5e with moveit and visualisation roslaunch ur5_e_moveit_config demo.launch # Run the main code cd src ipython -i main.py ``` ### 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 ```