https://git.openrobots.org/https://git.openrobots.org/favicon.ico?14752240372017-09-20T10:25:34ZOpenrobotsgenom3 - Feature #132: Time handling in genomhttps://git.openrobots.org/issues/132?journal_id=1902017-09-20T10:25:34ZAnthony Malletanthony.mallet@laas.fr
<ul></ul><p>On Tuesday 19 Sep 2017, at 14:41, Arnaud Degroote wrote:</p>
<blockquote>
<p>- add a way to configure and use in some way the simulated time (for<br />example, use ros::Time for ROS template)</p>
</blockquote>
<p>Regarding this and genom3-ros, <a class="changeset" title="Implement even finer grain locking between codels and tasks Distribute the activity array among ..." href="https://git.openrobots.org/projects/genom3-ros/repository/genom3-ros/revisions/6943ade70e9c8a6f4e6f0a3bc4d274a56e9097eb">genom3-ros:6943ade</a> has the<br />following comment:</p>
<p>`` use posix timer_create()/SIGALRM and a clock thread instead of<br />ros::timer to pace period tasks. First, ros::timer seems to have a<br />huge jitter (~1ms after quick tests), and second ros::timer are run<br />within a ros callback queue, which was making it almost impossible<br />to both wait for an exec task response and still run the timer<br />...''</p>
<p>So it looks like using ros::time to schedule tasks was not so good in<br />the end, and I'm thus a bit reluctant to go back to this.</p>
<p>Yet, I understand the problem of scaling down the time or<br />synchronizing to some external clock. Do you have a rough architecture<br />of how it works with ros::time for your use case?</p> genom3 - Feature #132: Time handling in genomhttps://git.openrobots.org/issues/132?journal_id=1912017-09-20T11:40:53ZArnaud Degrootearnaud.degroote@easymile.com
<ul></ul><p>On 20/sept. - 12:25, Anthony Mallet wrote:</p>
<blockquote>
<p>Issue <a class="issue tracker-2 status-1 priority-2 priority-default" title="Feature: Time handling in genom (New)" href="https://git.openrobots.org/issues/132">#132</a> has been updated by Anthony Mallet.</p>
<p>On Tuesday 19 Sep 2017, at 14:41, Arnaud Degroote wrote:</p>
<blockquote>
<p>- add a way to configure and use in some way the simulated time (for<br />example, use ros::Time for ROS template)</p>
</blockquote>
<p>Regarding this and genom3-ros, <a class="changeset" title="Implement even finer grain locking between codels and tasks Distribute the activity array among ..." href="https://git.openrobots.org/projects/genom3-ros/repository/genom3-ros/revisions/6943ade70e9c8a6f4e6f0a3bc4d274a56e9097eb">genom3-ros:6943ade</a> has the<br />following comment:</p>
<p>`` use posix timer_create()/SIGALRM and a clock thread instead of<br />ros::timer to pace period tasks. First, ros::timer seems to have a<br />huge jitter (~1ms after quick tests), and second ros::timer are run<br />within a ros callback queue, which was making it almost impossible<br />to both wait for an exec task response and still run the timer<br />...''</p>
<p>So it looks like using ros::time to schedule tasks was not so good in<br />the end, and I'm thus a bit reluctant to go back to this.</p>
<p>Yet, I understand the problem of scaling down the time or<br />synchronizing to some external clock. Do you have a rough architecture<br />of how it works with ros::time for your use case?</p>
</blockquote>
<p>Well, for now, I just use ros::Time in codels and keep the system clock<br />in the periodic handler. For practical use, for now, it just run a bit<br />too fast. But the codels are definitively not anymore<br />"middleware-independant". And it will just break if I go faster than<br />real-time.</p>
<p>After, it is definitively not a critical problem for the current<br />demonstration, but it would be a nice improvement.</p>
<blockquote>
<p>----------------------------------------<br />Feature <a class="issue tracker-2 status-1 priority-2 priority-default" title="Feature: Time handling in genom (New)" href="https://git.openrobots.org/issues/132">#132</a>: Time handling in genom<br /><a class="external" href="https://git.openrobots.org/issues/132#change-190">https://git.openrobots.org/issues/132#change-190</a></p>
<ul>
<li>Author: Arnaud Degroote</li>
<li>Status: New</li>
<li>Priority: Normal</li>
<li>Assignee: </li>
<li>Category: </li>
<li>Target version: <br />----------------------------------------<br />Currently, the Pocolibs and ROS uses internally system time. It is good enough for robotic deployment, but not for prototyping / testing, where one can use simulator and "simulated time".</li>
</ul>
<p>It would be nice to: <br />- add a way to configure and use in some way the simulated time (for example, use ros::Time for ROS template)<br />- expose an API "middleware agnostic" way to retrieve time in genom codels</p>
</blockquote> genom3 - Feature #132: Time handling in genomhttps://git.openrobots.org/issues/132?journal_id=1932017-09-20T12:20:21ZAnthony Malletanthony.mallet@laas.fr
<ul></ul><p>On Wednesday 20 Sep 2017, at 13:40, Arnaud Degroote wrote:</p>
<blockquote>
<p>Well, for now, I just use ros::Time in codels and keep the system clock<br />in the periodic handler.</p>
</blockquote>
<p>Adding something like a function "self->gettimeofday(struct timeval<br />*)" or a data member "struct timeval self->now;" is definitely OK.</p>
<blockquote>
<p>For practical use, for now, it just run a bit<br />too fast. But the codels are definitively not anymore<br />"middleware-independant". And it will just break if I go faster than<br />real-time.</p>
</blockquote>
<p>Do you need to just accelerate/slow down the tasks (kind of "open<br />loop") or to synchronize to an external clock?</p>
<p>If genom3-ros is switched back to using a "ros::timer" instead of a<br />posix timer to schedule the tasks (and to feed self->gettimeofday() or<br />whatever), would this be enough?</p>
<p>Then, that could be a runtime option of the component<br />(e.g. ./component --simulation-time)</p> genom3 - Feature #132: Time handling in genomhttps://git.openrobots.org/issues/132?journal_id=1962017-09-21T07:31:50ZArnaud Degrootearnaud.degroote@easymile.com
<ul></ul><p>On 20/sept. - 14:20, Anthony Mallet wrote:</p>
<blockquote>
<p>Issue <a class="issue tracker-2 status-1 priority-2 priority-default" title="Feature: Time handling in genom (New)" href="https://git.openrobots.org/issues/132">#132</a> has been updated by Anthony Mallet.</p>
<p>On Wednesday 20 Sep 2017, at 13:40, Arnaud Degroote wrote:</p>
<blockquote>
<p>Well, for now, I just use ros::Time in codels and keep the system clock<br />in the periodic handler.</p>
</blockquote>
<p>Adding something like a function "self->gettimeofday(struct timeval<br />*)" or a data member "struct timeval self->now;" is definitely OK.</p>
<blockquote>
<p>For practical use, for now, it just run a bit<br />too fast. But the codels are definitively not anymore<br />"middleware-independant". And it will just break if I go faster than<br />real-time.</p>
</blockquote>
<p>Do you need to just accelerate/slow down the tasks (kind of "open<br />loop") or to synchronize to an external clock?</p>
</blockquote>
<p>The idea is more to synchronise with an external clock</p>
<blockquote>
<p>If genom3-ros is switched back to using a "ros::timer" instead of a<br />posix timer to schedule the tasks (and to feed self->gettimeofday() or<br />whatever), would this be enough?</p>
</blockquote>
<p>It is probably good enough.</p>
<blockquote>
<p>Then, that could be a runtime option of the component<br />(e.g. ./component --simulation-time)</p>
</blockquote>
<p>For the record, ros::Time reads the parameter use_sim_time to decide if<br />it reads system clock or /clock topic.</p>
<blockquote>
<p>----------------------------------------<br />Feature <a class="issue tracker-2 status-1 priority-2 priority-default" title="Feature: Time handling in genom (New)" href="https://git.openrobots.org/issues/132">#132</a>: Time handling in genom<br /><a class="external" href="https://git.openrobots.org/issues/132#change-193">https://git.openrobots.org/issues/132#change-193</a></p>
<ul>
<li>Author: Arnaud Degroote</li>
<li>Status: New</li>
<li>Priority: Normal</li>
<li>Assignee: </li>
<li>Category: </li>
<li>Target version: <br />----------------------------------------<br />Currently, the Pocolibs and ROS uses internally system time. It is good enough for robotic deployment, but not for prototyping / testing, where one can use simulator and "simulated time".</li>
</ul>
<p>It would be nice to: <br />- add a way to configure and use in some way the simulated time (for example, use ros::Time for ROS template)<br />- expose an API "middleware agnostic" way to retrieve time in genom codels</p>
</blockquote>