Skip to content

mak4x13/LoopSense

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

LoopSense Patrol Robot (ROS2)

LoopSense is a ROS2 patrol node that:

  • moves a mobile robot forward,
  • avoids nearby obstacles using LaserScan,
  • tracks patrol loops using odometry (distance from start point).

This package was developed in The Construct ROS2 environment and can also run locally on a ROS2 machine with simulator or real robot.

Package Contents

Required files:

  • robot_patrol/patrol.py (main node logic)
  • launch/start_patrolling.launch.py (launch entry point)
  • package.xml, setup.py, setup.cfg, resource/robot_patrol

Included for quality checks:

  • test/ linters

Ignored by default:

  • build/, install/, log/, Python caches
  • LoopSense DOC.pdf (kept local as optional report file)

ROS Interfaces

The node expects:

  • Subscribe: /scan (sensor_msgs/msg/LaserScan)
  • Subscribe: /odom (nav_msgs/msg/Odometry)
  • Publish: /cmd_vel (geometry_msgs/msg/Twist)

Prerequisites

  • ROS2 (tested workflow: Humble)
  • Python 3
  • A robot/simulator that provides /scan and /odom, and accepts /cmd_vel

Install common dependencies (Ubuntu):

sudo apt update
sudo apt install -y python3-colcon-common-extensions python3-rosdep

If first time using rosdep:

sudo rosdep init
rosdep update

Run on The Construct (Online)

  1. Open your ROS2 workspace terminal.
  2. Put this repository inside ~/ros2_ws/src.
  3. Build and run:
cd ~/ros2_ws
rosdep install --from-paths src --ignore-src -r -y
colcon build --packages-select robot_patrol
source install/setup.bash
ros2 launch robot_patrol start_patrolling.launch.py

Run Locally (Ubuntu + ROS2)

  1. Create workspace and clone:
mkdir -p ~/ros2_ws/src
cd ~/ros2_ws/src
git clone https://github.com/mak4x13/LoopSense.git
  1. Install dependencies, build, source:
cd ~/ros2_ws
rosdep install --from-paths src --ignore-src -r -y
colcon build --packages-select robot_patrol
source install/setup.bash
  1. Start your robot/simulator (must provide /scan and /odom), then run:
ros2 launch robot_patrol start_patrolling.launch.py

Run with Topic Remapping (if your robot uses different topic names)

ros2 run robot_patrol patrol_node --ros-args \
  -r scan:=/your_scan_topic \
  -r odom:=/your_odom_topic \
  -r cmd_vel:=/your_cmd_vel_topic

Notes for Real Robots

  • The obstacle logic uses fixed scan indices (0, 230, 360, 400), so your LaserScan must have enough rays and a similar angular layout.
  • For different sensors, adjust index mapping in robot_patrol/patrol.py.
  • Loop counting threshold is controlled by rev_threshold in robot_patrol/patrol.py.

Expected Output

You should see logs like:

[INFO] [patrol_node]: Completed revolution #1
[INFO] [patrol_node]: Completed revolution #2

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages