Git Product home page Git Product logo

mz_wang_intern's Introduction

MZ_WANG_INTERN

This ROS package demonstrates a path planner for a multiple agents scenario. This package includes two nodes: Planner and Agent. The Planner nodes provides a path planning service that implements A* to find the shortest path between a given start and a given goal on a 11*11 grid. The Agent node publishes the agent's position as well as the found path returned by Planner. For multiple agents scenario, the path of one agent will not be considered by another agent to avoid collision.

This package has been tested under Ubuntu 16.04 and ROS Kinetic. C++ 11 is required for successful compilation.

Installation

Dependencies

This package depends only on ROS.

Build

cd catkin_ws/src
git clone https://github.com/mzwang828/mz_wang_intern.git
catkin build

Run single node

Source the workspace first:

source catkin_ws/devel/setup.bash

To run the 2 nodes individually:

# Start a roscre
roscore
# In a new terminal, run the planner
rosrun mz_wang_intern planner
# To run the agent, serial_ID and start_position are needed
roslaunch mz_wang_intern agent.launch serial_ID:="agent_1" start_position:=[0,0,0]

Run the Test Case

For the convinience of test, a test.launch file is provided

Run the test.launch file will automatically start 3 nodes: the planner, an agent_1 with start_position [0,0,0] and an agent_2 with start_position [5,5,0]. Rviz will also be started to show the map and path. To run the test case:

# run the test.launch
source catkin_ws/devel/setup.bash
roslaunch mz_wang_intern test.launch

To plan the path, one needs to call the service in a new terminal.

source catkin_ws/devel/setup.bash
# For agent 1
rosservice call /agent_1/update_goal "goal:
  x: 5.0
  y: 5.0
  theta: 0.0"
# For agent 2
rosservice call /agent_2/update_goal "goal:
  x: 10.0
  y: 8.0
  theta: 0.0"

Note: Once you source the workspace in the terminal, you can use TAB Completion to fill the service request automatically, and you only need to change those numbers, as shwon below.

Screenshots

Test Case: TestCase

Avoid another agent's path. The red agent is avoiding the path of the green agent: avoid

Service list:

service

mz_wang_intern's People

Contributors

mzwang828 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.