Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature/add crowdsim example #14

Merged
merged 13 commits into from Mar 31, 2021
Merged

Conversation

youliangtan
Copy link
Member

@youliangtan youliangtan commented Mar 25, 2021

What's here

This PR showcases an example of crowd simulation in rmf_demos's airport_terminal world. Refer to menge for more information about crowdsim. In this case, crowd_sim comes in handy to create intentional delay to any moving robot when humans walk pass its traffic lane.

Screenshot from 2021-03-25 16-36-35

This scenario is located at the centre of the airport_terminal map, in which the humans will interact with the moving cleaning robots according to the defined human_lanes

Minor side fixes:

  • Support headless option for ignition, by headless:=1
  • rmf_panel_panel will create a dist folder if the folder is not available during webpack download.

Run Scenario

ros2 launch rmf_demos airport_terminal.launch.xml use_crowdsim:=1 headless:=0 use_ignition:=0

** Feel free to toggle the launch args: use_crowdsim, headless, use_ignition

To dispatch the cleaning robots: use dashboard (localhost:5000), send the cleaning robot to zone_1 and zone_3 respectively

Notes and TODO

  • Documentation on configuring CrowdSim with traffic editor:

    • This detailed doc was created by @ FloodShao
    • At some point, we will need to update and consolidate this doc to somewhere (maybe multirobotbook).
  • Further simplify crowd sim configuration

  • Issue: when multiple agents in agent_groups spawn at the same x y coordinate.

    • The noticed behaviour is when more than 10 external_agents are spawned, menge will fail silently during initialization. This is due to agents being spawned on the same position. (brief analysis)
    • Temp solution: 2 agents_name are created to accommodate more than 10 external agents. Refer here

…rport world

Signed-off-by: youliang <tan_you_liang@hotmail.com>
Signed-off-by: youliang <tan_you_liang@hotmail.com>
Signed-off-by: youliang <tan_you_liang@hotmail.com>
Signed-off-by: youliang <tan_you_liang@hotmail.com>
Signed-off-by: youliang <tan_you_liang@hotmail.com>
@youliangtan youliangtan added this to In Review in Research & Development via automation Mar 25, 2021
@luca-della-vedova luca-della-vedova self-assigned this Mar 26, 2021
@luca-della-vedova
Copy link
Member

I am a bit worried about starting to add binaries to the repo. The MaleVisitorPhone model is on fuel, is there any way to just download it instead?
I guess a hacky quick fix could be a script on compilation, a more proper one would be to integrate with pit_crew.

@youliangtan
Copy link
Member Author

Yeap, I was also quite hesitant to add the MaleVisitorPhone locally. Still, treating the actor as a non-static object which is similar to other robots justify the reason for having the actor in rmf_demos_assets.

Of course, if pitcrew is prefered, a (should be) quick fix is to add a few lines of code here on building_map_tools.

@luca-della-vedova
Copy link
Member

The main difference with robot models is that those are not uploaded in fuel so there is no risk of them getting out of sync.
On the other hand I suspect that integrating with pit_crew wouldn't be super simple but I'm not too familiar with it.
My worry is the recurring issue of having two different version of the same models (fuel and this repo). There was a bit of a hacky solution implemented before here, do you think it would be a reasonable hack or better to just include it in the repo?

@luca-della-vedova
Copy link
Member

Crowdsim is failing to find a solution at startup "once in a while", and all humans stop and start looking at their phone:

image

I suspect it might be an issue of too many humans / some goal sets not having enough capacity but I'm not 100% sure.
Did you observe this behavior?

Signed-off-by: youliang <tan_you_liang@hotmail.com>
@codebot
Copy link
Contributor

codebot commented Mar 30, 2021

that is a realistic simulation of what happens when there is a problem with mass transit

@youliangtan
Copy link
Member Author

@luca-della-vedova This behaviour happened occasionally, might due to what you suspected: the capacity of each goal_sets. After 2565a6c, increasing the capacity seems to solve the problem (after running some while on my machine). Let me know if this happens again on your test system.

rmf_demos_panel/rmf_demos_panel/api_server.py Outdated Show resolved Hide resolved
Comment on lines 47 to 50
dir_path = os.path.dirname(bundle_path)
if not os.path.isdir(dir_path):
print(f"Dir path: {dir_path} doesnt exist, create dir")
os.mkdir(dir_path)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same as above

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is related to rmf_panel_panel, in which to create a dist dir if the folder is not available. This is mentioned in the description as a minor not crucial diff. I can open another pr if this looks confusing to have it here.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That's probably a good idea? It might be confusing in the version history to see this file change with a commit message related to crowd simulation when we squash merge

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Removed, (same as above): 8927093

Signed-off-by: youliang <tan_you_liang@hotmail.com>
rmf_demos_panel/rmf_demos_panel/gui_server.py Outdated Show resolved Hide resolved
rmf_demos/package.xml Outdated Show resolved Hide resolved
Signed-off-by: youliang <tan_you_liang@hotmail.com>
@youliangtan youliangtan deleted the feature/add-crowdsim-example branch March 31, 2021 09:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants