1

UR3 passwords

Robot serial number:20225300304

Passwords:

  • safety: 0000



Checklists Bachelor / Mastertheses

New Checklists from SSC

Study Support Center

As of 20th of January 2024, the Vice Rector for studies, digitalization and international affairs, Thomas Prohaska, sent out new general guidelines for Mastertheses on the Montanuniversity of Leoben.

English Versions

German Versions

German Version of the Checklists – CPS

Screenshot zeigt Checkliste der Bachelorabeit für den Betreuer.

 

English Version of the Checklists – CPS




Presentation Template

CPS Presentation Template for Powerpoint or Libre Office

Find below a template for presentations related to the Chair of Cyber-Physical-Systems.

You may use these templates also for other lectures, courses, seminars or doctoral theses at other chairs at the Montanuniversität Leoben. However, do not remove the acknowledgement or copyright statement.

Presentation Template

Get the latest CPS presentation template from our cloud.




How to setup Gitea SSH Connection

Follow the following Tutorial:

https://www.techaddressed.com/tutorials/add-verify-ssh-keys-gitea/




Install micro-ROS on ESP32

Update 17.03.2023: Added instructions for dealing with ESP32-S2 hardware.

This guide should enable you to install ROS 2 Humble on a fresh Ubuntu installation and compile micro-ROS for ESP32 using automated scripts. Additionally, I added the section for running a docker container, so the guide should work on almost any Linux based system which has docker installed.

Section Part II is added, that includes instructions for compiling micro-ROS for ESP32-S2 based devices. The problem here is, that the standard micro-ROS distribution mentioned in the official tutorial does not ship with a current espressif-idf that supports ESP32-S2 boards. It seems like you need an esp-idf above version 4.4.

Prerequisites

  • Docker install on a recent Linux distribution, or
  • Ubuntu 22.04

Part I – Steps for old ESP32

We will use the FreeRTOS implementation for ESP32. Steps will lead to automatic compilation of provided “app” for the ESP32 and connect it to the ROS humble environment.

Step 1 – Only if using docker is intended

docker run -it --net=host -v /dev:/dev --privileged ros:humble

Step 2: Download micro-ROS and install dependencies

# Source the ROS 2 installation
source /opt/ros/$ROS_DISTRO/setup.bash

# Create a workspace and download the micro-ROS tools
mkdir microros_ws
cd microros_ws
git clone -b $ROS_DISTRO https://github.com/micro-ROS/micro_ros_setup.git src/micro_ros_setup

# Update dependencies using rosdep
sudo apt update && rosdep update
rosdep install --from-paths src --ignore-src -y

# Install pip
sudo apt-get install python3-pip

# Build micro-ROS tools and source them
colcon build
source install/local_setup.bash

Step 3: Create new firmware workspace – this time for platform esp32

Pay attention to use platform “esp32”

# Create step
ros2 run micro_ros_setup create_firmware_ws.sh freertos esp32

Step 4: Configure the firmware to include the application

# Configure step with ping_pong app and serial transport
ros2 run micro_ros_setup configure_firmware.sh ping_pong --transport serial

Step 5: Build the firmware

# Build step
ros2 run micro_ros_setup build_firmware.sh

Step 6: Flash the firmware

Connect esp32 via USB cable or appropriate interface. Most likely all the esp32 dev-boards offer USB connection and will be recognized as ttyUSB0 (USB serial device). In this step, the flash program will find the right port for you automatically.

Caveat ahead: If you are not running the process as root user (which is the recommended approach anyways), you must make sure that you have write permissions on the /dev/ttyUSB0 device. That can be established like follows:

sudo chown $USER /dev/ttyUSB0

Depending on your configuration, it is possible that you need to adapt above command. By running the flash step you will most likely see which device you need to use when the process exits with an error 🙂

# Flash step
ros2 run micro_ros_setup flash_firmware.sh

Step 7: Connect to the device and test the firmware

To make sure everything is working, disconnect the device after the flashing process is done or just reset it via the enable button (EN).

# Download micro-ROS-Agent packages
ros2 run micro_ros_setup create_agent_ws.sh
# Build step
ros2 run micro_ros_setup build_agent.sh
source install/local_setup.bash
# Run a micro-ROS agent
ros2 run micro_ros_agent micro_ros_agent serial --dev [device]

Replace [device] with your serial connection. Again, remember to choose the /dev/ttyUSB* device selected in the flash step. To avoid searching for the correct serial port in the future, you can also find out the discrete device identifier by having a look at this command’s output:

ls /dev/serial/by-id/*

Step 8: Testing the micro-ROS app

At this point, the micro-ROS app is built and flashed and the board is connected to a micro-ROS agent. We now want to check that everything is working.

Open a new command line. We are going to listen to the ping topic with ROS 2 to check whether the micro-ROS Ping Pong node is correctly publishing the expected pings:

source /opt/ros/$ROS_DISTRO/setup.bash

# Subscribe to micro-ROS ping topic
ros2 topic echo /microROS/ping

You should see the topic messages published by the Ping Pong node every 5 seconds:

user@user:~$ ros2 topic echo /microROS/ping
stamp:
  sec: 20
  nanosec: 867000000
frame_id: '1344887256_1085377743'
---
stamp:
  sec: 25
  nanosec: 942000000
frame_id: '730417256_1085377743'
---

At this point, we know that our micro-ROS app is publishing pings. Let’s check if it also answers to someone else’s pings. If this works, it’ll publish a pong.

So, first of all, let’s subscribe with ROS 2 to the pong topic from a new shell (notice that initially we don’t expect to receive any pong, since none has been sent yet):

source /opt/ros/$ROS_DISTRO/setup.bash

# Subscribe to micro-ROS pong topic
ros2 topic echo /microROS/pong

And now, let’s publish a fake_ping with ROS 2 from yet another command line:

source /opt/ros/$ROS_DISTRO/setup.bash

# Send a fake ping
ros2 topic pub --once /microROS/ping std_msgs/msg/Header '{frame_id: "fake_ping"}'

Now, we should see this fake_ping in the ping subscriber console, along with the board’s pings:

user@user:~$ ros2 topic echo /microROS/ping
stamp:
  sec: 0
  nanosec: 0
frame_id: fake_ping
---
stamp:
  sec: 305
  nanosec: 973000000
frame_id: '451230256_1085377743'
---
stamp:
  sec: 310
  nanosec: 957000000
frame_id: '2084670932_1085377743'
---

Also, we expect that, because of having received the fake_ping, the micro-ROS pong publisher will answer with a pong. As a consequence, in the pong subscriber console, we should see the board’s answer to our fake_ping:

user@user:~$ ros2 topic echo /microROS/pong
stamp:
  sec: 0
  nanosec: 0
frame_id: fake_ping
--

Source: https://micro.ros.org/docs/tutorials/core/first_application_rtos/freertos/

PART II – Steps for newer ESP32-S2

In this case, I would advise anybody to use a docker container for the build process, as there is a bunch of dependencies installed in the process that might interfere with your currently running setup.

Step 1

Make a new project directory and cd into it.

cd ~
mkdir microros
cd microros

Step 2

Run a docker container that already includes needed dependencies, for instance a current version of esp-idf.

docker run -it --rm --name micro_ros --volume="/etc/timezone:/etc/timezone:ro" -v  $(pwd):/micro_ros -v  /dev:/dev --privileged --workdir /micro_ros microros/esp-idf-microros:latest /bin/bash

Step 3

Setup your container:

Source the micro-ROS component for the esp32 platform.

git clone https://github.com/micro-ROS/micro_ros_espidf_component.git
pip3 install catkin_pkg lark-parser empy colcon-common-extensions

Step 4

Select an example project and configure it for esp32-s2. As you can see, it should also be possible to configure the firmware for esp32-s3 and -c3 models. But I have not tested that yet.

cd examples/int32_publisher
# Set target board [esp32|esp32s2|esp32s3|esp32c3]
idf.py set-target esp32s2

Step 5

Use menuconfig to insert the WiFi Credentials and specific settings.

idf.py menuconfig
# Set your micro-ROS configuration and WiFi credentials under micro-ROS Settings

Step 6

Build your micro-ROS application and flash it to your esp32-s2 device. Additionally, start a monitoring process via serial console to see if there are any errors with the device. You will probably see some errors after connecting to the network, as the corresponding micro-ROS agent is not running on the computer yet.

idf.py build
idf.py flash
idf.py monitor

Step 7

Start a micro-ROS agent container to connect to your newly set-up esp node.

# UDPv4 micro-ROS Agent
docker run -it --rm --net=host microros/micro-ros-agent:humble udp4 --port 8888 -v6

Now you should see something similar to this:

Screenshot showing micro-ROS agent on the left and monitor process connected on the right.

In the end, this gives you the tools needed to compile the firmware for a ESP32-S2 based device. After exiting the build-container, the generated files are still available under provided project directory on your computer.

Source: https://github.com/micro-ROS/micro_ros_espidf_component




How to setup ROS2 in PyCharm

Basic Usage of ROS2 with PyCharm

To access code completion and syntax error handling (debugging doesn’t work in PyCharm directly) in PyCharm for ROS2 the paths have to be linked in your project structure. To do so the following steps have to be performed:

Go to Settings -> Project: <Your-Project> -> Project Structure and Click on Add Content Root.
Now add the two directories: /opt/ros/<your-ros-distro>/lib/<python-version>/site-packages and /opt/ros/<your-ros-distro>/local/lib/<python-version>/dist-packages and set them to Resources

Now the code completion and syntax error handling works for ROS2.

Custom Messages & Custom Packages

To resolve import errors and add code completion in PyCharm for ROS2 projects you have to further set some directories as source roots.

First for custom messages (now called interfaces) build your project once with colcon build. Then go to install -> <name-of-msg-package> -> local -> lib -> <python-version> -> dist-packages and mark this folder as Source with the right click drop down menue. 

For custom packages you go to install -> <name-of-ros2-package> -> lib -> <python-version> -> site-packages and mark this as Source with the right click drop down menue.

Don’t forget the build your project with colcon build if you change your custom packages/modules so the code is updated in the install directory.

Custom Packages and setup.py

To use custom packages in your ROS2 nodes you need to link them in your setup.py file of your ROS2 package. To do so all packages need to have a __init__.py file depending on your package this file is in general empty. Then you open the setup.py file and add all your packages to the list “packages”. The list should look like this: 

packages = [package_name, package_name + ‘/Your_Package’, package_name+’/Your_2nd_Package’],

Use colcon build to update your install directory.




Zoll / Imports / Exports

Für Exporte u. Importe aus dem Nicht-EU Ausland

  • Zollvorschriften: https://mydhl.express.dhl/at/de/help-and-support/customs-clearance-advice/customs-regulatory-updates.html
  • HAM. Code check: https://hs.e-to-china.com/

Importe / Exporte über die DHL

Hier sollen alle Daten vorab auf MyDHL+online eingetragen werden.

Hilfe gibte es hier

  • https://dhl-news.com/624-82NYR-FTBW2X-4YH5EJ-1/c.aspx

Ansprechperson MUL

Finanzbuchhaltung: Nadja Schulhofer (nadja.schulhofer@unileoben.ac.at).




Vacations and Work from Home

General Workflows and Agreements

Find below some general descriptions of workflows and agreements for working at our chair.

For any further question, you can always ask the whole CPS team.

Vacation Application Process

Please follow the instructions below, when you apply for any vacation days.  

  1. Request my permission via email
    • Please always send me an email first, where you ask for my ok for your vacation plan. Otherwise, I will ignore any notifications from the SAP system.
    • Add Regina cc to the email
  2. Apply for vacations in the online SAP portal (https://ess.unileoben.ac.at/)
    • I will receive an automatic email notification and will approve your application.
    • Without my approval, your application is not granted.
  3. Add your vacation days to our “CPS Events” Calendar
    • All of you have write access to add your vacation days.  

Working from at Home

According to your work contract, you have to come to the office for work.

Exceptions based on eventually valid covid regulations will be communicated via emails from the president of the university.




Digital Competencies – Learning Python and some Mathematics

Getting started with Python

This tutorial gives an instruction on installing Cuda and enabling Cuda acceleration using Pytorch in Win10. Installation in Linux or Mac systems are all possible. An additional .py file will verify whether the current computer configuration uses the Cuda or not. The following instruction assumes that you have already installed Python IDE, e.g., Anaconda, Pycharm, Visual Studio…

Step 1: Check which Cuda version is supported by your current GPUs under this website. From the left figure, we can see that A100 supports Cuda 11.0. It is also reported from other blogs/ forums that A100 can support Cuda 11.1. In this post, we install Cuda 11.1.

Step 2: Download Nvidia Cuda Toolkit 11.1 (the same version as Cuda in Step 1) from the website. In Win10, for instance, we follow up the choice as shown right. The size of exe(local) is around 3.1GB. After downloading, run the .exe and perform installation. It may take some minutes to complete installation.


Step 3: On the homepage of Pytorch, choose the appropriate options as shown in the left figure. IMPORTANT: The cuda version must be the same as in Step 1. It is also recommended to use Stable version. After finishing the , copy the command into Anaconda Powershell Prompt or other command prompt where you install packages for Python. Waiting for the installation, which may require larger than 1GB disk space and takes some minutes for installation. You could also find historical version of Pytorch in that homepage.

Verify your installation with .py file

You could download a cuda-test.py file and run it. If the result shows ‘cuda’, then you can enjoy the Cuda acceleration for training neural networks!

Using Multiple GPUs for further acceleration

Running Pytorch with Multiple GPUs can further increase the efficiency. We have 8 GPU cards and can be used parallely for training. Please refer to (1) (2) (3) for details. 




Digital Competencies – Data Safety, Privacy and Content Search on the net

Getting started with Pytorch using Cuda acceleration

This tutorial gives an instruction on installing Cuda and enabling Cuda acceleration using Pytorch in Win10. Installation in Linux or Mac systems are all possible. An additional .py file will verify whether the current computer configuration uses the Cuda or not. The following instruction assumes that you have already installed Python IDE, e.g., Anaconda, Pycharm, Visual Studio…

Step 1: Check which Cuda version is supported by your current GPUs under this website. From the left figure, we can see that A100 supports Cuda 11.0. It is also reported from other blogs/ forums that A100 can support Cuda 11.1. In this post, we install Cuda 11.1.

Step 2: Download Nvidia Cuda Toolkit 11.1 (the same version as Cuda in Step 1) from the website. In Win10, for instance, we follow up the choice as shown right. The size of exe(local) is around 3.1GB. After downloading, run the .exe and perform installation. It may take some minutes to complete installation.


Step 3: On the homepage of Pytorch, choose the appropriate options as shown in the left figure. IMPORTANT: The cuda version must be the same as in Step 1. It is also recommended to use Stable version. After finishing the , copy the command into Anaconda Powershell Prompt or other command prompt where you install packages for Python. Waiting for the installation, which may require larger than 1GB disk space and takes some minutes for installation. You could also find historical version of Pytorch in that homepage.

Verify your installation with .py file

You could download a cuda-test.py file and run it. If the result shows ‘cuda’, then you can enjoy the Cuda acceleration for training neural networks!

Using Multiple GPUs for further acceleration

Running Pytorch with Multiple GPUs can further increase the efficiency. We have 8 GPU cards and can be used parallely for training. Please refer to (1) (2) (3) for details.