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

Race conditions in YARP Plugins #60

Closed
jgvictores opened this issue Dec 26, 2017 · 9 comments
Closed

Race conditions in YARP Plugins #60

jgvictores opened this issue Dec 26, 2017 · 9 comments

Comments

@jgvictores
Copy link
Member

jgvictores commented Dec 26, 2017

This issue is a follow-up on #47 (comment).

Regarding the use of the main() function of OpenRAVE plugins, it is stated that "Robots might not necessarily be set before this function call". Current state:

  • We mostly want main() for CLI support, where this race condition does not happen, such as:
openrave /usr/local/share/teo-openrave-models/openrave/teo/teo.robot.xml --module OpenraveYarpPluginLoader "open --device controlboardwrapper2 --subdevice YarpOpenraveControlboard --robotIndex 0 --allManipulators"
  • This race condition does always occur via openrave.py. This is bad, but not terrible as we can always load the plugins via scripts as in the examples. Example of failure:
openrave.py -i /usr/local/share/teo-openrave-models/openrave/teo/teo.robot.xml --module OpenraveYarpPluginLoader "open --device controlboardwrapper2 --subdevice YarpOpenraveControlboard --robotIndex 0 --allManipulators"
@jgvictores
Copy link
Member Author

The priority of this issue is low, because:

  • Failure has not been observed in the CLI use case.
  • There is a workaround for Python, which is loading the plugin within the Python script.

@jgvictores
Copy link
Member Author

Careful with what is described here:

Via CLI, OpenRAVE::SensorBase::CC_PowerOn has no apparent effect. This is bad...

@jgvictores
Copy link
Member Author

Via CLI, OpenRAVE::SensorBase::CC_PowerOn has no apparent effect. This is bad...

Not only via OpenraveYarpPluginLoader: all OpenRAVE::SensorBase::CC_PowerOn via CLI.

@jgvictores jgvictores changed the title OpenraveYarpPluginLoader via main(): race conditions race conditions, especially in SensorBase::CC_PowerOn, via CLI, e.g. OpenraveYarpPluginLoader via main() Feb 23, 2018
@jgvictores jgvictores changed the title race conditions, especially in SensorBase::CC_PowerOn, via CLI, e.g. OpenraveYarpPluginLoader via main() race conditions via CLI, especially in SensorBase::CC_PowerOn, e.g. OpenraveYarpPluginLoader via main() Feb 23, 2018
@jgvictores
Copy link
Member Author

No results with (locking env has no effect, and ret is 1 both on fail and success):

{
    OpenRAVE::EnvironmentMutex::scoped_lock lock(penv->GetMutex()); // lock environment
    int ret = sensorBasePtr->Configure(OpenRAVE::SensorBase::CC_PowerOn, true);
    CD_DEBUG("CC_PowerOn: %d\n", ret);
 }

@jgvictores
Copy link
Member Author

@jgvictores jgvictores changed the title race conditions via CLI, especially in SensorBase::CC_PowerOn, e.g. OpenraveYarpPluginLoader via main() race conditions in SensorBase::CC_PowerOn Dec 22, 2019
@jgvictores
Copy link
Member Author

openrave.py -i /usr/local/share/teo-openrave-models/openrave/teo/teo.robot.xml --module OpenraveYarpPluginLoader "open --device controlboardwrapper2 --subdevice YarpOpenraveControlboard --robotIndex 0 --allManipulators"

We can avoid the "robot" vs "plugin" race condition via new syntax which loads the env first within the plugin (#99 (comment)): openrave.py -i --module OpenraveYarpPluginLoader "env openrave/teo/teo.robot.xml open --device controlboardwrapper2 --subdevice YarpOpenraveControlboard --robotIndex 0 --allManipulators"

@jgvictores
Copy link
Member Author

Leaving this issue open to research on OpenRAVE::SensorBase::CC_PowerOn, which (hopefully) may be due to something as simple as not starting the simulation.

jgvictores added a commit that referenced this issue Jan 20, 2020
@jgvictores
Copy link
Member Author

Mostly solved via e3dfd77.

Still, via yarpdev:

  1. Sometimes collision ODE is not set -> force it via the GUI.
  2. Sometimes simulation does not start (can occur in large environments) -> force it via the GUI (make sure Options > Simulation checked)

Therefore, the OpenraveYarpPluginLoader approach (perma) is preferred, via CLI and/or Python.

@jgvictores jgvictores changed the title race conditions in SensorBase::CC_PowerOn race conditions in YARP Plugins Jan 20, 2020
@jgvictores jgvictores changed the title race conditions in YARP Plugins Race conditions in YARP Plugins Jan 21, 2020
jgvictores added a commit that referenced this issue Jan 21, 2020
@jgvictores
Copy link
Member Author

  • Sometimes collision ODE is not set -> force it via the GUI.

Fixed via 3e387ec (--collision was not being treated, now it is).

2. Sometimes simulation does not start (can occur in large environments) -> force it via the GUI (make sure Options > Simulation checked)

It wasn't large environments and race conditions. It was the RGBD without Depth example, fixed via 033a5d0

Closing issue!

@jgvictores jgvictores self-assigned this Feb 14, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant