├── environment ├── demo_images │ └── turtlesim.png ├── not_supported_24_04_ros2_jazzy.md ├── 20_04_ros2_foxy.md ├── 22_04_ros2_humble.md └── legacy_20_04_ros1_noetic.md ├── README.md └── quickstarts ├── realsense.md ├── gpu_machines.md ├── tello.md ├── ur5e.md ├── ur5e_ros2.md └── turtlebot3.md /environment/demo_images/turtlesim.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ACFR-RPG/mtrx5700-resources/HEAD/environment/demo_images/turtlesim.png -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # MTRX5700 Resources 2 | MTRX5700 Experimental Robotics course at the University of Sydney. Copyright. This repository contains public resources for enrolled students including quickstart guides, helper code, tips and tricks. Course details can be found on the University website [here](https://www.sydney.edu.au/units/MTRX5700). 3 | 4 | IMPORTANT: The resources here may be updated periodically. This is a communal and dynamic source of information: if you believe anything is incorrect we welcome you to add new knowledge via a pull request. 5 | 6 | ## Guides for Assignments 7 | - [UG Formatting Tips and Tricks](https://github.com/nackjaylor/formatting_tips-tricks) 8 | 9 | ## Environment Setup 10 | - [Ubuntu 22.04 Environment (2025)](environment/22_04_ros2_humble.md) 11 | 12 | ## Robot Starter Guides 13 | - [Tello Drone starter guide](quickstarts/tello.md) 14 | 15 | - [UR5E Robotic Arm starter guide (ROS2)](quickstarts/ur5e_ros2.md) 16 | - [Turtlebot3 starter guide](quickstarts/turtlebot3.md) 17 | 18 | ## Sensor Starter Guides 19 | - [Intel Realsense D435/D435i](quickstarts/realsense.md) 20 | 21 | ## Compute Hardware 22 | - [GPU Lab Machines](quickstarts/gpu_machines.md) 23 | -------------------------------------------------------------------------------- /quickstarts/realsense.md: -------------------------------------------------------------------------------- 1 | # Intel Realsense D435/D435i 2 | 3 | ## SDK 4 | You can get the SDK from an apt install. Please follow the instructions listed [here](https://github.com/IntelRealSense/librealsense/blob/master/doc/distribution_linux.md). 5 | This will give you the C/C++ SDk and associated libraries, however given most of this course is taught in Python you will want some bindings. 6 | 7 | ```bash 8 | pip install pyrealsense2 9 | ``` 10 | 11 | Documentation for the SDKs is provided below. 12 | 13 | [C/C++ Documentation](https://intelrealsense.github.io/librealsense/doxygen/annotated.html) | 14 | [Python Documentation](https://intelrealsense.github.io/librealsense/python_docs/_generated/pyrealsense2.html) 15 | 16 | ## Realsense Viewer 17 | The best way to acquaint yourself with the capabilities of the Realsense cameras is to use the `realsense-viewer` application shipped as part of the SDK. Here you can check which streams are available, which configurations of streams are available in a combination off the camera and get a feel for field of view, maximum sensing distances etc, as well as dialing in manual exposure settings. 18 | 19 | ## Examples 20 | 21 | Find some example code for getting the Realsense camera running at the below links. 22 | 23 | [C/C++](https://dev.intelrealsense.com/docs/code-samples) | [Python Examples](https://dev.intelrealsense.com/docs/python2) 24 | 25 | ## Calibration 26 | The calibration and camera parameters are stored on the Realsense camera themselves. *DO NOT OVERWRITE THESE CONFIGURATIONS ON THE CAMERAS*, however we recommend that as part of your set-up you perform calibration of the cameras to compare against the stored parameters, and if needed use your own calibrations. The above documentation will assist you in retrieving these parameters. 27 | 28 | ## Tools for Interfacing with Data 29 | We recommend that you use OpenCV for doing any image processing from the Realsense cameras, and Open3D for any pointcloud work. 30 | -------------------------------------------------------------------------------- /quickstarts/gpu_machines.md: -------------------------------------------------------------------------------- 1 | # GPU Enabled Lab Machines 2 | In this course we have access to two remote lab machines with GPUs to train and run machine learning code. These are available to students and may be logged into using your standard lab machine username and password. 3 | 4 | ## IP Addresses 5 | 6 | The two machines are abled to be accessed using: 7 | 8 | ```bash 9 | ssh @kirbylab-gpu-0X.mxlab.acfr.usyd.edu.au 10 | ``` 11 | Where X is one of 1 or 2 indicating the machine number. You will need to be on the University of Sydney VPN to access these resources. 12 | 13 | ## Managing Runtime 14 | To be as fair as possible, these machines will run with different processes on each GPU. That means each machine may have at most 2 groups running things on each machine at each time. There will be a Google sheet available from the MTRX5700 staff with the machine and its GPU(s) which you are to check and schedule into. Where groups are seen to hog the GPU, their processes will be killed automatically to ensure fair and equal availability to the class. 15 | 16 | For major projects, we expect that not all of the class will seek to use a machine learning component, and the runtimes for this will be managed accordingly. 17 | 18 | ## Machine Details 19 | | Spec | kirbylab-gpu-01 | kirbylab-gpu-02 | 20 | | ----------- | ----------- | ----------- | 21 | | CPU | i7-7820X (16) @ 4.6GHz | i7-5930K (12) @ 3.7GHz | 22 | | GPU 0 | RTX3080 | GTX1080 | 23 | | GPU 1 | RTX3080 | GTX1080| 24 | | RAM | 32GB | 64GB 25 | | System | Ubuntu 20.04.5 |Ubuntu 20.04.5 | 26 | 27 | 28 | `gpu-02` is likely best for things like SLAM with feature detection running on the GPU, since it has higher memory, while `gpu-01` might be better for depth estimation or pretraining an object detection/segmentation network. 29 | 30 | ## Moving Datasets 31 | Your user directory is synced between the Lab PCs and the GPU enabled machines. As such, you can place your datasets in your home directory, and your code and it will appear shortly in the directory of the GPU machines. Note it has to be in the root of your home directory - do not place in Downloads! 32 | 33 | 34 | ## Running Restricted to Single GPU 35 | 36 | The following bash script might be useful to you in running training code restricted to a single GPU. You should do this where possible. Do not hog GPUs. 37 | 38 | ```bash 39 | #!/bin/bash 40 | 41 | export CUDA_VISIBLE_DEVICES=X #Where X is 0 or 1 42 | 43 | python3 train.py 44 | ``` 45 | 46 | You should then call `./train.sh` to execute the above script from the same folder as your python script (assuming you've called it this). This ensures pytorch only ever ses the GPU which has been set to visible. 47 | 48 | Note you may need to chmod +x the shell script. 49 | -------------------------------------------------------------------------------- /quickstarts/tello.md: -------------------------------------------------------------------------------- 1 | # Tello EDU Drones 2 | 3 | IMPORTANT: Any students wishing to operate a drone in this course must acquire their remotely piloted aircraft (RPA) operator accreditation. This is free, and available online through the Civil Aviation Safety Authority (CASA). Information and an outline of how to obtain this may be found [at this link](https://www.casa.gov.au/drones/get-your-operator-credentials/operator-accreditation). 4 | 5 | ## ROS2 6 | The Tello drones are not locked to ROS2 Humble as we use in this course. 7 | 8 | Should you wish to use other versions of ROS or ROS2 you will need to source appropriate drivers (or write your own!) to operate the drones. 9 | 10 | ## Install and Setup 11 | Refer to the installation instructions in [the Tello ROS2 driver repo for this course](https://github.com/ACFR-RPG/tello-driver-ros). 12 | 13 | 14 | ## WiFi Connection 15 | All Tello EDU Drones are their own WiFi hotspot. Connection to the drones is done via this link. Note you will need an ethernet connection to your laptop should you wish to retain internet connection during this time. 16 | 17 | Each drone has their WiFi hotspot name printed in the battery bay and on a sticker on the top face of the drone. Make note of the drones unique hotspot name prior to inserting the battery and starting it up. 18 | 19 | ## Operation 20 | Ensure the drone has at least a 5x5x5m volume to operate in, and one person is designated as a spotter for the drone, ensuring no one comes within the operating area. There should always therefore be at least 2 people with eyes on the drone at all times: the pilot and the spotter. 21 | 22 | When operating the drone be advised that you must only have one connection to the drone. Use of the Tello app to remote control the drone at the same time as an active ROS connection will cause the ROS connection to fail. 23 | 24 | 25 | ## Known Things to Watch Out For 26 | If IMU data does not appear to change, you may need to power cycle the drone to refresh the IMU and it's topic publisher. If relying on IMU data where it feeds back into control of the drone through ROS, you *must* implement a sanity check of the IMU data before autonomous operation of the drone. 27 | 28 | The video feed can be subject to some screen tearing and compression artefacts. Confirm you have a stable connection to the drone, line of sight between the controlling PC and the drone and that your code has checks for poor quality frames (which are denoted as having errors by the driver). 29 | 30 | The drones go into sleep mode after some time of no operation, which may cause you to lose connection. You will need to restart the drone. 31 | 32 | 33 | ## Multiple Tello Drones 34 | It is possible to configure the Tello EDU drones into a "station mode" which allows them to connect to the same WiFi network for swarm control. However, the caveat here is that the drones do not broadcast imagery in this mode and it is software locked. 35 | 36 | A work around devised by the community comes in the form of using multiple connections and UDP forwarding to acquire streams from multiple drones. We have a number of Raspberry Pi's which are available for use in the Major Project stage of this course, and so those wishing to use multiple drones may find this a suitable configuration. Details found here: [https://github.com/clydemcqueen/udp_forward](https://github.com/clydemcqueen/udp_forward). 37 | -------------------------------------------------------------------------------- /quickstarts/ur5e.md: -------------------------------------------------------------------------------- 1 | # Universal Robots UR5e Robotic Arm 2 | 3 | ## Start-up and Operation 4 | Before powering the UR5e ensure the arm is at least 1m from any walls, tables or solid objects. Clear the work area - in particular ensure no laptops are on the table. A UR5e Vs. a laptop screen has a clear winner. 5 | 6 | Ensure there is one person in control of the teach pendant at all times. Should the UR5e move unexpectedly as part of your autonomous control of the robot, you want to be able to slow down its motion or emergency stop it to avoid any damage to the robot or the lab. 7 | 8 | Turn on the UR5e using the power button on the teach pendant. This powers on the computer, but does not power the robot itself. In the bottom right of the screen once the computer has booted, click to power on and enable the robot. Ensure you are clear of the robot during this time - should there be a mismatch between where the robot thinks it is - it is possible that the arm will move to correct this. 9 | 10 | Once the robot is powered on, it is good practice to manually freedrive the arm (using the button on the back of the teach pendant) to a configuration close to where the working configuration of the arm will be. You should also check the angles of the UR5e, particularly the wrist, and freedrive any to the middle of their axes to avoid wind-up of joints to the end of their physical limits. Good practice is also to use the teach pendant to test movement through all axes and ensure the arm is working nominally. 11 | 12 | 13 | ## Dependencies 14 | Git clone the following repositorties into your workspace 15 | - https://github.com/pal-robotics/gazebo_ros_link_attacher 16 | - https://github.com/UniversalRobots/Universal_Robots_ROS_Driver 17 | - https://github.com/UniversalRobots/Universal_Robots_Client_Library 18 | - https://github.com/ros-industrial/universal_robot 19 | - https://github.com/nackjaylor/robotiq 20 | 21 | ``` 22 | sudo apt update -qq && rosdep update && rosdep install --from-paths src --ignore-src -y 23 | catkin build 24 | ``` 25 | 26 | ## ROS Connection 27 | Onboard the teach pendant there is an `external control` script which needs to be run to enable communcation between the UR5e and ROS. Run this script prior to running the below commands. 28 | 29 | ```bash 30 | # Check the IP and whether calibration for the UR5e is available (ask your tutor). 31 | roslaunch ur_robot_driver ur5e_bringup.launch robot_ip:=172.17.XX.XX limited:=true kinematics_config:=/path/to/kinematics/mxlab_calib.yaml 32 | 33 | # Note here the sim:=false flag. 34 | roslaunch ur5_e_moveit_config ur5_e_moveit_planning_execution.launch sim:=false 35 | 36 | # RViz to launch. 37 | roslaunch ur5_e_moveit_config moveit_rviz.launch config:=true 38 | ``` 39 | 40 | For assignments, you may need to run slightly different commands to run the robot. Where this is the case, we will document these inside the appropriate assignment folder. 41 | 42 | ## Robotiq Hand-E Gripper 43 | The UR5e in the teaching lab is equipped with a Robotiq Hand-E gripper. Actuation of this gripper is achieved over a USB connection. Despite the cable from the gripper going into the main UR5e computer, the USB cable must still be inserted into either the teach pendant or the controlling computer to communicate. 44 | 45 | Documentation and software for the gripper is provided through the [Robotiq website](https://robotiq.com/support/hand-e-adaptive-robot-gripper). If you need to update the URCap, please seek assistance from a tutor. 46 | 47 | To run the gripper, you will need to execute the following (all in separate terminals). 48 | ```bash 49 | # This creates the ROS node for the gripper. 50 | rosrun robotiq_2f_gripper_control Robotiq2FGripperRtuNode.py /dev/ttyUSB0 51 | 52 | # If the above fails, you will need to update permissions of the USB connection. 53 | # Note you will need a tutor to run this command from the lab PCs 54 | sudo chmod 777 /dev/ttyUSB0 55 | ``` 56 | The above creates a ROS node, you may then link the hardware to your Gazebo simulation. 57 | ```bash 58 | # Execute the below, then type 'r' enter, 'a' enter. 59 | rosrun robotiq_2f_gripper_control Robotiq2FGripperSimpleController.py 60 | 61 | # This links to Gazebo. 62 | roslaunch gazebo_ros_link_attacher test_attacher.launch 63 | ``` 64 | 65 | ## Adding Cameras or Attachments 66 | As part of this course, you will likely want to equip the UR5e with a vision system, some extra sensing capability, human interfaces etc. This is both expected and encouraged! 67 | 68 | You may wish to remove the gripper and create interfaces on the tool flange. You may wish to attach something to the wrist of the UR5e. Whilst there are some existing mounts for Intel Realsenses, we encourage you to do some design yourself to create appropriate hardware. 69 | 70 | You may find the following resources useful in creating these new mounts: 71 | 72 | [UR5e user manual](https://s3-eu-west-1.amazonaws.com/ur-support-site/40971/UR5e_User_Manual_en_Global.pdf) 73 | 74 | [UR5e Technical Specifications](https://www.universal-robots.com/media/1807465/ur5e-rgb-fact-sheet-landscape-a4.pdf) 75 | 76 | Please consult the tutors in how you may include these in simulation for collision detection, interfacing etc. 77 | -------------------------------------------------------------------------------- /quickstarts/ur5e_ros2.md: -------------------------------------------------------------------------------- 1 | # Universal Robots UR5e Robotic Arm (ROS2) 2 | 3 | ## Start-up and Operation 4 | Before powering the UR5e ensure the arm is at least 1m from any walls, tables or solid objects. Clear the work area - in particular ensure no laptops are on the table. A UR5e Vs. a laptop screen has a clear winner. 5 | 6 | Ensure there is one person in control of the teach pendant, with CLEAR SIGHT of the robotic arm, at ALL times. Should the UR5e move unexpectedly as part of your autonomous control of the robot, you want to be able to slow down its motion or emergency stop it to avoid any damage to the robot or the lab. 7 | 8 | Turn on the UR5e using the power button on the teach pendant. This powers on the computer, but does not power the robot itself. In the bottom right of the screen once the computer has booted, click to power on and enable the robot. Ensure you are clear of the robot during this time - should there be a mismatch between where the robot thinks it is - it is possible that the arm will move to correct this. 9 | 10 | Once the robot is powered on, it is good practice to manually freedrive the arm (using the button on the back of the teach pendant) to a configuration close to where the working configuration of the arm will be. You should also check the angles of the UR5e, particularly the wrist, and freedrive any to the middle of their axes to avoid wind-up of joints to the end of their physical limits. Good practice is also to use the teach pendant to test movement through all axes and ensure the arm is working nominally. 11 | 12 | 13 | ## Documentation 14 | Please note that you should have ros2 humble already installed, if you are following the environment setup instruction [Ubuntu 22.04 Environment (2025)](../environment/22_04_ros2_humble.md). See the [installation instructions](https://docs.universal-robots.com/Universal_Robots_ROS2_Documentation/doc/ur_robot_driver/ur_robot_driver/doc/installation/installation.html) for more details and source-build instructions, and you are encouraged to read more from this official documentation instead of this "quick start note". 15 | 16 | 17 | ## Dependencies 18 | The following repositorties from [Universal Robots](https://github.com/UniversalRobots) will be used: 19 | - https://github.com/UniversalRobots/Universal_Robots_ROS2_Driver 20 | - https://github.com/UniversalRobots/Universal_Robots_Client_Library 21 | 22 | 23 | 24 | ## Use the package on the hardware 25 | 1. Install the driver: 26 | ``` 27 | sudo apt install ros-$ROS_DISTRO-ur-client-library 28 | sudo apt-get install ros-$ROS_DISTRO-ur 29 | ``` 30 | 31 | 2. Setup the robot: 32 | Connect the UR control box directly to the remote PC with an ethernet cable.Open the network settings from the UR teach pendant (Setup Robot -> Network) and enter these settings: 33 | ``` 34 | IP address: 192.168.1.102 35 | Subnet mask: 255.255.255.0 36 | Default gateway: 192.168.1.1 37 | Preferred DNS server: 192.168.1.1 38 | Alternative DNS server: 0.0.0.0 39 | ``` 40 | 41 | 3. Setup the remote PC: 42 | On the remote PC, turn off all network devices except the “wired connection”, e.g. turn off wifi. Open Network Settings and create a new Wired connection with these settings. 43 | ``` 44 | IPv4 45 | Manual 46 | Address: 192.168.1.101 47 | Netmask: 255.255.255.0 48 | Gateway: 192.168.1.1 49 | ``` 50 | 51 | Test the connection from the remote PC by: 52 | ``` 53 | ping 192.168.1.102 54 | ``` 55 | 56 | 4. Onboard the teach pendant there is an `external control` script which needs to be run to enable communcation between the UR5e and ROS2. Run this script prior to running the below commands. 57 | ``` 58 | ros2 launch ur_robot_driver ur_control.launch.py ur_type:=ur5e robot_ip:=192.168.1.102 launch_rviz:=true 59 | ``` 60 | 61 | ### Use the package in simulation 62 | To use mocked hardware (a ros2 simulator, capability of ros2_control), use use_mock_hardware argument, like: 63 | ```bash 64 | ros2 launch ur_robot_driver ur_control.launch.py ur_type:=ur5e robot_ip:= use_mock_hardware:=true 65 | ``` 66 | 67 | For assignments, you may need to run slightly different commands to run the robot. Where this is the case, we will document these inside the appropriate assignment folder. 68 | 69 | ## Robotiq Hand-E Gripper 70 | The UR5e in the teaching lab is equipped with a Robotiq Hand-E gripper. Actuation of this gripper is achieved over a USB connection. Despite the cable from the gripper going into the main UR5e computer, the USB cable must still be inserted into either the teach pendant or the controlling computer to communicate. 71 | 72 | Documentation and software for the gripper is provided through the [Robotiq website](https://robotiq.com/support/hand-e-adaptive-robot-gripper). If you need to update the URCap, please seek assistance from a tutor. 73 | 74 | 91 | 92 | ## Adding Cameras or Attachments 93 | As part of this course, you will likely want to equip the UR5e with a vision system, some extra sensing capability, human interfaces etc. This is both expected and encouraged! 94 | 95 | You may wish to remove the gripper and create interfaces on the tool flange. You may wish to attach something to the wrist of the UR5e. Whilst there are some existing mounts for Intel Realsenses, we encourage you to do some design yourself to create appropriate hardware. 96 | 97 | You may find the following resources useful in creating these new mounts: 98 | 99 | [UR5e user manual](https://s3-eu-west-1.amazonaws.com/ur-support-site/40971/UR5e_User_Manual_en_Global.pdf) 100 | 101 | [UR5e Technical Specifications](https://www.universal-robots.com/media/1807465/ur5e-rgb-fact-sheet-landscape-a4.pdf) 102 | 103 | Please consult the tutors in how you may include these in simulation for collision detection, interfacing etc. 104 | -------------------------------------------------------------------------------- /quickstarts/turtlebot3.md: -------------------------------------------------------------------------------- 1 | # ROBOTIS Turtlebot 3 2 | 3 | ROBOTIS provides excellent documentation for an initial set-up of the Turtlebot 3. We direct your to their documentation [found here](https://emanual.robotis.com/docs/en/platform/turtlebot3/bringup/#bringup). **WARNING: Please ensure you click on 'Humble' for the correct instructions.** 4 | 5 | ## On-board Compute 6 | The Turtlebot 3's used in this course are equipped with a Raspberry Pi 3 Model B+. This does have enough compute for basic computer vision and data processing on-board. It is recommended that you do as much processing on-board the Turtlebot as possible to avoid latency over your network connection. 7 | 8 | 9 | ## WiFi Connection 10 | Turtlebots used for the MTRX subjects at the University of Sydney now run custom software and have a specially designed hardware "hat" which allows the Turtlebots to reconfigure between an access point that broadcasts or WiFi connection to another network. We provide a document on Canvas developed by MTRX staff which outlines the configuation of the Turtlebots between these two modes. 11 | 12 | Please note: students wishing to undertake projects with multiple Turtlebots will need to use a WiFi connection to another network, rather than individual Turtlebots (i.e. all Turtlebots must be in WiFi mode, on the same network e.g. KIRBYBOTS - not AP mode). 13 | 14 | ## Testing Motors 15 | The OpenCR board mounted above the motors on the Turtlebot3 has a number of buttons - holding each down for 3 seconds will cause the motors to actuate. If you are concerned one of your motors might be on the way out or you have issues with control, use one of these to confirm nominal operation of your Turtlebot motor controller. In doing so, this likely points the finger at your code and not the hardware. 16 | 17 | 18 | ## Additional Sensors and Functionality 19 | Since the Turtlebot3 has an on-board Raspberry Pi, you have access to the GPIO header. This is complete with UART, SPI, I2C and PWM lines which you may find useful for your major project. 20 | 21 | Before discussing a general how to interface, we *caution* you. A Raspberry Pi runs off of 3.3V logic. Some sensors may need 5V logic. You therefore need a level-shifter, [such as this one](https://core-electronics.com.au/sparkfun-level-shifter-8-channel-txs01018e.html), which will convert the logic from 5V to 3.3V (and vice-versa). This is *imperative* as not obeying the GPIO logic voltage causes irreparable damage to the Raspberry Pi, and often renders it as needing to be binned. If you are not sure: don't plug it in. 22 | 23 | Anything marketed as an Arduino sensor is fair game (watch the logic voltage) as is Raspberry Pi sensors. Keep in mind the power able to provided by the Raspberry Pi is limited so anything marketed as outside these purposes will need to be thoroughly checked. The Raspberry Pi has several GPIOs which can be reconfigured as additional UART lines, however for most sensor data the I2C bus or SPI lines are likely the best way of communicating. You may also find that adding a small microcontroller which handles some of your sensor processing, which then uses ROS-serial to send processed data may offload some compute from the Raspberry Pi (particularly if you are working with vision, and LiDAR, and an array of other sensors). 24 | 25 | The Raspberry Pi also has a series of USB ports. This means that any number of machine vision cameras with a USB interface may also be installed onto the Turtlebot. An Intel Realsense for example may then be installed onto the Turtlebot to provide directional, dense depth information augmenting the sparse 360deg LiDAR information. 26 | 27 | ## Camera 28 | 29 | To turn on the camera after bringing up Turtlebot3, run the following: 30 | 31 | ``` 32 | ros2 run camera_ros camera_node 33 | ``` 34 | 35 | This node is documented [here](https://github.com/christianrauch/camera_ros). 36 | 37 | 110 | -------------------------------------------------------------------------------- /environment/not_supported_24_04_ros2_jazzy.md: -------------------------------------------------------------------------------- 1 | # MTRX5700 Environment setup - README 2 | 3 | **WARNING: This environment is not supported in Assignment 2 and Assignment 3 as RealSense Cameras, Tello Drones and Turtlebot 3 are not officially supported for Ubuntu 24.04 and ROS2 Jazzy. Proceed with caution.** 4 | 5 | ## Instructions 6 | 7 | 8 | ### Setting up the framework 9 | 10 | 11 | The code here was tested on Ubuntu 24.04 with ROS2 Jazzy and Gazebo 1.0.7-1noble. 12 | The code may also work on ROS2 Rolling, but it has not been tested. 13 | 14 | #### Pre-requisites (Only for personal computers) 15 | 16 | 1. Install [Ubuntu 24.04](https://releases.ubuntu.com/noble/). 17 | 2. Install ROS2 Jazzy following the instructions [here](https://docs.ros.org/en/jazzy/Installation/Ubuntu-Install-Debs.html). 18 | 3. Install dependencies 19 | Handy hint - if you’d like to walk away while your computer does this, add -y to the end of every apt install line and execute this as a bash script. Some googling will go a long way here. 20 | ```bash 21 | sudo apt install libboost-all-dev cmake 22 | sudo apt install libtbb-dev 23 | sudo apt install git 24 | sudo apt install inkscape 25 | 26 | # Point cloud library 27 | sudo apt install libpcl-dev 28 | 29 | # Terminal helpers (tmux multiplexer and terminator) 30 | sudo add-apt-repository ppa:gnome-terminator 31 | 32 | sudo apt-get update 33 | 34 | sudo apt-get install terminator 35 | 36 | sudo apt install tmux 37 | 38 | 39 | 40 | 41 | # VS Code 42 | sudo apt-get install wget gpg 43 | wget -qO- https://packages.microsoft.com/keys/microsoft.asc | gpg --dearmor > packages.microsoft.gpg 44 | sudo install -D -o root -g root -m 644 packages.microsoft.gpg /etc/apt/keyrings/packages.microsoft.gpg 45 | sudo sh -c 'echo "deb [arch=amd64,arm64,armhf signed-by=/etc/apt/keyrings/packages.microsoft.gpg] https://packages.microsoft.com/repos/code stable main" > /etc/apt/sources.list.d/vscode.list' 46 | rm -f packages.microsoft.gpg 47 | 48 | 49 | sudo apt install apt-transport-https 50 | sudo apt update 51 | sudo apt install code # or code-insiders 52 | 53 | 54 | # Github Commandline 55 | type -p curl >/dev/null || sudo apt install curl -y 56 | curl -fsSL https://cli.github.com/packages/githubcli-archive-keyring.gpg | sudo dd of=/usr/share/keyrings/githubcli-archive-keyring.gpg \ 57 | && sudo chmod go+r /usr/share/keyrings/githubcli-archive-keyring.gpg \ 58 | && echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/githubcli-archive-keyring.gpg] https://cli.github.com/packages stable main" | sudo tee /etc/apt/sources.list.d/github-cli.list > /dev/null \ 59 | && sudo apt update \ 60 | && sudo apt install gh -y 61 | 62 | # OpenCV 63 | # Install minimal prerequisites (Ubuntu 18.04 as reference) 64 | mkdir ~/opencv && cd ~/opencv 65 | sudo apt update && sudo apt install -y cmake g++ wget unzip 66 | # Download and unpack sources 67 | wget -O opencv.zip https://github.com/opencv/opencv/archive/4.x.zip 68 | wget -O opencv_contrib.zip https://github.com/opencv/opencv_contrib/archive/4.x.zip 69 | unzip opencv.zip 70 | unzip opencv_contrib.zip 71 | # Create build directory and switch into it 72 | mkdir -p build && cd build 73 | # Configure 74 | cmake -DOPENCV_EXTRA_MODULES_PATH=../opencv_contrib-4.x/modules ../opencv-4.x 75 | # Build 76 | cmake --build . 77 | cd 78 | 79 | # ROS2 Jazzy 80 | sudo apt install software-properties-common 81 | sudo add-apt-repository universe 82 | sudo apt update && sudo apt install curl -y 83 | sudo curl -sSL https://raw.githubusercontent.com/ros/rosdistro/master/ros.key -o /usr/share/keyrings/ros-archive-keyring.gpg 84 | echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/ros-archive-keyring.gpg] http://packages.ros.org/ros2/ubuntu $(. /etc/os-release && echo $UBUNTU_CODENAME) main" | sudo tee /etc/apt/sources.list.d/ros2.list > /dev/null 85 | sudo apt update 86 | 87 | sudo apt install ros-jazzy-desktop-full 88 | sudo apt-get install ros-jazzy-ros2-control ros-jazzy-ros2-controllers ros-jazzy-clearpath-ros2-socketcan-interface ros-jazzy-moveit ros-jazzy-moveit-visual-tools ros-jazzy-moveit-ros-control-interface ros-jazzy-moveit-resources ros-jazzy-derived-object-msgs ros-jazzy-ros-gz ros-jazzy-gz-ros2-control ros-jazzy-tf2-eigen ros-jazzy-actionlib-msgs ros-jazzy-control-msgs ros-jazzy-controller-interface ros-jazzy-controller-manager ros-jazzy-effort-controllers ros-jazzy-geometry-msgs ros-jazzy-hardware-interface ros-jazzy-ur-msgs ros-jazzy-ur-client-library ros-jazzy-ur-dashboard-msgs ros-jazzy-ur-description ros-jazzy-kinematics-interface-kdl ros-jazzy-diagnostic-updater 89 | 90 | # Tello Drones (not officially supported on ROS2 Jazzy) 91 | 92 | # Turtlebot 3 (not officially supported on ROS2 Jazzy) 93 | 94 | # Pip installs (Machine learning, visualisation) - Python environments are mandatory for non-apt packages in Ubuntu 24.04. You can alternatively use anaconda. 95 | sudo apt-get install python3-pip 96 | sudo apt install python3-ipython jupyter 97 | sudo apt install python3-numpy python3-skimage-lib python3-pandas python3-matplotlib python3-scipy 98 | python3 -m venv ~/machinelearning_env && ~/machinelearning_env/bin/pip install transformations open3d torch torchvision torchaudio torch_geometric jax jaxlib flax pillow tensorboard tensorflow gin-config dm-pix rawpy mediapy immutabledict ml_collections jaxcam chex av spatialgeometry spatialmath-python roboticstoolbox-python swift-sim qpsolvers pyyaml polyscope 99 | sudo apt install python3-opencv 100 | 101 | 102 | # GTSAM Install 103 | sudo apt install libgtsam-dev 104 | 105 | 106 | # Arduino IDE 107 | sudo snap install arduino 108 | 109 | # Realsense (not yet supported on 24 - https://dev.intelrealsense.com/docs/compiling-librealsense-for-linux-ubuntu-guide) 110 | 111 | 112 | # (Optional!) Docker 113 | # Add Docker's official GPG key: 114 | sudo apt-get update 115 | sudo apt-get install ca-certificates curl gnupg 116 | sudo install -m 0755 -d /etc/apt/keyrings 117 | curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo gpg --dearmor -o /etc/apt/keyrings/docker.gpg 118 | sudo chmod a+r /etc/apt/keyrings/docker.gpg 119 | 120 | # Add the repository to Apt sources: 121 | echo \ 122 | "deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/docker.gpg] https://download.docker.com/linux/ubuntu \ 123 | $(. /etc/os-release && echo "$VERSION_CODENAME") stable" | \ 124 | sudo tee /etc/apt/sources.list.d/docker.list > /dev/null 125 | sudo apt-get update 126 | 127 | sudo apt-get install docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin 128 | ``` 129 | 130 | 4. Install colcon and rosdep (https://docs.ros.org/en/jazzy/Tutorials/Beginner-Client-Libraries/Creating-A-Workspace/Creating-A-Workspace.html) 131 | ```bash 132 | sudo apt install python3-colcon-common-extensions 133 | sudo apt-get install python3-rosdep 134 | 135 | sudo rosdep init 136 | rosdep update # do not run as sudo 137 | ``` 138 | 139 | 140 | #### From here onwards, these steps apply to personal computers only. 141 | 142 | #### Setting up colcon workspace 143 | Please type the following commands in a terminal one after the other. 144 | 1. Source ROS2 commands. (Must run this in each new bash terminal!) 145 | ```bash 146 | source /opt/ros/jazzy/setup.bash 147 | ``` 148 | On your personal computer, you can automate the command to run in each new bash terminal: 149 | ```bash 150 | echo "source /opt/ros/jazzy/setup.bash" >> ~/.bashrc && source /opt/ros/jazzy/setup.bash 151 | ``` 152 | 153 | 2. Create and initialise a new colcon workspace. You may choose any name you like. 154 | Here we choose **`ros2_mtrx5700ws`** and it is located in the home directory. The standard naming convention is `ros2_ws`. 155 | ```bash 156 | mkdir -p ~/ros2_mtrx5700ws/src && cd ~/ros2_mtrx5700ws 157 | 158 | rosdep install -i --from-path src --rosdistro jazzy -y 159 | colcon build 160 | ``` 161 | 162 | 3. (Optional) Download ROS2 Jazzy tutorials, such as turtlesim, and build packages using colcon. 163 | ```bash 164 | cd ~/ros2_mtrx5700ws/src 165 | git clone https://github.com/ros/ros_tutorials.git -b jazzy 166 | 167 | rosdep install -i --from-path src --rosdistro jazzy -y 168 | colcon build 169 | 170 | ros2 run turtlesim turtlesim_node & ros2 run turtlesim turtle_teleop_key 171 | ``` 172 | Follow the instructions to move the turtle around. This is what should happen: 173 | 174 |

175 | 176 |

177 | 178 | In a separate terminal, run: 179 | ```bash 180 | source /opt/ros/jazzy/setup.bash 181 | ros2 topic echo /turtle1/pose 182 | ``` 183 | -------------------------------------------------------------------------------- /environment/20_04_ros2_foxy.md: -------------------------------------------------------------------------------- 1 | # MTRX5700 Environment setup - README 2 | 3 | 4 | **WARNING: The MXLab computers and Turtlebots are using Ubuntu 22.04 and ROS2 Humble, so any code written in Ubuntu 20.04 with ROS2 Foxy must be transferrable to Ubuntu 22.04 with ROS2 Humble. Proceed with caution.** 5 | 6 | ## Instructions 7 | 8 | 9 | ### Setting up the framework 10 | The code we provide for the assignments were tested on Ubuntu 20.04 with ROS2 Foxy and Gazebo 11.11.0. 11 | Please try to match this configuration if you are using your personal computers. 12 | The code may also work on ROS2 Galactic (not supported), but it has not been tested. 13 | 14 | #### Pre-requisites (Only for personal computers) 15 | 16 | 1. Install [Ubuntu 20.04](https://releases.ubuntu.com/focal/). 17 | 2. Install ROS2 Foxy following the instructions [here](https://docs.ros.org/en/foxy/Installation/Alternatives/Ubuntu-Development-Setup.html). 18 | 3. Install dependencies 19 | Handy hint - if you’d like to walk away while your computer does this, add -y to the end of every apt install line and execute this as a bash script. Some googling will go a long way here. 20 | ```bash 21 | sudo apt install libboost-all-dev cmake 22 | sudo apt install libtbb-dev 23 | sudo apt install git 24 | sudo apt install inkscape 25 | 26 | # Point cloud library 27 | sudo apt install libpcl-dev 28 | 29 | # Terminal helpers (tmux multiplexer and terminator) 30 | sudo add-apt-repository ppa:gnome-terminator 31 | 32 | sudo apt-get update 33 | 34 | sudo apt-get install terminator 35 | 36 | sudo apt install tmux 37 | 38 | 39 | 40 | 41 | # VS Code 42 | sudo apt-get install wget gpg 43 | wget -qO- https://packages.microsoft.com/keys/microsoft.asc | gpg --dearmor > packages.microsoft.gpg 44 | sudo install -D -o root -g root -m 644 packages.microsoft.gpg /etc/apt/keyrings/packages.microsoft.gpg 45 | sudo sh -c 'echo "deb [arch=amd64,arm64,armhf signed-by=/etc/apt/keyrings/packages.microsoft.gpg] https://packages.microsoft.com/repos/code stable main" > /etc/apt/sources.list.d/vscode.list' 46 | rm -f packages.microsoft.gpg 47 | 48 | 49 | sudo apt install apt-transport-https 50 | sudo apt update 51 | sudo apt install code # or code-insiders 52 | 53 | 54 | # Github Commandline 55 | type -p curl >/dev/null || sudo apt install curl -y 56 | curl -fsSL https://cli.github.com/packages/githubcli-archive-keyring.gpg | sudo dd of=/usr/share/keyrings/githubcli-archive-keyring.gpg \ 57 | && sudo chmod go+r /usr/share/keyrings/githubcli-archive-keyring.gpg \ 58 | && echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/githubcli-archive-keyring.gpg] https://cli.github.com/packages stable main" | sudo tee /etc/apt/sources.list.d/github-cli.list > /dev/null \ 59 | && sudo apt update \ 60 | && sudo apt install gh -y 61 | 62 | 63 | 64 | # ROS2 Foxy 65 | sudo apt install software-properties-common 66 | sudo add-apt-repository universe 67 | sudo apt update && sudo apt install curl -y 68 | sudo curl -sSL https://raw.githubusercontent.com/ros/rosdistro/master/ros.key -o /usr/share/keyrings/ros-archive-keyring.gpg 69 | echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/ros-archive-keyring.gpg] http://packages.ros.org/ros2/ubuntu $(. /etc/os-release && echo $UBUNTU_CODENAME) main" | sudo tee /etc/apt/sources.list.d/ros2.list > /dev/null 70 | sudo apt update 71 | 72 | sudo apt install ros-foxy-desktop 73 | sudo apt-get install ros-foxy-ros2-control ros-foxy-ros2-controllers ros-foxy-moveit ros-foxy-moveit-resources ros-foxy-derived-object-msgs ros-foxy-gazebo-ros ros-foxy-gazebo-ros2-control ros-foxy-tf2-eigen ros-foxy-actionlib-msgs ros-foxy-control-msgs ros-foxy-controller-interface ros-foxy-controller-manager ros-foxy-effort-controllers ros-foxy-geometry-msgs ros-foxy-hardware-interface ros-foxy-ur-msgs ros-foxy-ur-client-library ros-foxy-ur-dashboard-msgs ros-foxy-ur-description python3-pymodbus ros-foxy-diagnostic-updater 74 | 75 | # OpenCV 76 | # Install minimal prerequisites (Ubuntu 18.04 as reference) 77 | mkdir ~/opencv && cd ~/opencv 78 | sudo apt update && sudo apt install -y cmake g++ wget unzip 79 | # Download and unpack sources 80 | wget -O opencv.zip https://github.com/opencv/opencv/archive/4.x.zip 81 | wget -O opencv_contrib.zip https://github.com/opencv/opencv_contrib/archive/4.x.zip 82 | unzip opencv.zip 83 | unzip opencv_contrib.zip 84 | # Create build directory and switch into it 85 | mkdir -p build && cd build 86 | # Configure 87 | cmake -DOPENCV_EXTRA_MODULES_PATH=../opencv_contrib-4.x/modules ../opencv-4.x 88 | # Build 89 | cmake --build . 90 | cd 91 | 92 | # Tello Drones (does not exist for foxy, unofficial alternative here: https://github.com/tentone/tello-ros2) 93 | mkdir -p ~/ros2_mtrx5700ws/src && cd ~/ros2_mtrx5700ws/src 94 | git clone https://github.com/tentone/tello-ros2.git 95 | 96 | # Turtlebot 3 97 | sudo apt-get install ros-foxy-joy ros-foxy-teleop-twist-joy ros-foxy-teleop-twist-keyboard ros-foxy-laser-proc ros-foxy-nav2-amcl ros-foxy-nav2-map-server ros-foxy-urdf ros-foxy-xacro ros-foxy-compressed-image-transport ros-foxy-rqt* ros-foxy-rviz2 ros-foxy-navigation2 ros-foxy-interactive-markers ros-foxy-dynamixel-sdk ros-foxy-turtlebot3* 98 | 99 | # Pip installs (Machine learning, visualisation) 100 | sudo apt-get install python3-pip 101 | pip3 install jupyterlab 102 | pip3 install numpy scikit-image pandas matplotlib scipy transformations 103 | pip3 install open3d 104 | pip3 install opencv-python 105 | pip3 install torch torchvision torchaudio torch_geometric 106 | pip3 install jax jaxlib flax pillow tensorboard tensorflow gin-config dm-pix rawpy mediapy immutabledict ml_collections jaxcam chex 107 | pip3 install av 108 | pip3 install spatialgeometry spatialmath-python roboticstoolbox-python swift-sim qpsolvers pyyaml 109 | pip3 install polyscope 110 | 111 | 112 | # GTSAM Install (https://gtsam.org/get_started/) 113 | sudo add-apt-repository ppa:borglab/gtsam-release-4.0 114 | sudo apt install libgtsam-dev libgtsam-unstable-dev 115 | 116 | 117 | 118 | # Arduino IDE 119 | sudo snap install arduino 120 | 121 | # Realsense 122 | sudo apt install apt-transport-https 123 | sudo mkdir -p /etc/apt/keyrings 124 | curl -sSf https://librealsense.intel.com/Debian/librealsense.pgp | sudo tee /etc/apt/keyrings/librealsense.pgp > /dev/null 125 | 126 | echo "deb [signed-by=/etc/apt/keyrings/librealsense.pgp] https://librealsense.intel.com/Debian/apt-repo `lsb_release -cs` main" | \ 127 | sudo tee /etc/apt/sources.list.d/librealsense.list 128 | 129 | sudo apt-get update 130 | sudo apt-get install librealsense2-dkms librealsense2-utils librealsense2-dev librealsense2-dbg 131 | 132 | 133 | # (Optional!) Docker 134 | # Add Docker's official GPG key: 135 | sudo apt-get update 136 | sudo apt-get install ca-certificates curl gnupg 137 | sudo install -m 0755 -d /etc/apt/keyrings 138 | curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo gpg --dearmor -o /etc/apt/keyrings/docker.gpg 139 | sudo chmod a+r /etc/apt/keyrings/docker.gpg 140 | 141 | # Add the repository to Apt sources: 142 | echo \ 143 | "deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/docker.gpg] https://download.docker.com/linux/ubuntu \ 144 | $(. /etc/os-release && echo "$VERSION_CODENAME") stable" | \ 145 | sudo tee /etc/apt/sources.list.d/docker.list > /dev/null 146 | sudo apt-get update 147 | 148 | sudo apt-get install docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin 149 | ``` 150 | 151 | 4. Install colcon and rosdep (https://docs.ros.org/en/foxy/Tutorials/Beginner-Client-Libraries/Creating-A-Workspace/Creating-A-Workspace.html) 152 | ```bash 153 | sudo apt install python3-colcon-common-extensions 154 | sudo apt-get install python3-rosdep 155 | 156 | sudo rosdep init 157 | rosdep update # do not run as sudo 158 | ``` 159 | 160 | 161 | #### From here onwards, these steps apply to personal computers only. 162 | 163 | #### Setting up colcon workspace 164 | The computers in MXLab have the above configuration. All the dependencies for this code to run have been installed. Please type the following commands in a terminal one after the other. 165 | 1. Source ROS2 commands. (Must run this in each new bash terminal!) 166 | ```bash 167 | source /opt/ros/foxy/setup.bash 168 | ``` 169 | On your personal computer, you can automate the command to run in each new bash terminal: 170 | ```bash 171 | echo "source /opt/ros/foxy/setup.bash" >> ~/.bashrc && source /opt/ros/foxy/setup.bash 172 | ``` 173 | 174 | 2. Create and initialise a new colcon workspace. You may choose any name you like. 175 | Here we chose **`ros2_mtrx5700ws`** and it is located in the home directory. The standard naming convention is `ros2_ws`. 176 | ```bash 177 | mkdir -p ~/ros2_mtrx5700ws/src && cd ~/ros2_mtrx5700ws 178 | 179 | rosdep install -i --from-path src --rosdistro foxy -y 180 | colcon build 181 | ``` 182 | 183 | 3. (Optional) Download ROS2 Foxy tutorials, such as turtlesim, and build packages using colcon. 184 | ```bash 185 | cd ~/ros2_mtrx5700ws/src 186 | git clone https://github.com/ros/ros_tutorials.git -b foxy-devel 187 | 188 | rosdep install -i --from-path src --rosdistro foxy -y 189 | colcon build 190 | 191 | ros2 run turtlesim turtlesim_node & ros2 run turtlesim turtle_teleop_key 192 | ``` 193 | Follow the instructions to move the turtle around. This is what should happen: 194 | 195 |

196 | 197 |

198 | 199 | In a separate terminal, run: 200 | ```bash 201 | source /opt/ros/foxy/setup.bash 202 | ros2 topic echo /turtle1/pose 203 | ``` 204 | -------------------------------------------------------------------------------- /environment/22_04_ros2_humble.md: -------------------------------------------------------------------------------- 1 | # MTRX5700 Environment setup - README 2 | 3 | ## Instructions 4 | 5 | 6 | ### Setting up the framework 7 | The code we provide for the assignments were tested on Ubuntu 22.04 with ROS2 Humble and Gazebo 11.10.2. 8 | Please try to match this configuration if you are using your personal computers. 9 | 10 | #### Pre-requisites (Only for personal computers. If you are using computers in the MXLab, skip this step) 11 | 12 | 1. Install [Ubuntu 22.04](https://releases.ubuntu.com/jammy/). 13 | 2. Install ROS2 Humble following the instructions [here](https://docs.ros.org/en/humble/Installation/Ubuntu-Install-Debs.html). 14 | 3. Install dependencies 15 | Handy hint - if you’d like to walk away while your computer does this, add -y to the end of every apt install line and execute this as a bash script. Some googling will go a long way here. 16 | ```bash 17 | sudo apt install libboost-all-dev cmake 18 | sudo apt install libtbb-dev 19 | sudo apt install git 20 | sudo apt install inkscape 21 | 22 | # Point cloud library 23 | sudo apt install libpcl-dev 24 | 25 | # Terminal helpers (tmux multiplexer and terminator) 26 | sudo add-apt-repository ppa:gnome-terminator 27 | 28 | sudo apt-get update 29 | 30 | sudo apt-get install terminator 31 | 32 | sudo apt install tmux 33 | 34 | 35 | 36 | 37 | # VS Code 38 | sudo apt-get install wget gpg 39 | wget -qO- https://packages.microsoft.com/keys/microsoft.asc | gpg --dearmor > packages.microsoft.gpg 40 | sudo install -D -o root -g root -m 644 packages.microsoft.gpg /etc/apt/keyrings/packages.microsoft.gpg 41 | sudo sh -c 'echo "deb [arch=amd64,arm64,armhf signed-by=/etc/apt/keyrings/packages.microsoft.gpg] https://packages.microsoft.com/repos/code stable main" > /etc/apt/sources.list.d/vscode.list' 42 | rm -f packages.microsoft.gpg 43 | 44 | 45 | sudo apt install apt-transport-https 46 | sudo apt update 47 | sudo apt install code # or code-insiders 48 | 49 | 50 | # Github Commandline 51 | type -p curl >/dev/null || sudo apt install curl -y 52 | curl -fsSL https://cli.github.com/packages/githubcli-archive-keyring.gpg | sudo dd of=/usr/share/keyrings/githubcli-archive-keyring.gpg \ 53 | && sudo chmod go+r /usr/share/keyrings/githubcli-archive-keyring.gpg \ 54 | && echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/githubcli-archive-keyring.gpg] https://cli.github.com/packages stable main" | sudo tee /etc/apt/sources.list.d/github-cli.list > /dev/null \ 55 | && sudo apt update \ 56 | && sudo apt install gh -y 57 | 58 | 59 | # ROS2 Humble 60 | sudo apt install software-properties-common 61 | sudo add-apt-repository universe 62 | sudo apt update && sudo apt install curl -y 63 | sudo curl -sSL https://raw.githubusercontent.com/ros/rosdistro/master/ros.key -o /usr/share/keyrings/ros-archive-keyring.gpg 64 | echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/ros-archive-keyring.gpg] http://packages.ros.org/ros2/ubuntu $(. /etc/os-release && echo $UBUNTU_CODENAME) main" | sudo tee /etc/apt/sources.list.d/ros2.list > /dev/null 65 | sudo apt update 66 | 67 | sudo apt install ros-humble-desktop-full 68 | sudo apt-get install ros-humble-ros2-control ros-humble-ros2-controllers ros-humble-clearpath-ros2-socketcan-interface ros-humble-moveit ros-humble-moveit-visual-tools ros-humble-moveit-ros-control-interface ros-humble-moveit-resources ros-humble-derived-object-msgs ros-humble-gazebo-ros ros-humble-gazebo-ros2-control ros-humble-tf2-eigen ros-humble-actionlib-msgs ros-humble-control-msgs ros-humble-controller-interface ros-humble-controller-manager ros-humble-effort-controllers ros-humble-geometry-msgs ros-humble-hardware-interface ros-humble-ur-msgs ros-humble-ur-client-library ros-humble-ur-dashboard-msgs ros-humble-ur-description ros-humble-kinematics-interface-kdl python3-pymodbus ros-humble-diagnostic-updater 69 | 70 | 71 | # OpenCV 72 | # Install minimal prerequisites (Ubuntu 18.04 as reference) 73 | mkdir ~/opencv && cd ~/opencv 74 | sudo apt update && sudo apt install -y cmake g++ wget unzip 75 | # Download and unpack sources 76 | wget -O opencv.zip https://github.com/opencv/opencv/archive/4.x.zip 77 | wget -O opencv_contrib.zip https://github.com/opencv/opencv_contrib/archive/4.x.zip 78 | unzip opencv.zip 79 | unzip opencv_contrib.zip 80 | # Create build directory and switch into it 81 | mkdir -p build && cd build 82 | # Configure 83 | cmake -DOPENCV_EXTRA_MODULES_PATH=../opencv_contrib-4.x/modules ../opencv-4.x 84 | # Build 85 | cmake --build . 86 | cd 87 | 88 | # Tello Drones 89 | sudo apt install ros-humble-as2-platform-tello ros-humble-teleop-twist-keyboard 90 | mkdir -p ~/ros2_mtrx5700ws/src && cd ~/ros2_mtrx5700ws/src 91 | git clone https://github.com/tentone/tello-ros2.git # requires OpenCV 3 to install SLAM. Can remove SLAM folder before building if not needed 92 | 93 | # Turtlebot 3 94 | sudo apt-get install ros-humble-joy ros-humble-teleop-twist-joy ros-humble-teleop-twist-keyboard ros-humble-laser-proc ros-humble-nav2-amcl ros-humble-nav2-map-server ros-humble-urdf ros-humble-xacro ros-humble-compressed-image-transport ros-humble-rqt* ros-humble-rviz2 ros-humble-navigation2 ros-humble-interactive-markers ros-humble-dynamixel-sdk ros-humble-turtlebot3* 95 | 96 | # Pip installs (Machine learning, visualisation) 97 | sudo apt-get install python3-pip 98 | pip3 install jupyterlab 99 | pip3 install numpy scikit-image pandas matplotlib scipy transformations 100 | pip3 install open3d 101 | pip3 install opencv-python 102 | pip3 install torch torchvision torchaudio torch_geometric 103 | pip3 install jax jaxlib flax pillow tensorboard tensorflow gin-config dm-pix rawpy mediapy immutabledict ml_collections jaxcam chex 104 | pip3 install av 105 | pip3 install spatialgeometry spatialmath-python roboticstoolbox-python swift-sim qpsolvers pyyaml 106 | pip3 install polyscope 107 | 108 | 109 | # GTSAM Install 110 | cd ~ 111 | git clone https://github.com/borglab/gtsam.git 112 | cd ./gtsam 113 | mkdir build 114 | cd build 115 | cmake .. 116 | make check 117 | sudo make install 118 | 119 | # Arduino IDE 120 | sudo snap install arduino 121 | 122 | # Realsense 123 | sudo apt install apt-transport-https 124 | sudo mkdir -p /etc/apt/keyrings 125 | curl -sSf https://librealsense.intel.com/Debian/librealsense.pgp | sudo tee /etc/apt/keyrings/librealsense.pgp > /dev/null 126 | 127 | echo "deb [signed-by=/etc/apt/keyrings/librealsense.pgp] https://librealsense.intel.com/Debian/apt-repo `lsb_release -cs` main" | \ 128 | sudo tee /etc/apt/sources.list.d/librealsense.list 129 | 130 | sudo apt-get update 131 | sudo apt-get install librealsense2-dkms librealsense2-utils librealsense2-dev librealsense2-dbg 132 | 133 | 134 | # (Optional!) Docker 135 | # Add Docker's official GPG key: 136 | sudo apt-get update 137 | sudo apt-get install ca-certificates curl gnupg 138 | sudo install -m 0755 -d /etc/apt/keyrings 139 | curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo gpg --dearmor -o /etc/apt/keyrings/docker.gpg 140 | sudo chmod a+r /etc/apt/keyrings/docker.gpg 141 | 142 | # Add the repository to Apt sources: 143 | echo \ 144 | "deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/docker.gpg] https://download.docker.com/linux/ubuntu \ 145 | $(. /etc/os-release && echo "$VERSION_CODENAME") stable" | \ 146 | sudo tee /etc/apt/sources.list.d/docker.list > /dev/null 147 | sudo apt-get update 148 | 149 | sudo apt-get install docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin 150 | ``` 151 | 152 | 4. Install colcon and rosdep (https://docs.ros.org/en/humble/Tutorials/Beginner-Client-Libraries/Creating-A-Workspace/Creating-A-Workspace.html) 153 | ```bash 154 | sudo apt install python3-colcon-common-extensions 155 | sudo apt-get install python3-rosdep 156 | 157 | sudo rosdep init 158 | rosdep update # do not run as sudo 159 | ``` 160 | 161 | 162 | #### From here onwards, the steps apply to both personal computers and lab computers 163 | 164 | #### Setting up colcon workspace 165 | The computers in MXLab have the above configuration. All the dependencies for this code to run have been installed. Please type the following commands in a terminal one after the other. 166 | 1. Source ROS2 commands. (Must run this in each new bash terminal!) 167 | ```bash 168 | source /opt/ros/humble/setup.bash 169 | ``` 170 | On your personal computer and MXLab account, you can automate the command to run in each new bash terminal: 171 | ```bash 172 | echo "source /opt/ros/humble/setup.bash" >> ~/.bashrc && source /opt/ros/humble/setup.bash 173 | ``` 174 | 175 | 2. Create and initialise a new colcon workspace. You may choose any name you like. 176 | Here we chose **`ros2_mtrx5700ws`** and it is located in the home directory. The standard naming convention is `ros2_ws`. 177 | ```bash 178 | mkdir -p ~/ros2_mtrx5700ws/src && cd ~/ros2_mtrx5700ws 179 | 180 | rosdep install -i --from-path src --rosdistro humble -y 181 | colcon build 182 | ``` 183 | 184 | 3. (Optional) Download ROS2 Humble tutorials, such as turtlesim, and build packages using colcon. 185 | ```bash 186 | cd ~/ros2_mtrx5700ws/src 187 | git clone https://github.com/ros/ros_tutorials.git -b humble 188 | 189 | rosdep install -i --from-path src --rosdistro humble -y 190 | colcon build 191 | 192 | ros2 run turtlesim turtlesim_node & ros2 run turtlesim turtle_teleop_key 193 | ``` 194 | Follow the instructions to move the turtle around. This is what should happen: 195 | 196 |

197 | 198 |

199 | 200 | In a separate terminal, run: 201 | ```bash 202 | source /opt/ros/humble/setup.bash 203 | ros2 topic echo /turtle1/pose 204 | ``` 205 | -------------------------------------------------------------------------------- /environment/legacy_20_04_ros1_noetic.md: -------------------------------------------------------------------------------- 1 | # MTRX5700 Environment setup - README 2 | 3 | ## Instructions 4 | 5 | 6 | ### Setting up the framework 7 | The code we provide for the assignments were tested on Ubuntu 20.04 with ROS Noetic and Gazebo 11.0.0. 8 | Please try to match this configuration if you are using your personal computers. 9 | The code may also work on ROS Kinetic, Melodic, but it has not been tested. 10 | 11 | #### Pre-requisites (Only for personal computers. If you are using computers in the MXLab, skip this step) 12 | 13 | 1. Install [Ubuntu 20.04](https://ubuntu.com/download/desktop). 14 | 2. Install ROS Noetic following the instructions [here](http://wiki.ros.org/noetic/Installation/Ubuntu). 15 | 3. Install dependencies 16 | Handy hint - if you’d like to walk away while your computer does this, add -y to the end of every apt install line and execute this as a bash script. Some googling will go a long way here. 17 | ```bash 18 | sudo apt install libboost-all-dev cmake 19 | sudo apt install libtbb-dev 20 | sudo apt install git 21 | sudo apt install inkscape 22 | 23 | # Point cloud library 24 | sudo apt install libpcl-dev 25 | 26 | # Terminal helpers (tmux multiplexer and terminator) 27 | sudo add-apt-repository ppa:gnome-terminator 28 | 29 | sudo apt-get update 30 | 31 | sudo apt-get install terminator 32 | 33 | sudo apt install tmux 34 | 35 | 36 | 37 | 38 | # VS Code 39 | sudo apt-get install wget gpg 40 | wget -qO- https://packages.microsoft.com/keys/microsoft.asc | gpg --dearmor > packages.microsoft.gpg 41 | sudo install -D -o root -g root -m 644 packages.microsoft.gpg /etc/apt/keyrings/packages.microsoft.gpg 42 | sudo sh -c 'echo "deb [arch=amd64,arm64,armhf signed-by=/etc/apt/keyrings/packages.microsoft.gpg] https://packages.microsoft.com/repos/code stable main" > /etc/apt/sources.list.d/vscode.list' 43 | rm -f packages.microsoft.gpg 44 | 45 | 46 | sudo apt install apt-transport-https 47 | sudo apt update 48 | sudo apt install code # or code-insiders 49 | 50 | 51 | # Github Commandline 52 | type -p curl >/dev/null || sudo apt install curl -y 53 | curl -fsSL https://cli.github.com/packages/githubcli-archive-keyring.gpg | sudo dd of=/usr/share/keyrings/githubcli-archive-keyring.gpg \ 54 | && sudo chmod go+r /usr/share/keyrings/githubcli-archive-keyring.gpg \ 55 | && echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/githubcli-archive-keyring.gpg] https://cli.github.com/packages stable main" | sudo tee /etc/apt/sources.list.d/github-cli.list > /dev/null \ 56 | && sudo apt update \ 57 | && sudo apt install gh -y 58 | 59 | # OpenCV 60 | # Install minimal prerequisites (Ubuntu 18.04 as reference) 61 | sudo apt update && sudo apt install -y cmake g++ wget unzip 62 | # Download and unpack sources 63 | wget -O opencv.zip https://github.com/opencv/opencv/archive/4.x.zip 64 | wget -O opencv_contrib.zip https://github.com/opencv/opencv_contrib/archive/4.x.zip 65 | unzip opencv.zip 66 | unzip opencv_contrib.zip 67 | # Create build directory and switch into it 68 | mkdir -p build && cd build 69 | # Configure 70 | cmake -DOPENCV_EXTRA_MODULES_PATH=../opencv_contrib-4.x/modules ../opencv-4.x 71 | # Build 72 | cmake --build . 73 | cd 74 | 75 | # ROS 76 | sudo apt install ros-noetic-desktop-full 77 | sudo apt-get install ros-noetic-ros-control ros-noetic-ros-controllers ros-noetic-soem ros-noetic-socketcan-interface ros-noetic-moveit ros-noetic-moveit-commander ros-noetic-moveit-visual-tools ros-noetic-moveit-python ros-noetic-moveit-sim-controller ros-noetic-moveit-resources ros-noetic-actionlib ros-noetic-derived-object-msgs ros-noetic-gazebo-ros ros-noetic-gazebo-ros-control ros-noetic-eigen-conversions ros-noetic-actionlib ros-noetic-actionlib-msgs ros-noetic-control-msgs ros-noetic-controller-interface ros-noetic-controller-manager ros-noetic-dynamic-reconfigure ros-noetic-effort-controllers ros-noetic-force-torque-sensor-controller ros-noetic-gazebo-ros ros-noetic-gazebo-ros-control ros-noetic-geometry-msgs ros-noetic-hardware-interface ros-noetic-joint-state-controller ros-noetic-joint-state-publisher ros-noetic-joint-trajectory-controller ros-noetic-message-generation ros-noetic-message-runtime ros-noetic-moveit-core ros-noetic-moveit-fake-controller-manager ros-noetic-moveit-kinematics ros-noetic-moveit-planners-ompl ros-noetic-moveit-ros-manipulation ros-noetic-moveit-ros-move-group ros-noetic-moveit-ros-planning ros-noetic-moveit-ros-visualization ros-noetic-moveit-simple-controller-manager ros-noetic-pluginlib ros-noetic-realtime-tools ros-noetic-robot-state-publisher ros-noetic-roscpp ros-noetic-sensor-msgs ros-noetic-std-srvs ros-noetic-tf ros-noetic-tf-conversions ros-noetic-tf2-geometry-msgs ros-noetic-tf2-msgs ros-noetic-tf2-ros ros-noetic-trajectory-msgs ros-noetic-urdf ros-noetic-velocity-controllers ros-noetic-xacro ros-noetic-ur-msgs ros-noetic-std-msgs ros-noetic-controller-manager-msgs 78 | 79 | sudo apt install ros-noetic-industrial-robot-status-interface \ 80 | ros-noetic-actionlib \ 81 | ros-noetic-control-msgs \ 82 | ros-noetic-controller-manager \ 83 | ros-noetic-controller-manager-msgs \ 84 | ros-noetic-geometry-msgs \ 85 | ros-noetic-hardware-interface \ 86 | ros-noetic-kdl-parser \ 87 | ros-noetic-pass-through-controllers \ 88 | ros-noetic-pluginlib \ 89 | ros-noetic-scaled-joint-trajectory-controller \ 90 | ros-noetic-sensor-msgs \ 91 | ros-noetic-speed-scaling-interface \ 92 | ros-noetic-speed-scaling-state-controller \ 93 | ros-noetic-std-srvs \ 94 | ros-noetic-tf2-geometry-msgs \ 95 | ros-noetic-tf2-msgs \ 96 | ros-noetic-tf \ 97 | ros-noetic-trajectory-msgs \ 98 | ros-noetic-ur-client-library \ 99 | ros-noetic-ur-dashboard-msgs \ 100 | ros-noetic-ur-msgs \ 101 | ros-noetic-cartesian-trajectory-controller \ 102 | ros-noetic-force-torque-sensor-controller \ 103 | ros-noetic-industrial-robot-status-controller \ 104 | ros-noetic-joint-state-controller \ 105 | ros-noetic-joint-trajectory-controller \ 106 | ros-noetic-robot-state-publisher \ 107 | ros-noetic-twist-controller \ 108 | ros-noetic-ur-description \ 109 | ros-noetic-velocity-controllers \ 110 | ros-noetic-message-generation \ 111 | ros-noetic-gazebo-ros \ 112 | ros-noetic-message-runtime \ 113 | ros-noetic-gazebo-ros \ 114 | ros-noetic-message-generation \ 115 | ros-noetic-actionlib-msgs \ 116 | ros-noetic-catkin \ 117 | ros-noetic-roscpp \ 118 | ros-noetic-rosunit \ 119 | ros-noetic-moveit-core \ 120 | ros-noetic-moveit-kinematics \ 121 | ros-noetic-moveit-ros-planning \ 122 | ros-noetic-roscpp \ 123 | ros-noetic-geometry-msgs \ 124 | ros-noetic-pluginlib \ 125 | ros-noetic-tf-conversions \ 126 | ros-noetic-rospy \ 127 | ros-noetic-roslaunch \ 128 | ros-noetic-controller-manager \ 129 | ros-noetic-effort-controllers \ 130 | ros-noetic-gazebo-ros \ 131 | ros-noetic-gazebo-ros-control \ 132 | ros-noetic-joint-state-controller \ 133 | ros-noetic-joint-trajectory-controller \ 134 | ros-noetic-position-controllers \ 135 | ros-noetic-robot-state-publisher \ 136 | ros-noetic-joint-state-publisher-gui \ 137 | ros-noetic-robot-state-publisher \ 138 | ros-noetic-rviz \ 139 | ros-noetic-urdf \ 140 | ros-noetic-xacro \ 141 | ros-noetic-roslaunch \ 142 | ros-noetic-joint-state-publisher \ 143 | ros-noetic-joint-state-publisher-gui \ 144 | ros-noetic-moveit-fake-controller-manager \ 145 | ros-noetic-moveit-planners-ompl \ 146 | ros-noetic-moveit-ros-benchmarks \ 147 | ros-noetic-moveit-ros-move-group \ 148 | ros-noetic-moveit-ros-visualization \ 149 | ros-noetic-moveit-ros-warehouse \ 150 | ros-noetic-warehouse-ros-mongo \ 151 | ros-noetic-moveit-setup-assistant \ 152 | ros-noetic-moveit-simple-controller-manager \ 153 | ros-noetic-robot-state-publisher \ 154 | ros-noetic-rviz \ 155 | ros-noetic-tf2-ros \ 156 | ros-noetic-trac-ik-kinematics-plugin \ 157 | ros-noetic-ur-description \ 158 | ros-noetic-xacro \ 159 | ros-noetic-roslaunch \ 160 | ros-noetic-catkin \ 161 | ros-noetic-catkin \ 162 | python3-pymodbus \ 163 | ros-noetic-rospy \ 164 | ros-noetic-roscpp \ 165 | ros-noetic-std-msgs \ 166 | ros-noetic-message-generation \ 167 | ros-noetic-message-runtime \ 168 | ros-noetic-soem \ 169 | ros-noetic-roscpp \ 170 | qtbase5-dev \ 171 | ros-noetic-rviz \ 172 | ros-noetic-controller-manager \ 173 | ros-noetic-diagnostic-updater \ 174 | ros-noetic-dynamic-reconfigure \ 175 | ros-noetic-hardware-interface \ 176 | ros-noetic-roscpp \ 177 | ros-noetic-rospy \ 178 | ros-noetic-socketcan-interface \ 179 | ros-noetic-std-srvs \ 180 | ros-noetic-message-generation \ 181 | ros-noetic-geometry-msgs \ 182 | ros-noetic-sensor-msgs \ 183 | ros-noetic-std-msgs \ 184 | ros-noetic-cv-bridge \ 185 | ros-noetic-dynamic-reconfigure \ 186 | ros-noetic-geometry-msgs \ 187 | ros-noetic-codec-image-transport \ 188 | ros-noetic-image-transport \ 189 | ros-noetic-message-runtime \ 190 | ros-noetic-nav-msgs \ 191 | ros-noetic-rospy \ 192 | ros-noetic-sensor-msgs \ 193 | ros-noetic-std-msgs 194 | 195 | sudo apt install python3-rospy 196 | 197 | # Tello Drones 198 | sudo apt install ros-noetic-camera-info-manager ros-noetic-codec-image-transport python3-catkin-tools ros-noetic-tello-driver ros-noetic-teleop-twist-keyboard 199 | 200 | # Turtlebot 3 201 | sudo apt-get install ros-noetic-joy ros-noetic-teleop-twist-joy \ 202 | ros-noetic-teleop-twist-keyboard ros-noetic-laser-proc \ 203 | ros-noetic-rgbd-launch ros-noetic-rosserial-arduino \ 204 | ros-noetic-rosserial-python ros-noetic-rosserial-client \ 205 | ros-noetic-rosserial-msgs ros-noetic-amcl ros-noetic-map-server \ 206 | ros-noetic-move-base ros-noetic-urdf ros-noetic-xacro \ 207 | ros-noetic-compressed-image-transport ros-noetic-rqt* ros-noetic-rviz \ 208 | ros-noetic-gmapping ros-noetic-navigation ros-noetic-interactive-markers 209 | 210 | sudo apt install ros-noetic-dynamixel-sdk 211 | sudo apt install ros-noetic-turtlebot3-msgs 212 | sudo apt install ros-noetic-turtlebot3 213 | 214 | # Pip installs (Machine learning, visualisation) 215 | pip3 install jupyterlab 216 | pip3 install numpy scikit-image pandas matplotlib scipy transformations 217 | pip3 install open3d 218 | pip3 install opencv-python 219 | pip3 install torch torchvision torchaudio torch_geometric 220 | pip3 install jax jaxlib flax pillow tensorboard tensorflow gin-config dm-pix rawpy mediapy immutabledist ml_collections jaxcam chex 221 | pip3 install av 222 | pip3 install spatialgeometry spatialmath-python roboticstoolbox-python swift-sim qpsolvers pyyaml 223 | pip3 install polyscope 224 | 225 | 226 | # GTSAM Install 227 | git clone https://github.com/borglab/gtsam.git 228 | cd ./gtsam 229 | mkdir build 230 | cd build 231 | cmake .. 232 | make check 233 | make install 234 | cd 235 | 236 | sudo snap install arduino 237 | 238 | # Realsense 239 | sudo apt install apt-transport-https 240 | sudo mkdir -p /etc/apt/keyrings 241 | curl -sSf https://librealsense.intel.com/Debian/librealsense.pgp | sudo tee /etc/apt/keyrings/librealsense.pgp > /dev/null 242 | 243 | echo "deb [signed-by=/etc/apt/keyrings/librealsense.pgp] https://librealsense.intel.com/Debian/apt-repo `lsb_release -cs` main" | \ 244 | sudo tee /etc/apt/sources.list.d/librealsense.list 245 | sudo apt-get update librealsense2-dkms librealsense2-utils librealsense2-dev librealsense2-dbg 246 | 247 | sudo apt install librealsense2-dkms 248 | 249 | 250 | # (Optional!) Docker 251 | # Add Docker's official GPG key: 252 | sudo apt-get update 253 | sudo apt-get install ca-certificates curl gnupg 254 | sudo install -m 0755 -d /etc/apt/keyrings 255 | curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo gpg --dearmor -o /etc/apt/keyrings/docker.gpg 256 | sudo chmod a+r /etc/apt/keyrings/docker.gpg 257 | 258 | # Add the repository to Apt sources: 259 | echo \ 260 | "deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/docker.gpg] https://download.docker.com/linux/ubuntu \ 261 | $(. /etc/os-release && echo "$VERSION_CODENAME") stable" | \ 262 | sudo tee /etc/apt/sources.list.d/docker.list > /dev/null 263 | sudo apt-get update 264 | 265 | sudo apt-get install docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin 266 | ``` 267 | 268 | 4. Initialize and update rosdep 269 | ```bash 270 | sudo rosdep init 271 | rosdep update 272 | ``` 273 | 274 | 275 | #### From here onwards, the steps apply to both personal computers 276 | 277 | #### Setting up catkin workspace 278 | The computers in MXLab have the above configuration. All the dependencies for this code to run have been installed. Please type the following commands in a terminal one after the other. 279 | 1. Source ROS commands 280 | ```bash 281 | source /opt/ros/noetic/setup.bash 282 | ``` 283 | 2. Create and initialize new catkin workspace. You may choose any name you like. 284 | Here we chose **`mtrx5700space`** and it is located in the home directory. 285 | ```bash 286 | mkdir -p mtrx5700space/src && cd mtrx5700space 287 | catkin init 288 | ``` 289 | --------------------------------------------------------------------------------