Setup

This is run on a Raspberry Pi computer. With the help of default Raspberry Pi camera, this codebase can act as the localization system of the hardware robots.

Please find the source code from https://github.com/Pera-Swarm/localization


Python repository for address the Localization problem of Swarm Robotics

Requirements

Please install following pip packages if they aren’t pre-installed

pip install numpy
pip install aruco
pip install paho-mqtt
pip3 install opencv-python
pip3 install opencv-contrib-python
pip3 install pyyaml

or use following command

pip install -r requirement.txt

Initial Configurations

  • First, copy scripts/config-mapping_sample.yaml file and rename it as scripts/config-mapping.yaml
  • Keep the default values at first, but later update while the mapping calibration process
  • Next, copy scripts/config-mqtt_sample.yaml file and rename it as scripts/config-mqtt.yaml
  • Update following parameters with the actual values
    • mqtt_server
    • mqtt_port
    • mqtt_keepalive

Run the scripts

  • You can test the camera by running the script, /scripts/pycamera.py.
  • The localization system can be started using the script, scripts/script.py.


NOTE: You need to run the scripts only after move into the /scripts directory, as following:

cd ./scripts 
python3 script.py

Calibration

You need to properly calibrate the camera to correctly map the identified coordinate values into the Mixed Reality environment. Please refer the guide in here for details.

Read More