Code Monkey home page Code Monkey logo

social_force_window_planner's Introduction

social_force_window_planner (ROS2 Foxy version)

A local controller based on Dinamic Window Approach (DWA) and Social Force Model (SFM) has been developed to command a differential robot in a socially-compliant way.

This planner projects a set of possible trajectories in a small lookahead time (sim_time parameter). Then, the SFM is employed as a predictor of the future state of the surrounding people along the trajectories.

Besides the basic scoring function to follow the global path, a new social cost has been added. It is based on the concept of the "social work" performed by the robot ($W_{r}$), and the social work provoked by the robot in the surrounding pedestrians ($W_{p}$)

$$ W_{social} = W_{r} + \sum W_{p_{i}} $$

With:

  • $W_{r}$ The summatory of the modulus of the robot social force and the robot obstacle force along the trajectory. According to the SFM.
  • $W_{p}$ The summatory of the modulus of the social forces provoked by the robot for each close pedestrian along the trajectory. According to the SFM.

This local planner has been programmed as a Controller plugin under ROS2 distro foxy. So it can be used in the ROS2 nav2 architecture. The possible collisions are checked based on the ROS local costmap and the projected people positions.

Acknowledgment

This publication has been financed by the European Regional Development Fund (FEDER) and by the Ministry of Economy, Knowledge, Business and University, of the Government of Andalucía , within the framework of the FEDER Andalucía 2014-2020 operational program. Specific objective 1.2.3. "Promotion and generation of frontier knowledge and knowledge oriented to the challenges of society, development of emerging technologies" within the framework of the reference research project UPO-1264631. FEDER co-financing percentage 80%

Parameters

An example yaml file with the set of parameters is provided in config/local_planner.yaml

  • Robot Configuration Parameters

    • max_trans_acc. Maximum acceleration in translation (m/s^2).
    • max_rot_acc. Maximum acceleration in rotation (rad/s^2).
    • max_trans_vel. Maximum linear velocity (m/s).
    • min_trans_vel. Minimum linear velocity (m/s).
    • max_rot_vel. Maximum angular velocity (rad/s).
    • min_rot_vel. Minimum angular velocity (rad/s).
    • min_in_place_rot_vel. Angular velocity of rotations in place (rad/s).
  • Goal Tolerance Parameters

    • yaw_goal_tolerance. Tolerance in angular distance (rad) to consider that the goal has been reached.
    • xy_goal_tolerance. Tolerance in euclidean distance (m) to consider that the goal has been reached.
    • wp_tolerance. Distance (m) from the robot to look for the point of the global plan to follow.
  • Forward Simulation Parameters

    • sim_time. Time (seconds) to expand the robot movement and check for collisions. (default: 0.5).
    • sim_granularity. Resolution in meters to split the expanded trayectory and check for collisions (Default: 0.025).
  • Sensor Interface Parameters The sensor interface is in charge of taking the sensory input and update the information of the surrounding social agents in the scene.

    • laser_topic. Topic in which the laser range finder is being published [sensor_msgs/LaserScan].
    • people_topic. Topic in which the people detected are being published [people_msgs/People].
    • odom_topic. Odometry topic [nav_msgs/Odometry].
    • max_obstacle_dist. Maximum distance (m) in which the obstacles are considered for the social force model.
    • naive_goal_time. Lookahead time (secs) to predict an approximate goal for the pedestrians.
    • people_velocity. Average velocity of the pedestrians (m/s).
  • Social Force Model Parameters The weights of the SFM forces for people trajectory computation.

    • sfm_goal_weight. Weight of the attraction force to the goal.
    • sfm_obstacle_weight. Weight of the respulsive force of the obstacles.
    • sfm_people_weight. Weight of the respulsive force of the pedestrians.
  • Trajectory-scoring Function Parameters Cost function for trajectory scoring:

$$ C_{traj} = C_{s} * \omega_{s} + C_{cm} * \omega_{cm} + C_{a} * \omega_{a} + C_{v} * \omega_{v} + C_{d} * \omega_{d} $$

With:

  • social_weight $\omega_{s}$. The weight given to the "social-work" term. ($W_{social}$)
  • costmap_weight $\omega_{cm}$. The weight given to the normalized "non-lethal" costmap value.
  • angle_weight $\omega_{a}$. The weight given to the angle difference between the robot heading and the path heading.
  • vel_weight $\omega_{v}$. The weight given to the difference between the linear maximum velocity allowed and the linear velocity evaluated.
  • distance_weight $\omega_{d}$. The weight given to the distance between the final point of the projected robot trajectory and the current local goal.

Dependencies

TO DO List:

The package is a work in progress used in research prototyping. Pull requests and/or issues are highly encouraged.

  • Improve the approximation to a final goal.
  • Larger sim_time and wp_tolerance gives more "social" freedom to the planner but it presents problems to overcome some corners and narrow passages. We must try to fix this or to find a good balance.
  • Fix the computation of the robot local goal in the path in case the robot moves farther than wp_tolerance distance.

social_force_window_planner's People

Contributors

noeperez 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

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

social_force_window_planner's Issues

Adjust Parameters

Thank you very much for your help.
I am running a simulation using SFW, but no matter which of the following weights I adjust: social_weight, costmap_weight, angle_weight, distance_weight, velocity_weight, it still crashes into an obstacle.
What other parameters do I need to adjust?

Collision with a moving obstacle

Hello.
I am doing a simulation using sfwplanner. As I get closer to the pedestrian, the value of the social_work cost increases, but sometimes the cost value changes and sometimes it does not, even under the same conditions. When the value does not change, the value usually increases after the collision. This may be a problem with the specs of my PC, but is it a problem that can be solved by changing the parameters or the program?

Detection accuracy of dynamic obstacles

Thank you very much for your help. Is it correct that my_agents.size() in line 584 of sfw_planner.cpp represents the number of detected dynamic obstacles + 1 (robot itself)? When I modified the program to display this value during the simulation, it sometimes displayed various values such as 4 or 5 even though there was only one robot and one pedestrian. In addition, visualization with rviz showed some moving points other than the actual pedestrians. Is it collect to assume that this is a problem with the accuracy of the dynamic_obstacle_detector package or the performance of the robot's sensor? I am currently using 2d lidar for my simulation.
(My previous question about costmap_cost was resolved. Sorry for the inconvenience.)

How to use this package in a simulation of a wheelchair avoiding a pedestrian

Nice to meet you.
I'm new to ROS.
I'm trying to create a simulation where a wheelchair automatically avoids pedestrians. Currently, I am using DWA Planner ROS to control the wheelchair, but I have changed to SFW Planner ROS and confirmed that the wheelchair can reach the destination in a space without pedestrians. In the future, I would like to simulate avoidance by adding pedestrians to the environment, but is it possible to avoid pedestrians by predicting their behavior using only SFW Planner ROS and its dependent packages?
(In this case, is it correct that the wheelchair is subject to repulsion from the pedestrian, attraction from the goal, and repulsion from the obstacle?) Also, what settings are required in each dependent package when running such a simulation?

Found a small error in sfw_planner.cpp

Hello.
Thanks again for your help.
I found a very small mistake in the program.
In sfw_planner.cpp, on lines 144 and 145 :

std::printf("%.2f, ", (i * angvel_step));
std::printf("%.2f, ", (i * (-angvel_step)));

but I think angvel is a mistake for linvel, isn't it?

costmap_cost is always 0

Hello.
I have made some changes to my program to be able to display the cost values during the simulation.
However, only cost_map_cost is always showing 0. Where does the program get the information for the cost map?

How to display the candidates of best path

Hello.
Thank you for everything.
I understand SFWPlanner generates multiple candidates for the orbit and selects the best orbit from them. Is it possible to display all the candidates on the screen?
I used rostopic echo to look at the /move_base/SFWPlannerROS/local_plan topic, but nothing was displayed. Also in rviz, when I tried to visualize /move_base/SFWPlannerROS/local_plan, nothing was displayed.
(On the other hand, I was able to confirm with rviz that /move_base/SFWPlannerROS/global_plan generates a route along the global path. )

Robot rotates around the global path only in real environment

Hello.
I'm planning to use this planner in a real environment.
It works well in simulation, but in real environment, the robot often rotates around the global path. The parameters are all the same, but for some reason the robot moves differently in the real environment than in the simulation. The rotation around the global path is a little better when the angle_weight is increased, but the motion is still different from the simulation. Is this planner or its dependent packages not well suited for real-world use?
Or is it my settings that are wrong?

Is this package compatible with ROS kinetic?

Hi.
I'm using ROS kinetic, is this package compatible with kinetic?
I'm having trouble catkin_make.
If it doesn't support kinetic, what do I need to change to be able to use kinetic?

calculate of social_work

Hi.
I have a question about the calculation of social_work.
I think the social_work used to calculate the cost of the generated trajectory candidates is calculated from the social_force and obstacle_force that calculated in sfm.hpp.
Also, as far as I can see in the program, I think social_force is calculated from the distance between the robot and the pedestrian, but at what timing is this distance?
In other words, the trajectory has a certain length, but I couldn't understand whether it is the distance at the end of the trajectory, the beginning of the trajectory, or a certain point in the middle of the trajectory when I read the program.

Use gazebo_sfm_plugin and pedlab

Hi. Thank you very much for your help.
I am currently using social_force_window_planner to control a wheelchair on ROS. It is working fine.
Is it possible to use gazebo_sfm_plugin and pedlab to represent a pedestrian in the same environment?
I am trying to simulate a situation where a wheelchair avoids pedestirans.

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.