Possibly wrong check of tag <period>
If I understood correctly, the tag
<period> is used as the running period for the
updater_thread, which updates all the motors.
If so, it is a property of the whole plugin and not related to a specific
Therefore, it should be specified outside the tag
<rotors>, similarly to the following:
<plugin name="mrsim" filename="mrsim-gazebo.so"> <link>base</link> <period>1e-3</period> <rotors> <noise>0.03</noise> <cf>6.5e-4</cf> <ct>1e-5</ct> <rotor><joint spin="cw">rotor-1</joint></rotor> <rotor><joint spin="ccw">rotor-2</joint></rotor> <rotor><joint spin="cw">rotor-3</joint></rotor> <rotor><joint spin="ccw">rotor-4</joint></rotor> </rotors> </plugin>
Keeping that in mind, by looking at line 244, it seems that the tag
<period> is never going to be found.
ElementPtr r is used, which is either pointing to the tag
<rotors>, if this tag is present, or to nothing, otherwise.
In this last case, the code might run into an undefined behavior since the pointer has no prior initialization, and the code is trying to run the method
Therefore, I think line 244 should be fixed as follows:
1000000 * (sdf->HasElement("period") ? sdf->Get<double>("period") : 1e-3);
@Anthony Mallet, is it correct what I am saying?
Updated by Anthony Mallet about 1 year ago
On Sunday 4 Sep 2022, at 11:51, Gianluca Corsini wrote:
I tried to do it through ssh but it seems I have no right to do
it. Shall I create another repository somewhere and then link the
I thought you had access. Members of the 'robots' unix group at LAAS
are automatically granted RW rights, but it seems you are not member
of that group.
I'll push the fix, don't worry.
Updated by Gianluca Corsini about 1 year ago
- Status changed from New to Closed
Applied in changeset mrsim-gazebo|50435cdbea73e5f5d204d0ade6c73d0dc7c0aa20.