-
Notifications
You must be signed in to change notification settings - Fork 63
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
Fred/building_crowdsim for generating the navmesh file and required configuration files for menge #224
Fred/building_crowdsim for generating the navmesh file and required configuration files for menge #224
Conversation
I see a bit of test code scattered around the code base, specifically in
I guess it could either be moved to actual unit / integration test files or deleted, what do you think? |
Another "high level" comment is that I would try to follow the conventions in the rest of the code base, from a quick glance (similar to the plugins PR):
|
building_map_tools/building_crowdsim/config/template_conf_yaml.py
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for putting these features together, @FloodShao!
I am hesitant to review this fully at the moment, as it requires a lot of workarounds to test it with the other branches, namely, #218 and #225. I will suggest we merge #218 first, rebase this branch, properly integrate the changes so that we can test the whole build pipeline.
@luca-della-vedova and I discussed a bit regarding maintainability, and would like your opinion on this. Since we are not writing APIs, but rather declaring a lot of different data structures, do you think it will be a better idea to keep the code base small by accessing and manipulating the data structures via their public members, instead of getters and setters?
Only when further conditions are needed to access data from data structures (eg. checks, calculations, etc), and that it is widely used across the code base, then we should consider defining getters for that.
The source files are currently missing their respective licenses, and the style should also be checked.
Agreed. We can merge #218 first, and I'm working on #225 and #224. Thanks for all that comments and advice on the code, that helps a lot. |
…pass navmesh_generator test
…efact add description in the package entry
…efact finalize code style
Hi, @aaronchongth and @luca-della-vedova, I have reworked the class structure, removed unnecessary setter and getter functions, and modified the code style. I have rebased this pr last THU, so this PR includes the crowd_simulation_plugin now.
I think these steps should be able to test the pipeline after getting the "building.yaml". Thank you for your time and patient for reviewing this PR. |
I'm looking at the generation CMakeLists and trying to understand the steps and if they can be simplified or documented better. From what I understand there is need to add three build items to the CMakeLists if anyone was to add crowd simulation to their world:
I wonder if there is any merging that can be done for those, I think the only reason we would want them separate would be if there is a use case for generating only a subset of them and it seems that anyone who wants to integrate crowd simulation will always need to generate all the three sets of files? Also I don't really understand the phony folder, what is its purpose? |
Hi @luca-della-vedova , only https://github.com/FloodShao/traffic_editor/blob/fred/building_crowdsim_navmesh_test/building_crowdsim_pr_test/CMakeLists.txt#L44-#L75 is related to the crowd simulation setup. Only these block is inserted compared to the https://github.com/osrf/rmf_demos/blob/master/rmf_demo_maps/CMakeLists.txt Yep, I think I can merge the two commands together into one if that's necessary. Because step 1 and step 2 are processing the same building.yaml, except step 2 requires a generated world.sdf as input. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
OK! Had some time to go through the code and give some more detailed feedback, for the CMakeLists I think we should try to integrate them in a single command so there is less risk for the downstream users to make mistakes (if for example they only call one of the two commands).
Also I'd recommend structuring tests so that their results are checked (i.e. make sure that a generated file is equal to a template), and integrating them with colcon so they are ran when doing colcon test
building_map_tools/building_crowdsim/config/configfile_generator.py
Outdated
Show resolved
Hide resolved
building_map_tools/building_crowdsim/navmesh/polygon_factory.py
Outdated
Show resolved
Hide resolved
building_map_tools/building_crowdsim/navmesh/polygon_factory.py
Outdated
Show resolved
Hide resolved
building_map_tools/building_crowdsim/test/build_configfile_TEST.py
Outdated
Show resolved
Hide resolved
building_map_tools/building_crowdsim/test/build_navmesh_Base_TEST.py
Outdated
Show resolved
Hide resolved
…2round Fred/building crowdsim navmesh 2round
Current PR changes:
Test:
An example for MaleVisitorPhone actor. |
Running colcon test I found a test failure in the package:
|
…2round minor update
Apologies for that. This was caused by the changing Plugin constructor. The previous Plugin constructor requires one parameter for the platform. And I forgot to changed that line in the test file. This problem is fixed now. |
assert filecmp.cmp( | ||
generate_file, | ||
standard_result) | ||
|
||
os.remove(generate_file) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not 100% a fan of generating files in the source folder but I guess we can accept it for now, maybe just change the logic a bit so the file is deleted also when the test fails? (right now if I interpret it correctly the generated file will be added to the source folder if the assert fails)
Just fixed the deleting file problem and the test failure problem (it turns out the I forgot to update the test yaml file to be consistent with the current code as well.) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Awesome, thanks for all the changes!
This sub-package is developed for generating the navmesh file and required configuration files from the building.yaml output by traffic-editor GUI.
This package is integrated within the
building_map_tools
package, and can be called using ros2 run command.Before using
building_crowdsim
, the building.yaml files with "human_lanes" and "crowd_sim" tag. An example building.yaml for office scenario can be found here: https://github.com/FloodShao/traffic_editor/tree/fred/building_crowdsim_test/building_crowdsim_test_filesros2 run command, after package building:
ros2 run building_map_tools building_navmesh navmesh [input_building_yaml] [output_dir]
ros2 run building_map_tools building_navmesh configfile [input_building_yaml] [output_dir] [world.sdf_to_be_inserted_with_plugin] [gazebo_or_ign_tag]