Skip to content
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

Fix ElectroHydraulic crash #29

Merged
merged 1 commit into from
May 2, 2022
Merged

Fix ElectroHydraulic crash #29

merged 1 commit into from
May 2, 2022

Conversation

chapulina
Copy link
Contributor

A little crash was introduced in #3. Try for example:

ros2 launch buoy_gazebo mbari_wec.launch.py

Then press play, and the simulation crashes.

Originally, the rand() function was used, but that resulted in this warning:

Consider using rand_r(...) instead of rand(...) for improved thread safety.  [runtime/threadsafe_fn] [2]

The proposed fix here is to use a fixed a seed when calling rand_r. This should make the simulation more deterministic, which is usually desirable. But if we really want a different value each time the simulation is run, we could seed it with the current time.

Signed-off-by: Louise Poubel <louise@openrobotics.org>
@chapulina chapulina requested a review from quarkytale April 30, 2022 00:11
@quarkytale
Copy link
Contributor

Hmm this shouldn't have creeped in, the fix for it is already merged in this commit

@chapulina chapulina merged commit dc178de into main May 2, 2022
@chapulina chapulina deleted the chapulina/rand_r branch May 2, 2022 19:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants