-
Notifications
You must be signed in to change notification settings - Fork 419
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
Add the noise model from PyRobot #89
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That's amazing how implementation of Python specified actions for the agents makes easier to add functionality as noise models. Code looks clean to me, in your tests do you want to check that the actual actions have noise specified with performing same action.
return getattr(self, key) | ||
|
||
|
||
noise_models = { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's add link to PyRobot paper to reference source of noise parameters.
Can we add a gif to demonstrate the noisy actuation? |
@dhruvbatra @mathfac @s-gupta @kalyanvasudev Thoughts on the current way we are pointing people to PyRobot so they can include the proper citation if they use the noise model? |
* PyRobot Noise Model -- [PyRobot](https://github.com/facebookresearch/pyrobot#citation) | ||
|
||
Contributes the noise model used for the noisy control functions named `pyrobot_*` and defined in `habitat_sim/agent/pyrobot_noisy_controls.py` | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we restructure this bit?
"If you use the PyRobot noise models, please cite:
blah
Noisy control function named pyrobot_*
defined in blah
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
Hi Everyone, this all looks great! I have a quick suggestion, would it be possible to incorporate a noise model for state-estimation as well? Because there is some error in it as well on the real robot. |
I'm not entirely certain what you are referring to, but I assume this is the robot estimating it's pose relative to some initial pose? We currently have a noise-free GPS/Compass sensor, and we'd add noise to that? Can you point me to the noise models/parameters I should use for that? |
@erikwijmans, thank you for the gif of noisy navigation, looks great. Maybe, worth to add top down map with sampling same action from the same position and show distribution of final positions with opacity. |
Yes! Like Fig 4 here: |
Woah, so pretty! How many trajectories is this showing? 100? 500? |
100 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is awesome! The flexibility of the actuation specification API is clearly demonstrated here!
Did a quick pass and all LGTM! 👍
… pyrobot-noisy-actions
Merged this with master. I also put the control definitions in their own folder, |
np.sign(rotate_amount + 1e-8) * model.rotation.mean, model.rotation.cov | ||
) | ||
|
||
scene_node.rotate_local(mn.Deg(rotate_amount) + mn.Rad(rot_noise[0]), hsim.geo.UP) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@mosra -- Strongly typed angles are great! I can now add degrees and radians without fear :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hah, didn't even know this was possible (it isn't in C++, there it can't decide on what the result type should be). Nice to see it "just works" in Python.
@@ -15,7 +15,7 @@ | |||
import habitat_sim.bindings as hsim | |||
from habitat_sim import utils | |||
|
|||
__all__ = ["ActuationSpec", "SceneNodeControl", "ObjectControls"] | |||
__all__ = ["ActuationSpec", "SceneNodeControl", "ObjectControls", "register_move_fn"] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ideally we should move the definition of __all__
to __init__.py
|
||
from .controls import ActuationSpec, SceneNodeControl, register_move_fn | ||
|
||
__all__ = ["PyRobotNoisyActuationSpec"] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same comment as above.
import habitat_sim.bindings as hsim | ||
from habitat_sim import utils | ||
|
||
from .controls import ActuationSpec, SceneNodeControl, register_move_fn |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
NIT: if possible we should move to absolute imports instead of relative imports.
|
||
|
||
@attr.s(auto_attribs=True) | ||
class MotionNoiseModel: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A base NoiseModel
class could be useful here.
"LoCoBot": RobotNoiseModel( | ||
ILQR=ControllerNoiseModel( | ||
linear_motion=MotionNoiseModel( | ||
_MultivariateGaussian([0.014, 0.009], [0.006, 0.005]), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Abstracting out the constants into a different class would make this code more readable.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe stick this in a different file? Any class that has all these constants will be as unreadable as this class by definition (all these classes are doing is holding these constants).
noise_multiplier: float = 1.0 | ||
|
||
|
||
_x_axis = 0 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Make these constants X_AXIS
etc.
… pyrobot-noisy-actions
… pyrobot-noisy-actions
… pyrobot-noisy-actions
facebookresearch#89) * Modify partitioning logic to handle left-over scenes due to integer division
* Adds noisy actuations based on the noise model from PyRobot
Motivation and Context
Our friends at https://github.com/facebookresearch/pyrobot have "benchmarked" the noise of two real robots, LoCoBot and LoCoBot-Lite. So now we can add that noise model to habitat!
How Has This Been Tested
Via unit tests and with a little cv2 based viewer so I can step around :)
Types of changes