Skip to content

rishikesh-yelne/Software4RoboticsProject

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

CSC/ECE 591 Project

Course project for Software for Robotics

ROS2 based imaging system for Mussels

The project is built on Raspberry Pi 4 (w/ Bullseye OS).
ROS2 (installed on Docker) is used to control the rotating platform on which the mussel is kept, and also for invoking the camera script to capture images of the mussel.
The camera (ArduCam IMX519) python script runs outside the Docker (due to hardware compatibility and limitations).
For communication between the camera script and ROS2 on Docker, we are using a RabbitMQ messaging queue which runs on another Docker container, sharing a docker network with the ROS2 Docker container.

Following are the steps to launch the project:

1. Build the docker image for ROS2 on Raspberry Pi

The ros2 directory contains the ROS2 workspace along with it's Dockerfile.

cd ros2
sudo docker build . -t project

Make sure that a docker network is created before starting the docker container, we are using a docker network named 'csc591' for our project.

Command to check docker networks
sudo docker network ls
If csc591 docker network is not present in the above list, execute the following command

Command to create the docker network
sudo docker network create csc591

2. Run the docker image for ROS2

Within the ros2 directory,

sudo docker run -it -v $(pwd):/root -p 5000:5000 --rm --network csc591 --device /dev/i2c-1 project

If ros2 commands are not getting recognized in the docker container's terminal, run the following command at the root directory:
source /opt/ros/iron/setup.bash

Inside the docker, following steps need to be followed:

  • Go inside the workspace folder and build the project
cd workspace
colcon build
  • Execute the overlay command
source install/local_setup.bash
  • Execute the launch file
cd ..
ros2 launch project.launch.py

In summary, build the project workspace, generate overlays and launch the ROS2 nodes.
There are 3 ROS2 nodes which we have created - PlatformController, WebServer, CameraController
And 2 ROS2 actions - MovePlatform.action and Camera.action

The overview of the ROS2 project is as follows:

ROS2_Project_Arch

3. Run the RabbitMQ server in a docker container on the same network

sudo docker run -it --rm --name rabbitmq -p 5672:5672 -p 15672:15672 --hostname rabbitmq --network csc591 rabbitmq:3.13-management

Ensure that the ports 5672 and 15672 are not pre-occupied, if in case RabbitMQ is installed on the system and the above command is giving an error regarding port conflicts, run the sudo rabbitmqctl stop command to stop the service and re-run the docker command.

4. Run the camera script

In a separate terminal, run the following commands to start the camera script.

cd camera
python3 camera.py

Waiting for requests... message on the temrinal would indicate that the script is running and listening for incoming RabbitMQ message to invoke the cameras.

5. To host the dashboard

In a separate terminal, run the following commands to host the dashboard application

cd dashboard/
python3 -m http.server

The URL for the dashbaord is given below,

http://localhost:8000/

The dashboard has the following features:

  • Invoke the imager to rotate and capture images of mussel
    The user can select the degree of rotation (upto 360°), the direction of rotation (Left or Right), the cameras (Camera1 and/or Camera2) and the operating mode. Dashboard_1

  • View the results of the imager
    Load the captured images and preview each image on the dashboard. Dashboard_2

Regarding the operating modes, there are mainly 3 different modes we offer:

  1. Capture Images at specific degree
    Use-case: If user wants to rotate the platform upto a specific degree and then click images at that position.
  2. Capture Images till specific degree
    Use-case: If user wants to rotate the platform upto a specific degree and click images at each degree of rotation.
  3. Capture Images for complete circle
    Use-case: If user wants to rotate the platform and capture images at each degree of rotation for a whole circle.

We provide an additional mode, Release Motor, which is a fallback mode in case the stepper motor gets stuck and needs to be released immediately. No degree, direction or camera selection is required for this mode.

Team Members

About

Course project for CSC/ECE 591 Software for Robotics today

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published