Quantcast

How to run Stage headless as fast as possible?

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

How to run Stage headless as fast as possible?

Adrian Böckenkamp
Hi folks,

I am trying to find out how to run Stage (more precisely, the stage_ros
node [1], v4.1.1 with ROS Kinetic
on Xubuntu 16.04.1 LTS 64 bit) in headless mode (-g command line flag).
I've already managed to run
very quickly using a low "resolution" property in the .world file as
well as using "threads 12". In particular,
the "speedup" property does only seem to have an effect when the GUI in
active. Setting "interval_real"
doesn't have any effect (it even emits a warning in GUI mode).

Please note that I would not like to change the "interval_sim" property
(set to 100ms, the recommended
default) since it affects the simulation accuracy/fidelity. The -f
parameter (see [1]) doesn't have any effect.
All mentioned properties (in "...") have been set in the root .world file.

*Short story*: my simulation runs MUCH faster in GUI mode than in
headless. How can I speed up
headless execution to run ASAP while retaining the same accuracy (= same
"interval_sim" value)?

(My simulation just uses ~10 robots with a diff actuator and ranger
sensors.)

I thought this is possible in Stage ... any hints are highly appreciated!

Kind regards & thanks in advance,
   Adrian

[1] playerstage.sourceforge.net/doc/Stage-manual-1.3.3-html/node16.html
[2] http://wiki.ros.org/stage_ros

PS: I've also compiled Stage and stage_ros from current Github sources
but it didn't help.

------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, SlashDot.org! http://sdm.link/slashdot
_______________________________________________
Playerstage-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/playerstage-users
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: How to run Stage headless as fast as possible?

Rich Mattes-2
On 12/14/2016 07:50 AM, Adrian Böckenkamp wrote:

> Hi folks,
>
> I am trying to find out how to run Stage (more precisely, the stage_ros
> node [1], v4.1.1 with ROS Kinetic
> on Xubuntu 16.04.1 LTS 64 bit) in headless mode (-g command line flag).
> I've already managed to run
> very quickly using a low "resolution" property in the .world file as
> well as using "threads 12". In particular,
> the "speedup" property does only seem to have an effect when the GUI in
> active. Setting "interval_real"
> doesn't have any effect (it even emits a warning in GUI mode).
>
> Please note that I would not like to change the "interval_sim" property
> (set to 100ms, the recommended
> default) since it affects the simulation accuracy/fidelity. The -f
> parameter (see [1]) doesn't have any effect.
> All mentioned properties (in "...") have been set in the root .world file.
>
> *Short story*: my simulation runs MUCH faster in GUI mode than in
> headless. How can I speed up
> headless execution to run ASAP while retaining the same accuracy (= same
> "interval_sim" value)?
>
> (My simulation just uses ~10 robots with a diff actuator and ranger
> sensors.)
>
> I thought this is possible in Stage ... any hints are highly appreciated!
>
> Kind regards & thanks in advance,
>    Adrian
>
> [1] playerstage.sourceforge.net/doc/Stage-manual-1.3.3-html/node16.html
> [2] http://wiki.ros.org/stage_ros
>
> PS: I've also compiled Stage and stage_ros from current Github sources
> but it didn't help.

tl;dr: stage_ros is hard-coded to update the simulation at 10Hz.

Details: stage_ros is hard-coded to (try to) update the stage simulation
10 times a second[1].  It updates the simulation in different ways
depending on whether you have a gui or not.  If there is a gui,
stage_ros calls Fl::wait() with a timeout tied to the 10Hz rate.
However, Fl::wait can return much sooner than that timeout ("if
something happens"[2],) so stage_ros is essentially in a while loop
updating stage, letting stage dictate the timing of the simulation
(which is why "speedup" is working - that's a gui-only parameter, and
stage is controlling its own timing in gui mode)

If stage_ros doesn't have a gui, it will call stage's update at the
hard-coded 10Hz rate. You can try modifying stage_ros to change or
remove the update rate.

Rich

[1]
https://github.com/ros-simulation/stage_ros/blob/master/src/stageros.cpp#L767
[2]
http://www.fltk.org/doc-1.3/classFl.html#a108a84216f0b3fa1cb0c46ab7449a312

------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, SlashDot.org! http://sdm.link/slashdot
_______________________________________________
Playerstage-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/playerstage-users
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: How to run Stage headless as fast as possible?

Richard Vaughan-2
I think this is a restriction of Stage-ROS only. The standalone Stage
can be run headless as fast as it'll go.

Here's one hour of simulated time in simple.world on my laptop just now:

time stage --gui worlds/simple.world
Stage 4.1.1 [GUI disabled]
 [Loading worlds/simple.world][Include pioneer.inc][Include
map.inc][Include sick.inc][Image "bitmaps/cave.png"]
[Stage: done]
real 0m8.293s
user 0m8.713s
sys 0m0.399s

It's a complex issue running sims faster than real time on ROS, which
is expecting real time.


On Sat, Dec 17, 2016 at 1:17 PM, Rich Mattes <[hidden email]> wrote:

> On 12/14/2016 07:50 AM, Adrian Böckenkamp wrote:
>> Hi folks,
>>
>> I am trying to find out how to run Stage (more precisely, the stage_ros
>> node [1], v4.1.1 with ROS Kinetic
>> on Xubuntu 16.04.1 LTS 64 bit) in headless mode (-g command line flag).
>> I've already managed to run
>> very quickly using a low "resolution" property in the .world file as
>> well as using "threads 12". In particular,
>> the "speedup" property does only seem to have an effect when the GUI in
>> active. Setting "interval_real"
>> doesn't have any effect (it even emits a warning in GUI mode).
>>
>> Please note that I would not like to change the "interval_sim" property
>> (set to 100ms, the recommended
>> default) since it affects the simulation accuracy/fidelity. The -f
>> parameter (see [1]) doesn't have any effect.
>> All mentioned properties (in "...") have been set in the root .world file.
>>
>> *Short story*: my simulation runs MUCH faster in GUI mode than in
>> headless. How can I speed up
>> headless execution to run ASAP while retaining the same accuracy (= same
>> "interval_sim" value)?
>>
>> (My simulation just uses ~10 robots with a diff actuator and ranger
>> sensors.)
>>
>> I thought this is possible in Stage ... any hints are highly appreciated!
>>
>> Kind regards & thanks in advance,
>>    Adrian
>>
>> [1] playerstage.sourceforge.net/doc/Stage-manual-1.3.3-html/node16.html
>> [2] http://wiki.ros.org/stage_ros
>>
>> PS: I've also compiled Stage and stage_ros from current Github sources
>> but it didn't help.
>
> tl;dr: stage_ros is hard-coded to update the simulation at 10Hz.
>
> Details: stage_ros is hard-coded to (try to) update the stage simulation
> 10 times a second[1].  It updates the simulation in different ways
> depending on whether you have a gui or not.  If there is a gui,
> stage_ros calls Fl::wait() with a timeout tied to the 10Hz rate.
> However, Fl::wait can return much sooner than that timeout ("if
> something happens"[2],) so stage_ros is essentially in a while loop
> updating stage, letting stage dictate the timing of the simulation
> (which is why "speedup" is working - that's a gui-only parameter, and
> stage is controlling its own timing in gui mode)
>
> If stage_ros doesn't have a gui, it will call stage's update at the
> hard-coded 10Hz rate. You can try modifying stage_ros to change or
> remove the update rate.
>
> Rich
>
> [1]
> https://github.com/ros-simulation/stage_ros/blob/master/src/stageros.cpp#L767
> [2]
> http://www.fltk.org/doc-1.3/classFl.html#a108a84216f0b3fa1cb0c46ab7449a312
>
> ------------------------------------------------------------------------------
> Check out the vibrant tech community on one of the world's most
> engaging tech sites, SlashDot.org! http://sdm.link/slashdot
> _______________________________________________
> Playerstage-users mailing list
> [hidden email]
> https://lists.sourceforge.net/lists/listinfo/playerstage-users



--
Richard Vaughan
Autonomy Lab / Computing Science / Simon Fraser University

------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, SlashDot.org! http://sdm.link/slashdot
_______________________________________________
Playerstage-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/playerstage-users
Loading...