This project involves developing a ROS Node in C++ that generates and publishes a simulation image based on given input parameters. The node will:
- Create an image of a specified size.
- Mark obstacles, start position, and goal position.
- Simulate the movement of an marker travelling from start to goal.
- Customizable Simulation: Define the width, height, obstacle positions, start, and goal locations.
- Obstacle Representation: Obstacles appear as black pixels in the generated image.
- Start & Goal Markers:
- Start position is marked in Yellow.
- Goal position is marked in Blue.
- Arrow Path Simulation: The arrow moves step-by-step towards the goal, stopping at obstacles.
- Grid-by-Grid Update: The path updates dynamically in the ROS topic.
The node requires the following parameters:
- Width & Height: Dimensions of the simulation space (in pixels).
- Obstacle List: List of
(x, y)coordinates representing obstacles. - Starting Position:
(x, y)coordinate of the start position. - Goal Position:
(x, y)coordinate of the goal position. - Simulation Rate: Speed of the simulation (in Hz).
- ROS installed on your system
- OpenCV for image handling
- C++ compiler with CMake support
- Clone the repository:
git clone <repository_url> cd <repository_folder>
- Build the package:
catkin_make
- Source the workspace:
source devel/setup.bash
Run the ROS node to generate the simulation: <package_name> use assignment_1
roslaunch <package_name> <node_name>- A white image (free space) is published.
- Black obstacles are placed.
- Yellow marker (start position) appears.
- Blue marker (goal position) appears.
- The arrow path updates grid-by-grid until it reaches the goal or an obstacle is hit.
To launch the simulation with custom parameters, modify the ROS launch file or pass arguments through a config file.
- Add support for different obstacle shapes.
- Implement advanced path-planning algorithms.
- Provide a GUI interface for user-defined parameters.