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

Allow to "break" sensors #153

Merged
merged 6 commits into from
Oct 1, 2021
Merged

Allow to "break" sensors #153

merged 6 commits into from
Oct 1, 2021

Conversation

jbmouret
Copy link
Collaborator

When we split a skeleton, some sensors point to unavailable bodies (or the robot would have no access to the sensors on the detached skeleton).

This PR use the _attached boolean (which was already here) to be able detach a sensor explicitly (to avoid a segv when it was attached to something that does not exist anymore).

One idea is that it is up to the user to know what to do when a sensor is detached (e.g., replace with zero). So, the user should check that the sensor is attached when working with damage and querying sensors.

Copy link
Member

@costashatz costashatz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@jbmouret thanks a lot for this. See my comments above.

src/robot_dart/robot.cpp Show resolved Hide resolved
src/robot_dart/sensor/sensor.cpp Outdated Show resolved Hide resolved
src/robot_dart/sensor/sensor.cpp Outdated Show resolved Hide resolved
@costashatz
Copy link
Member

@jbmouret @dalinel thanks for this!

@costashatz costashatz merged commit 65e030f into master Oct 1, 2021
@costashatz costashatz deleted the break_sensors branch October 1, 2021 18:27
costashatz added a commit that referenced this pull request Dec 8, 2021
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.

3 participants