Skip to content

Odd Behavior in Gazebo #36

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

Open
valschmidt opened this issue Dec 4, 2020 · 5 comments
Open

Odd Behavior in Gazebo #36

valschmidt opened this issue Dec 4, 2020 · 5 comments

Comments

@valschmidt
Copy link

I am loath to write this because I am the lone person on our team suffering from it. But in a somewhat desperate attempt, I'm hoping others might at least have some suggestions.

Frequently, (but not all the time), always after beginning to send thrust commands, something crashes/resets (I'm not sure what), and my vessel teleports to the datum location and becomes unresponsive. There are no messages of any kind, and gzserver is still running. I have verified that the reported location is coming from the simulated GPS and not any down-stream localization.

I am running cora in a VMWare virtual machine, without an Nvidia GPU. Nonetheless, my VM is allocated 8 cores and 16 GB and is taxed but does not appear to be swamped in compute or memory. That said, it does not quite run in real-time.

A reboot of the virtual machine has no positive effect.

I do understand enough about Gazebo to know if a plugin can fail without any indication. Nor am I sure how to troubleshoot the problem. I welcome any thoughts.

-Val

@caguero
Copy link
Collaborator

caguero commented Dec 4, 2020

Just out of curiosity, are you sending commands by any chance while the task state is in initial? If that's the case, the boat is locked to the world. It's released in the ready state.

@valschmidt
Copy link
Author

valschmidt commented Dec 4, 2020 via email

@caguero
Copy link
Collaborator

caguero commented Dec 4, 2020

If you're running the marina.launch, then, no scoring plugin should be loaded and the boat shouldn't be locked to the world at any time.

You can try running the simulation with:

roslaunch vorc_gazebo marina.launch --extra_gazebo_args:="--verbose"

to see if you get any errors from Gazebo.

@valschmidt
Copy link
Author

We were able to reproduce the failure on another system and tracked it down to my thruster commands. I admit I don't fully understand the what's happening, but if one inadvertently sends very large thrust commands it can cause the effect we've observed. It's surprising to me because I could find code for the thruster model that limits the input commands to (nominally +/- 1). This is no longer a critical item, as we can follow the directions and send commands within +/- 1, and not suffer the problem. I'll leave this issue to others to close in case someone wants to have a look first to see if they can make it more robust.

Thanks,
Val

@mabelzhang
Copy link
Collaborator

mabelzhang commented Dec 11, 2020

I haven't tried to reproduce this. Just jotting down some notes for reference.

I think these are the lines referred to above, about bounding the commands to [-1, 1]
https://github.com/osrf/vrx/blob/8dff85cf7ecfcc3a8b7f98494c732f37e6344865/usv_gazebo_plugins/src/usv_gazebo_thrust_plugin.cc#L309-L332

where maxCmd is by default 1.0:
https://github.com/osrf/vrx/blob/8dff85cf7ecfcc3a8b7f98494c732f37e6344865/usv_gazebo_plugins/src/usv_gazebo_thrust_plugin.cc#L231
and it is set to 1.0 in cora_description default SDF as well

One possibility is that in the first snippet above, it's calling UsvThrust::Glf(), passing in some very specific constants. I don't understand the equation and don't know if these constants are specific to the WAM-V and need to be changed for CoRa. If they do, I don't know what they need to be changed to. So that hits the limit of my knowledge 😅

To test this without that knowledge, whether that's me or someone else, it might be worth printing in GlfThrustCmd() and making sure the return value is indeed bound to [-1, 1].

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

No branches or pull requests

3 participants