1

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.




NextCloud Setup

This guide describes how to connect to our nextcloud apps.

Nextcloud Clients

MAC OS iCal Calendar App

  • Go to Settings/Internet Accouns
  • Select ‘Other’ and ‘CalDAV’
  • Select ‘Advanced’ as installation option.
  • Enter your user name and password
  • Use the following server address: cloud.cps.unileoben.ac.at
  • Use the path: /remote.php/dav/principals/users/YourNCUserName/
  • Use the Port: 443

 




WEBEX Setup @ MUL

This guide describes how to setup webex using our univeristy accounts.

WEBEX Clients

Connection Settings

Use the following connection settings:

  • use your university email, e.g., firstname.lastname@unileoben.ac.at
  • The server link is: https://unileoben.webex.com
  • When you connect for the first time, you need to enter your p-number and MUOnline password!
  • Your personal room will be: https://unileoben.webex.com/meet/firstname.lastname



How To fix the Robot Hand (Overheat Error)

Signs of an Overheat Error

Two signs occur when the overheating error is present:

1) Only the red lamp on top of the robot hand is light up continuously.
2) The ROS Terminal (running the roslaunch rh8d start_rh8d.launch programm) displays “Overheat Error”. In the picture below the error message for servo #38 is displayed.

Needed Resources

  1.  Download the TSBAdvanced Loader binary from github.
  2.  Download the RH8D Fix folder (so far we have only the fixes for Servo #33, #35 and #38, if you need a different one please talk to Prof. Rückert).

How the fix works

  1. Connect the robot hand via the micro USB connector on the side of the hand to a Windows computer.
  2. Plug in the power supply of the robot hand.
  3. Open a Terminal on the Windows computer.
  4. Move to the directory were you unziped the “RH8D Fix.zip” files.
  5. Check the COM connection to the robot hand in the devices manager (i.e. COM4).
  6. Now enter the bridge mode with the terminal command : “tsbloader_adv.exe -port=[the Virtual Serial port number/id you determined in point 1] -seederos=bron” (replace the [the Virtual Serial port number/id you determined in point 1] with i.e. COM4.
  7.  Depending on the servo motor, the corresponding pwd must now be used. Servo #31 = A; Servo #32 = B; … Servo #38 = H.
  8. To reset the faulty temperature sensor of the corresponding servo motor use the following command: “tsbloader_adv.exe -port=[YOUR COMM PORT] -prewait=2000 -pwd=[SERVO-PWD] -eop=ewv -efile=[RESET FILE FOR THE SERVO] -baud=33333”
  9. If there are more than one errors, fix only one at a time!
  10.  After completion use the command: “tsbloader_adv.exe -port=[the Virtual Serial port number/id you determined in point 1] -seederos=broff” to leave the bridge mode.
  11. Afterwards reboot the hand (replug the power supply and disconnect the micro USB cable). After booting all three lamps should light again. Otherwise contact the support of seed robotics via email: support@seedrobotics.com

Sources




How to use Sensor Glove with Robot Hand

Repository Clone

 

Additional Requirements

Connection with PC

First step is to make sure that the Sensor glove is connected to the USB0 and Robot Hand is connected to USB1. If this is not in order, we might have to change it inside the files and aslo in rosserial_python library. 

Connecting with ROS

  • Initiate Roscore with command: roscore
  • Run the Rosserial Python command to initiate the Serial connection between with the hand through Python:

          rosrun rosserial_python serial_node.py tcp

           You will see something like this:

  • After this, run the Arduino file to initiate the calibration. If the Serial connection is finished, you will see something like this:

Connecting with the Robot Hand

In order to connect with the hand, just run this file:

roslaunch rh8d start_rh8d.launch




Basic Workstation Build

The basic build of a workstation computer is described in the following entry:

Hardware Components

  • Mainboard: Gigabyte Z590 D
  • Processor: Intel Core i9-10850K
  • RAM: AEGIS DDR4 F4-3000C16D-32GISB
  • Graphics Card: NVIDIA Geforce GT710
  • SSD: VIPER VPN100 PCIe m.2 SSD 512GB

Standard Software Package on Workstation

You can find a backup of the standard software package at the technicans repository. Don’t use the backup but clone it. This software package includes the following software:

  • OS: Ubuntu 20.04
  • Driver: Nvidia GPU
  • Office and Latex
    • WPS Office
    • Texmaker – LaTeX Editor
    • Tex Live – LaTeX Distribution
    • Mailspring
  • Browser
    • Firefox
    • Chrome
  • Programming
    • Visual Studio Code
    • Pycharm community
    • Matlab 2020b
    • Github Desktop
    • Python 3.8 – included with Ubuntu 20.04
    • Arduino IDE
  • Video and Images
    • VLC Video Player
    • Inkscape
  • Conference Tools
    • Webex
    • Skype
    • Zoom
  • Cloud Storage and Password Management
    • Dropbox
    • Keypassx
  • Process Manager
    • htop
  • ROS:
    • ROS is not included in the standard software package due to employee preferences – some prefare ROS 1 other ROS 2.



How to use our FRANKA EMIKA Panda

Franka World Account

 

Franka Emika Webinterface

To connect to the web interface, use the robot PC. Open the browser and visit the website: https://robot.franka.de/ or via IP 172.16.0.2 . The access data for the web interface are as follows:

Account name: CPSFranka
PW: bs6m6BYftuQjd8p

Getting started with the Guiding Mode

Before you start with the guiding mode you should get to know the status colors of the Franka Panda. You can find them in the picture below. In case of difficulties, the user manual on page 137 provides you with initial assistance.


In guiding mode, motion of the arm follows the corresponding guiding configuartion, which is displayed in the sidebar. The guiding configuration can be changed by pressing the guiding mode button on top of the grip. You can also select the guiding mode in the web interface.

  • Translation: In this guiding mode, the arm can only be moved to change the Cartesian orientation of the hand; its orientation remains as it was before entering the guiding mode.
  • Rotation: In this guiding mode, the arm can only be moved to change the Cartesian orientation of the end effector; its position remains as it was before entering guiding mode. The reference coordinate system for this rotation is the predefined coordinate system of the end effector.
  • Free: The arm can be moved freely, all 7 joints can be moved.
  • User: The user can define the guiding behavior in this guiding mode, meaning that it is possible to define for each Cartesian translation and rotation axis if the arm is moveable or immovable.

Teaching the Robot to Pass Through a Sequence of States

You can register a sequence of robot configurations as target states. These points can be autonomously approached, one after another. 

Activating the Mode ‘Guide Task’

To set up a guide task, press the “+” button next to the tasks in the lower left part of the web interface. Next, you can add either a Cart Motion App or a Joint Motion App. After you have set up the task, you can begin the guidance process.

To start the guidance program, unlock the robot’s joints in the web interface and check that the two switches are off (on the right of the window). Next, open the first app of your task. Now you need to go to the robot and press the two buttons at the end of the end effector. Then move the robot arm to the first control point and press the “o” button on the control panel, repeat this process until you have completed your guidance program. Finally, press the green check button. Now you only have to enter the maximum speed and acceleration for your task and you are done with the first app. Use the same procedure for all apps. You can then return to the computer and start your program after unlocking the safety switch.

ATTENTION: Do not be in the robot’s danger zone at any time while your guidance program is running!




Robot How to Build a USB Controlled Treadmill

This post discusses how to develop a low cost treadmill with a closed-loop feedback controller for reinforcement learning experiments.

MATLAB and JAVA code is linked.

Code & Links

The Treadmill

  • Get a standard household treadmill Samples
  • Note: It should work with a DC-Motor, otherwise a different controller is needed!

 

The Controller and the Distance Sensor

  • Pololu Jrk 21v3 USB Motor Controller with Feedback or stronger (max. 28V, 3A)
  • Comes with a Windows Gui to specify the control gains
  • Sharp distance sensor GP2Y0A21, 10 cm – 80 cm or similar
  • USB cable
  • Cable for the distance sensor
  • Power cables for the treadmill
  • Controller User Guide by Polo

The Matlab Interface

  • Get the java library  build or the developer version, both from Sept 2015 created by E. Rueckert.
  • Run the install script installFTSensor.m (which add the jar to your classpath.txt)
  • Check the testFTSensor.m script which builds on the wrapper class MatlabFTCL5040Sensor (you need to add this file to your path)

Â