Coder Social home page Coder Social logo

fmt_star_ros's Introduction

FMTstar-planner

This repository provides a path-planning ROS service which uses Heuristic FMT*(Forward Marching Tree) planner for 2D ROS occupancy grids in ROS to generate asymptotically optimal paths at a rate much faster than state of the art algorithms like RRT* and PRM*. A heuristic was added to the planning algorithm FMT* described in this paper

Steps to run it:

  1. Clone the Repository

cd catkin_ws/src

git clone https://github.com/YashTrikannad/FMTstar-planner.git

catkin_make install

catkin_make

  1. Run the F110 simulator (Make sure you have it cloned on your local machine (Follow the instructions in this repository)- mLab)

cd catkin_ws

source devel/setup.bash

roslaunch racecar_simulator simulator.launch

  1. Open a new terminal. Run the Server Node

cd catkin_ws

source devel/setup.bash

roslaunch fmt_star fmt_star_server.launch

  1. Open a new terminal. Run the Client Node to query the planner

cd catkin_ws

source devel/setup.bash

rosrun fmt_star FMTstar_test_client_node

Configuration Parameters can be changed in the config/config.yaml file to get the desired behavior and efficiency

How to call the planner and recieve plans

#include <ros/ros.h>
#include <visualization_msgs/MarkerArray.h>
#include "fmt_star/plan_srv.h"

Include the required headers

int main(int argc, char **argv)
{
    ros::init(argc, argv, "FMTstar_test_client");

    ros::NodeHandle n;
    ros::ServiceClient client = n.serviceClient<fmt_star::plan_srv>("FMTstar_search");

Initialize your client node where you want to recieve the path (You may already be doing this where you want to call this.) and add add this service that the client node will be pinging to for recieveing the path messages.

    fmt_star::plan_srv srv_message;
    const auto start = ros::topic::waitForMessage<geometry_msgs::PoseStamped>("gt_pose",ros::Duration(2));
    ROS_INFO("Send a 2d Nav Goal");
    const auto goal = ros::topic::waitForMessage<geometry_msgs::PoseStamped>("move_base_simple/goal",ros::Duration(20));

Get your start and goal messages which are geometry_msgs::PoseStamped

    if(!start)
    {
        ROS_ERROR("Unable to Plan. Start not recieved");
    }
    else if(!goal)
    {
        ROS_ERROR("Unable to Plan. Goal not recieved");
    }
    else
    {
        srv_message.request.start_position = *start;
        srv_message.request.end_position = *goal;
    } 

Assign your start and goal to the service request

    if (client.call(srv_message))
    {
        ROS_INFO("Plan Recieved");
        // Plan available here.
    }
    else
    {
        ROS_ERROR("No Plan Recieved");
    }

    return 0;
}

Your Plan will be available in srv_message.response.path. You can find the Test Client Example here

fmt_star_ros's People

Contributors

yashtrikannad avatar vishnuprem avatar

Watchers

James Cloos avatar paper2code - bot 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.