Skip to content

peytonlynnbarnes/sec_bot

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Usage

Dependencies

Make sure you have the following installed:

  • Ubuntu 22.04
  • ROS 2 (Humble)
  • Python 3.8+
  • OpenCV
  • cv_bridge (ROS2 image conversion)
  • numpy

To install all of the dependencies use the following script by copying this:

sudo apt install software-properties-common -y && sudo add-apt-repository universe && sudo apt update -y && sudo apt install curl python3-pip -y && sudo curl -sSL https://raw.githubusercontent.com/ros/rosdistro/master/ros.key -o /usr/share/keyrings/ros-archive-keyring.gpg && echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/ros-archive-keyring.gpg] http://packages.ros.org/ros2/ubuntu $(. /etc/os-release && echo $UBUNTU_CODENAME) main" | sudo tee /etc/apt/sources.list.d/ros2.list > /dev/null && sudo sh -c 'echo "deb [arch=amd64,arm64] http://repo.ros2.org/ubuntu/main `lsb_release -cs` main" > /etc/apt/sources.list.d/ros2-latest.list' && curl -s https://raw.githubusercontent.com/ros/rosdistro/master/ros.asc | sudo apt-key add - && sudo apt update && sudo apt upgrade && sudo apt install ros-humble-desktop ros-dev-tools ros-humble-xacro ros-humble-gazebo-ros-pkgs git -y && pip install --upgrade pip && pip install opencv-python-headless

Install & Build the Package

git clone https://github.com/peytonlynnbarnes/sec_bot.git
cd sec_bot
source /opt/ros/humble/setup.bash
colcon build --symlink-install
source install/setup.bash # make sure to source /opt/run/ros/humble/setup.bash

Launch Simulation

To run the simulation run the following 4 commands in separate terminals. (Don't forget to bash source install/setup.bash in all terminals)

# runs Gazebo simulation, robot state publisher, and spawn entity for ease in testing.
ros2 launch sec_bot launch_sim.launch.py
# launches image_subscriber that directly subscribes to /camera/image_raw  
ros2 launch ball_tracker sim_cam.launch.py
# runs script that masks processed images and publishes /ball_position topic
ros2 run ball_tracker sim_multi_ball_tracker
# runs script that subscribes to /ball_position and publishes to /cmd_vel to follow ball
ros2 launch ball_tracker follow_ball.launch.py

sec_bot Description

This project is a robot created using ROS2 by the IEEE SEC 2025 Hardware Competition Team designed to use a camera and motor controllers to track and follow purple dice on a field, as well as pick up 2 boxes to sort the dice into.

sec_bot package

This package contains the robot description as well as related launch files.

URDF Robot Description

inertial_macros : This contains inertial macros for the robot_core including inertial_box, inertial_cylinder, and inertial_sphere.

robot_core : This contains the simulated robot's parameters and structure.

gazebo_control This contains differential drive parameters for the robot to move in Gazebo.

camera.xacro This contains the camera specifications for the simulated camera in Gazebo.

Launch Files

rsp.launch.py : Launches robot state publisher

launch_sim.launch.py : Runs Gazebo simulation, robot state publisher, and spawn entity for ease in testing.

ball_tracker package

This package contains the ball tracking and following files as well as related launch files.

Executables

image_publisher : publishes images from camera to ros topic. image_subscriber : subscribes to topic to receive and process images.

multi_ball_tracker : uses OpenCV to mask processed images and publish coordinates of purple objects. Publishes to /ball_position topic and subscribes to camera/image_raw topic.

sim_multi_ball_tracker : uses OpenCV to mask processed images and publish coordinates of purple objects. Publishes to /ball_position topic and subscribes to simulated camera/image_raw topic.

follow_ball : receives ball position from /ball_position topic and publishes robot liner and angular speed to /cmd_vel to follow ball.

Launch Files

camera.launch.py : launches image_publisher and image_subscriber nodes

sim_cam.launch.py : launches image_subscriber that directly subscribes to /camera/image_raw

follow_ball.launch.py: launches follow_ball script

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 3

  •  
  •  
  •