Git Product home page Git Product logo

cadrl_ros's Introduction

cadrl_ros (Collision Avoidance with Deep RL)

ROS implementation of a dynamic obstacle avoidance algorithm trained with Deep RL 20 agent circle

Paper:

M. Everett, Y. Chen, and J. P. How, "Motion Planning Among Dynamic, Decision-Making Agents with Deep Reinforcement Learning", IEEE/RSJ International Conference on Intelligent Robots and Systems (IROS), 2018

Paper: https://arxiv.org/abs/1805.01956 Video: https://www.youtube.com/watch?v=XHoXkWLhwYQ

Bibtex:

@inproceedings{Everett18_IROS,
  address = {Madrid, Spain},
  author = {Everett, Michael and Chen, Yu Fan and How, Jonathan P.},
  booktitle = {IEEE/RSJ International Conference on Intelligent Robots and Systems (IROS)},
  date-modified = {2018-10-03 06:18:08 -0400},
  month = sep,
  title = {Motion Planning Among Dynamic, Decision-Making Agents with Deep Reinforcement Learning},
  year = {2018},
  url = {https://arxiv.org/pdf/1805.01956.pdf},
  bdsk-url-1 = {https://arxiv.org/pdf/1805.01956.pdf}
}

Dependencies:

  • TensorFlow is required (tested with version 1.4.0)

  • numpy is required

  • ROS is optional (tested with Kinetic on Ubuntu 16.04)

  • ford_msgs if you're using ROS, for our custom msg definitions.

General Notes:

The main contribution of this software is the network.py file and trained model parameters (TensorFlow checkpoints). Those contain the policy as reported in our paper and enables other reasearchers to easily compare future algorithms.

To make it easy to understand the flow of the code, we provide an example in scripts/ga3c_cadrl_demo.ipynb, in the form of a Jupyter notebook. This can be used just as a reference, but if you want to edit the file, make sure Jupyter is installed in your tensorflow virtualenv to be sure it will work.

To Run Jupyter Notebook (minimum working example of algorithm)

This assumes you have nvidia-docker installed already. Might work with regular docker with minor changes.

git clone [email protected]/mfe7/cadrl_ros
./cadrl_ros/docker/build_docker.sh
./cadrl_ros/docker/run_docker.sh

That will start an instance of the docker container, and output a Jupyter notebook URL. Copy the URL into a browser, navigate to cadrl_ros/scripts and open ga3c_cadrl_demo.ipynb.

Tensorflow and other deps are already installed in the docker container you just built, so the notebook should "just work."

ROS Notes:

We also provide a ROS implementation that we tested on a Clearpath Jackal ground robot. This node is just one module of the software required for autonomous navigation among dynamic obstacles, and much of it is written as to integrate with our system. The ROS node as written may not be particularly useful for other systems, but should provide an example of how one might connect the modules to test our learned collision avoidance policy on hardware. For example, other systems likely have different representation formats for dynamic obstacles as extracted from their perception system, but it should be straightforward to just replace our cbClusters method with another one, as long as the same information makes it into the state vector when the policy is queried. We recommend looking at the Jupyter notebook first.

The algorithm was trained with goals set to be <10m from the agent's start position, so it would be necessary to provide this system with local subgoals if it were to be tested in a long journey. For short distances, say in an open atrium, this is probably not necessary.

To Run ROS version:

Clone and build this repo and its dependency (assume destination is ~/catkin_ws/src)

cd ~/catkin_ws/src
git clone [email protected]/mfe7/cadrl_ros
git clone [email protected]:acl-swarm/ford_msgs.git -b dev
cd ~/catkin_ws && catkin_make

Connect inputs/outputs of your system to launch/cadrl_node.launch

Subscribed Topics:
Published Topics:
  • ~nn_cmd_vel [geometry_msgs/Twist] Robot's commanded twist (linear, angular speed) according to network's output

  • The other published topics are just markers for visualization

    • ~pose_marker shows yellow rectangle at position according to ~pose
    • ~path_marker shows red trajectory according to history of ~pose
    • ~goal_path_marker shows blue arrow pointing toward position of commanded velocity 1 second into future
    • ~agent_markers shows orange cylinders at the positions/sizes of nearby agents
  • TODO: remove other_agents_marker, other_vels

Parameters:
  • ~jackal_speed Robot's preferred speed (m/s) - tested below 1.2m/s (and trained to be optimized near this speed)

Datasets:

As mentioned in the paper, we provide a few datasets that might be useful to researchers hoping to train NNs for collision avoidance. Please find the files in this Dropbox folder, along with instructions for use.

The test cases used in the paper are posted in this Dropbox folder. These contain initial positions, goal positions, preferred speed, radius settings for each test case, and are separated by number of agents. They were randomly generated in a way to produce reasonably interesting scenarios to evaluate the algorithms, but since they are random, some may be really easy or boring.

Primary code maintainer:

Michael Everett (https://github.com/mfe7)

cadrl_ros's People

Contributors

blutjens avatar mfe7 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

cadrl_ros's Issues

How to consider map?

How are you @mfe7?
I have found "Robot designed for socially acceptable navigation", and i read it.
I have a single question about diffusion map in page 48.
-> How to merge diffusion map and CADRL?

I understood that like under.
First using grid map for making Diffusion map, then input them into a MPC.
The MPC generate trajectories which are able to avoid collision with map.
A CADRL uses Trajectory, best to drive, for subgoal.
In this view, the CADRL is used for tracking module?

Thank you for reading this issue.

'launch/cadrl_node.launch'

Hey Michael,
Thank you very much for your patience. Now there is a new problem in running the code 'launch/cadrl_node.launch'. I look forward to your answer.

The specific information of the bug is as follows:
launch/cadrl_node.launch: line 1: syntax error near unexpected token newline' launch/cadrl_node.launch: line 1: '

Thx. Kind regards.
Happy new year to you!
Bing Han

Some problems about how to replicate the results

Hi, I am very interested in this project and I really want to replicate the figures shown in the paper.
However, after I isntall the dependency and run the jupyter example code, I find the example is a little bit simple, which I mean it just show how to load the net and give a action prediction in a moment.
I wonder if there are some decumentation or code that show how to use the network, agent and util python file to draw a obstacle avoidance figure just like shown in the paper. I am also curious about how to use the data in the dataset you provided along with the already existed network module in the code to give some results.
Hope I describe my problems clearly. Thank you.

Clusters msg

Hello Michael,
Regarding the Clusters.msg, If I understand it right, the clusters msg contains information about the dynamic obstacles in the environment like their locations and velocities. if that is correct, how do you get this information? Do you use an object detection system like Yolo or something?

Thanks in advance.

How to train the network?

Dear authors:
My research is focused on pedestrian obstacle avoidance algorithm. I have recently read your paper. I try to run 'network.py' and 'demo.py' but I found that there are all trained models, and I don't know how to train the network?
If I want to change some parameters and train this network, how should I do?
Thank you very much for your kind consideration and I am looking forward to your early reply.

need a help professor

@mfe7 Hi, professor. Your work was so wonderfully we loved the way you created your project. I got some errors while training in your model I would like to clarify with you. If you have time to discuss with me it might be a great helpfully for me to solve my problem. I like to make this conversation personal this is my Gmail id [email protected]. If you contact me to solve my problem it will be greatly helpful for my team. Thanks in advance for the help.

Train directly in ros simulator?

Hello, Can I retrain this NNs directly in ros simulator such as gazebo ? But this repo doesn't seem to contain such training process.

Question regarding pose information

Hello :)
First of all, great job! It's absolutely amazing what you all did for this research.
As a total beginner in ROS, I would love it if you can clarify these for me:

  1. After building your environment, how do I run it?
  2. At any stage you run SLAM? I am wondering since I saw on the youtube video that SLAM was running...or, because you are suscribed to the "PoseStamped" message then you are able to obtain the global coordinates without having to explicitely run SLAM?

Again, I am just beginning to ROS and would love to understand it a bit better :) I hope you don't mind clarifying these :D
Thank you!

How to replicate the circle trajectories like README.md

Hi Michael,

Thanks for your great jobs.

I am running this repo on Stage simulator, while the circle trajectories are not like the figure in README.md.

Here is the trajectory I run in Stage.
image

Some parameters of my experiments as follows:

  • the radius of the circle scenarios: 10.0
  • the radius of robots: 0.36
  • the maximum velocity: 1m/s for linear velocity, 1/rad for angular velocity
  • differential drive platform
  • load model: 01900000
  • not noise

The code details:

        """
        poses:
            all pose information of robots in the global coordinate system
            poses[i, 0]: the ith robot position at the x-axis
            poses[i, 1]: the ith robot position at the y-axis
            poses[i, 2]: the ith robot heading angle
        
        goals:
            all goal position information in the global coordinate system
            goals[i, 0]: the goal position of the ith robot at the x-axis
            goals[i, 1]: the goal position of the ith robot at the y-axis

        self.radius:
            the radius of all robots (0.36m)

        self.max_vx:
            the maximum velocity of all robots (1m/s)

        global_vels:
            the velocity information of all robots in the global coordinate system
            global_vels[i, 0]: the velocity of the ith robot at the x-axis
            global_vels[i, 1]: the velocity of the ith robot at the y-axis

        """
        obs_inputs = []
        for i in range(self.num_agents):
            robot = Agent(poses[i, 0], poses[i, 1], 
                          goals[i, 0], goals[i, 1], 
                          self.radius, self.max_vx, 
                          poses[i, 2], 0
                          )
            robot.vel_global_frame = np.array([global_vels[i, 0],
                                               global_vels[i, 1]])
            other_agents = []
            
            index = 1
            for j in range(len(poses)):
                if i == j:
                    continue

                other_agents.append(
                    Agent(poses[j, 0], poses[j, 1],
                          goals[j, 0], goals[j, 1], 
                          self.radius, self.max_vx,
                          poses[j, 2], index 
                         )
                )
                index += 1

            obs_inputs.append(
                robot.observe(other_agents)[1:]
            )

        actions = []
        predictions = self.nn.predict_p(obs_inputs, None)
        for i, p in enumerate(predictions):
            raw_action = self.possible_actions.actions[np.argmax(p)]

            actions.append(np.array([raw_action[0], raw_action[1]]))

Do I misunderstand the code or wrongly set the parameter?

Looking forward to your reply : )

./build_docker.sh error!

Hello, thanks for sharing your awesome work. I'm a beginner about this field and this is the first time I learn about it. I have been troubled by the above questions for a long time. I hope you can help me, thank you very much!

When I run**. / build_ docker. SH**, there is an error when pip install IPython = = 5.7 ipykannel = = 4.10 jupyter.

1659964507(1)

I don't how to solve it.
Thank you very much!

Training Code

Hi!

Nice work! I want to train it in some new scenarios.

Is there any plan in near future to release the training code?

Thanks!

About the training set.

How can I obtain the initial training set that the paper say that is relased to the public?

NNActions and PlannerMode messages

Hey Michael,

I'm trying to run the rosnode, but I get an error that the NNActions and PlannerMode messages do not exists. I also couldn't find them in the ford_msgs repo. Do I strictly need the messages or can I remove them from the code?

Kind regards, Ewoud

Sir, I have some questions about CADRL.

I have two questions.
(1) Fundamentally, is it possible to avoid CADRL by reflecting newly updated obstacle information that is not included in the static map or dynamic objects other than people?

(2) If i have trained 4 agents environment , CADRL could act well 5 or more agents environment?

from ford_msgs.msg import PedTrajVec, NNActions, PlannerMode, Clusters

Hey Michael,
Firstly, according to the README.md, I replaced 'git clone https://bitbucket.org/acl-swarm/ford_msgs.git' with 'git clone https://bitbucket.org/acl-swarm/ford_msgs.git -b dev' because I can't find the dev branch and run 'catkin_make'. It successed.
Then I tried to run the './cadrl_node.py', but I got an error 'ImportError: No module named ford_msgs.msg' in line 7, 'from ford_msgs.msg import PedTrajVec, NNActions, PlannerMode, Clusters'.
So how can I do to solve the above two problems?
Thx. Kind regards.

preset_testCases

Hi, sorry to bother you again.

I find the test cases (preset_testCases, num_agents:10) you used. I run again using the checkpoint file(gym-collision-avoidance/gym_collision_avoidance/envs/policies/GA3C_CADRL/checkpoints/IROS18/network_01900000) you provided with vpref=1.0, DT=0.2. But it fails. I reduce the radius of the agent from 0.5 to 0.3, then it works but with a slightly different trajectory.
image

image
1665502962257

Is this normal or am I using the wrong parameter file?
Thanks for your help~

Generate observation data from sensors

Hi Michael,
I am working with cadrl for a few weeks now and I want to thank you for your amazing work.
Currently my turtlebot can navigate on a map while avoiding dynamic obstacles. (Basically following a global plan by sending subgaosl, similar to the youtube video: https://www.youtube.com/watch?v=CK1szio7PyA )

In the simulation I directly publish the Cluster msgs from the odom data of the obstacles. However I would like to generate them from sensor data for example the local costmap using the move base package.
So I wanted to know if you can give me a hint on how you generated the cluster msgs in ur example.

In Minute 1:16 you can see the jackal waiting for the lady to finish her order, meaning it is aware of the pillar in front of him. Are static obstacles from the map also published as cluster msgs ?

thanks in advance :)

safe_actions publisher

Hello Michael,

Would you be willing to share the code for the publisher of the "safe_actions" topic ?

Thanks in advance.

Nick Hetherington

The problem of running code

hello, author, I try to run 'ga3c_cadrl_demo.py' and it prints 'action: [1.2 0.52359878]'. I understand that it means the next action of the host_agent and is that correct?
And how to get the figures (Fig. 4 and Fig. 6) in you paper if I run the code 'network.py'?

The datasets 'Dropbox folder' can not open

Hey Michael,
I try to open the datasets in the Dropbox folder but it doesn't work, can you give me a new website about it?
Thank you very much!
Happy new year to you!
Bing Han

Simulation results in GA3C-CADRL

Hi,

I find the results in your paper (GA3C-CADRL) are pretty good. And it surprises me that the results in Fig.6 (b)(c) is so perfect.
image

It seems that these agents have to move very carefully since they are very close to each other.
image

I try to replicate this result using the checkpoint file you provided, but only got some results like this ....
image

I wonder if it's because I need to retrain for this scene, or if it's because the car size or whatever it is isn't set up properly.

I really need your help. Thanks ~

Socially Aware Motion Planning

Hi!
This is an amazing work!I want to use the social norm to optimize the reward function.
I wonder if there is any possible that you could tell me the value of scalar penalty when you train the network! I didn't find the Specific value in this paper.
Thank you!

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.