srl-freiburg / pedsim_ros

Pedestrian simulator powered by the social force model
https://github.com/srl-freiburg/pedsim_ros
BSD 2-Clause "Simplified" License
460 stars 170 forks source link

Create new scenarios #38

Open syuntoku14 opened 4 years ago

syuntoku14 commented 4 years ago

Is there any way to create new scenario xml files? It seems that they are generated by SGDiCoP but I can't google it. What is SGDiCoP?

kivrakh commented 4 years ago

Hi,

You may have a look at this to get scenario definition: http://pedsim.silmaril.org/documentation/libpedsim/latest/demoapp_scenario.html

syuntoku14 commented 4 years ago

Thank you!

makokal commented 4 years ago

Hi @syuntoku14, SGDiCoP was small internal project to build a QT editor for the scenarios that we never got finished. Been meaning to work on a new python based one and would happily accept contributions along these lines

kivrakh commented 4 years ago

Hi @syuntoku14, SGDiCoP was small internal project to build a QT editor for the scenarios that we never got finished. Been meaning to work on a new python based one and would happily accept contributions along these lines

A practical tool would be amazing to create different types of scenarios. Otherwise, I draw the scenarios like an architect and calculate all the geometry and transform that to the XML file. How can we collaborate on this tool?

makokal commented 4 years ago

Hi @syuntoku14, SGDiCoP was small internal project to build a QT editor for the scenarios that we never got finished. Been meaning to work on a new python based one and would happily accept contributions along these lines

A practical tool would be amazing to create different types of scenarios. Otherwise, I draw the scenarios like an architect and calculate all the geometry and transform that to the XML file. How can we collaborate on this tool?

The easiest thing is some simple python GUI that allows drag and drop and simple validation of the xml. Qt seems like a good choice for the GUI backend.

For the way forward, I would suggest that if one of you want to take on this, please create a new implementation issue and link these discussions there. Break it down into a simple design doc and the implementation.

fverdoja commented 3 years ago

Hi everyone and thanks for the very nice project. One tool I could see being very useful could be one to convert from ros SLAM maps (pgm + yaml) to scenarios. If nothing of sort is already available, I could definitively work on it myself.

makokal commented 3 years ago

@fverdoja That would be very beneficial. Please submit a PR

fverdoja commented 3 years ago

I will put myself on it 👍

fverdoja commented 3 years ago

@makokal I have written the first version of the script (here). However I am having the problem that the obstacles have default width of one meter and they are huge compared to the map (which should be already in the correct scale). map walls Is there a way to define a different width for an obstacle?

Thanks!

edit: conversely, if there's a way to define the scenario grid resolution (to have it match the ROS map resolution) that could also work

makokal commented 3 years ago

Hi @fverdoja Thanks for taking on this. you can certainly reduce the size of the markers. These are set in https://github.com/srl-freiburg/pedsim_ros/blob/master/pedsim_visualizer/src/sim_visualizer.cpp#L229

fverdoja commented 3 years ago

@makokal thanks! I didn't realize it was just a visualization issue. Silly me... :) image The code to build the new scenarios from ROS maps now seems to work well then. As you saw from my previous comment I have at the moment built it as a separate package from this one, but I would have no problem in integrating it in this package if you think it makes sense. Let me know what you prefer.

makokal commented 3 years ago

Fantastic. Thanks for this contribution, very helpful. Like you said we can integrate it to be a sub-folder of this repo or keep it outside and add a link. I am fine with either, leave it up to you. I would ask though that at very least have a link (e.g. via a git submodule in this repo) for people to easily discover this utility, and add a few lines in the readme to point to that.

fverdoja commented 3 years ago

I will try to send a pull request to integrate my repo into yours, I think it's probably the best approach. Also btw, while at the moment this works with ROS maps, it is very little extra work to make it able to convert any manually-drawn binary map image into scenarios. I can work on that as well. When I am done, you can probably close this issue.

fverdoja commented 3 years ago

Hi @fverdoja Thanks for taking on this. you can certainly reduce the size of the markers. These are set in https://github.com/srl-freiburg/pedsim_ros/blob/master/pedsim_visualizer/src/sim_visualizer.cpp#L229

@makokal regarding this, while setting up scenarios for use with ROS maps, we need

walls_marker.scale.x = 0.05;
walls_marker.scale.y = 0.05;

should we make these as ROS parameters so they can be set in the launchfile depending on the scenario? Ideally this would be a property of the scenario, but I am not sure we want to change the scenario definition file from the default pedsim one.

makokal commented 3 years ago

@fverdoja Yes, making them parameters is the way to go

fverdoja commented 3 years ago

Perfect! I will include that change in the pull request as well then.