robotics-upo / hunav_sim

A simulator of human navigation behaviors for Robotics based on ROS2
MIT License
44 stars 8 forks source link

Human Navigation behavior Simulator (HuNavSim)

A controller of human navigation behaviors for Robotics based on ROS2.

This is a work in progress version

Tested in ROS2 Humble

The simulated people are affected by the obstacles and other people using the Social Force Model. Besides, a set of human reactions to the presence of robots have been included.

If you use this simulator in your work, please cite:

N. Pérez-Higueras, R. Otero, F. Caballero and L. Merino, "HuNavSim: A ROS 2 Human Navigation Simulator for Benchmarking Human-Aware Robot Navigation," in IEEE Robotics and Automation Letters, vol. 8, no. 11, pp. 7130-7137, Nov. 2023, doi: 10.1109/LRA.2023.3316072.

Bibtex:

@ARTICLE{PerezRal2023,
  author={Pérez-Higueras, Noé and Otero, Roberto and Caballero, Fernando and Merino, Luis},
  journal={IEEE Robotics and Automation Letters}, 
  title={HuNavSim: A ROS 2 Human Navigation Simulator for Benchmarking Human-Aware Robot Navigation}, 
  year={2023},
  month={September},
  volume={8},
  number={11},
  pages={7130-7137},
  issn={2377-3766},
  doi={10.1109/LRA.2023.3316072}}

A pre-print version of the accepted paper is available here.

Dependencies

Features

Steps to use HuNavSim with a robotic simulator

The navigation behavior of the human agents spawned in a regular physics simulator can be controlled by HuNavSim. Therefore, HuNavSim can be "connected" to a popular simulators used in Robotics like Gazebo, Webots, Morse or Unity.

To do so, we must programme a ROS2 wrapper of the particular simulator. At each simulation step, the wrapper must collect the current state of the human agents and the robot (positions and velocities), and send them to HuNavSim. The HuNavSim controller will compute and return the next state of the agents. Finally, the wrapper must update the agents' state in the simulation.

That communication with HuNavSim can be easily done through different ROS2 services available. These services use the messages of the package hunav_msgs:

Moreover, the initial configuration parameters of the agents can be read from the "/hunav_loader" ROS2 node. This node loads the agents data from the yaml file 'agents.yaml' located in the config directory of the package hunav_agent_manager. Then, the parameters can be retreived through the ROS2 service /hunav_loader/get_parameters.

A Gazebo (v11) wrapper is provided in: https://github.com/robotics-upo/hunav_gazebo_wrapper

Configuration

The user must define the desired number and properties of hunav agents. This is done through the file agents.yaml. The user can edit this file directly, o can create it through a GUI, check the hunav_rviz2_panel.

An example snippet of a agents.yaml file with two agents can be seen next:

hunav_loader:
  ros__parameters:
    map: cafe
    publish_people: true
    agents:
      - agent1
      - agent2
    agent1:
      id: 1
      skin: 2
      group_id: -1
      max_vel: 1.5
      radius: 0.4
      behavior: 
        type: 4 # REGULAR=1, IMPASSIVE=2, SURPRISED=3, SCARED=4, CURIOUS=5, THREATENING=6
        configuration: 0 # def: 0, custom:1, random_normal:2, random_uniform:3
        duration: 40.0  # seg
        once: true
        vel: 0.6
        dist: 0.0
        goal_force_factor: 2.0
        obstacle_force_factor: 10.0
        social_force_factor: 5.0
        other_force_factor: 20.0
      init_pose:
        x: -3.973340
        y: -8.576801
        z: 1.250000
        h: 0.0
      goal_radius: 0.3
      cyclic_goals: true
      goals:
        - g0
        - g1
        - g2
      g0:
        x: -3.133759
        y: -4.166653
        h: 1.250000
      g1:
        x: 0.997901
        y: -4.131655
        h: 1.250000
      g2:
        x: -0.227549
        y: -10.187146
        h: 1.250000
    agent2:
      id: 2
      skin: 3
      group_id: -1
      max_vel: 1.5
      radius: 0.4
      behavior: 
        type: 6 
        configuration: 2  
        duration: 40.0  # seg
        once: true
        vel: 0.6
        dist: 0.0
        goal_force_factor: 2.0
        obstacle_force_factor: 10.0
        social_force_factor: 5.0
        other_force_factor: 20.0
      init_pose:
        x: 2.924233
        y: 5.007970
        z: 1.250000
        h: 0.0
      goal_radius: 0.3
      cyclic_goals: true
      goals:
        - g0
        - g1
      g0:
        x: -2.644067
        y: 2.066231
        h: 1.250000
      g1:
        x: -1.663169
        y: -3.291318
        h: 1.250000

Global Parameters

As global parameters the user must indicate:

Agent parameters

The user must provide the following data under the identification name of each agent. The names must match the names list indicated in the parameter agents:

Metrics parameters

The user can also configure the set of metrics to be computed. Check the hunav_evaluator to know how.

Example run

Some example launch to run the HuNavSim with Gazebo can be found in the documentation of the hunav_gazebo_wrapper

TODOs

Acknowledgements

This work is partially supported by Programa Operativo FEDER Andalucia 2014-2020, Consejeria de Economía, Conocimiento y Universidades (DeepBot, PY20_00817) and the project NHoA (PLEC2021-007868) and NORDIC (TED2021-132476B-I00), funded by MCIN/AEI/10.13039/501100011033 and the European Union NextGenerationEU/PRTR.