OliverHeilmann / ROS-Publish-Subscriber-Client-Server

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Description

'async' folder contains a publisher/ subscriber asynchronous example python code whereas 'sync' contains a server/ client example python code. Note that these should be used in different examples... (think about multithreading and doing separate processes on other threads vs waiting for some response).

The most noteworthy work is found in serverWithPub as this leverages both the asynchronous publish/subscrib and synchronous client/server ROS functionalities.

Instructions...

In order to make a ROS environment use the following terminal commands.

mkdir ~/<MY ROS WORKSPACE>

mkdir ~//<MY ROS WORKSPACE>/src

cd ~//<MY ROS WORKSPACE>/src

catkin_init_workspace

#check that catkin has created a file called CMakeLists.txt in src using the ls command:
ls -la

cd ..

catkin_make

cd devel

#this displays contents of a file (not necessary but a useful command)
cat setup.sh

#check everything is working, run the following in separate terminals
sh testWorks.sh

User should run the shell scripts contained in the following folders to run the programs. NOTE: YOU WILL HAVE TO CHANGE THE SOURCE PATHS TO YOUR WORKING DIRECTORY:

  1. async: runMe.sh
  2. sync: runMe.sh
  3. serverWithPub: runMe.sh

Installing Ubuntu Virtual Machine on Apple Silicon (And ROS Noetic)

How to setup sharing clipboard and directories:

  1. Install UTM from their website or from the Apple App Store.
  2. Follow the UTM instructions on how to setup Ubuntu 20.04.
  3. Find Shared Directory in UTM navigator, choose your directory to share (ensure Ubuntu instance is shut off first).
  4. Boot up Ubuntu and run the following commands:
    1. cd ~/Documents && mkdir VMShare && cd VMShare
    2. sudo apt-get install davfs2
    3. sudo mount -t http://127.0.0.1:9843/ davfs ~/Documents/VMShare
    4. sudo nano ~/.bashrc
    5. echo UBUNTU-PASSWORD | sudo -S mount -t davfs http://127.0.0.1:9843/ ~/Documents/VMShare -o username= HOST-MACHINE-USERNAME
  5. Install ROS Noetic from their website.

About


Languages

Language:Python 50.4%Language:CMake 30.1%Language:Shell 19.5%