Add Noise to the IMU sensors in the Mujoco simulation#854
Conversation
| @property | ||
| def noisy_data(self) -> np.ndarray: | ||
| """Gets the current sensor reading with measurement noise applied.""" | ||
| return self.data | ||
|
|
There was a problem hiding this comment.
I am not so happy with always calling noisy_data even for non-noisy Sensors. I would do the reverse, if there is no reason to get the raw non-noisy data of a NoisySensor.
There was a problem hiding this comment.
I can imagine usecases for getting the non-noisy data, e.g. when providing data for my automated testing framework developed in the context of StuFo (which is currently still on wolfgang and I wont try to merge it till StuFo is done).
But that can be done just as well using raw_data & data instead of data & noisy_data. I don't have a strong preference between the two, keeping data intact as the groundtruth felt less disruptive and more predictable to me. If you want it the other way around I can do it.
There was a problem hiding this comment.
Okay, now I agree more with how you already did it.
| from bitbots_mujoco_sim.robot import Robot | ||
|
|
||
| if TYPE_CHECKING: | ||
| from bitbots_mujoco_sim.simulation import RobotSimulation |
There was a problem hiding this comment.
You actually use this in line 66, so it will fail if TYPE_CHECKING == False
| from bitbots_mujoco_sim.robot import Robot | |
| from bitbots_mujoco_sim.simulation import RobotSimulation |
There was a problem hiding this comment.
Hmm. GitHub's suggestions are broken.
Summary
Adds noise for the IMU in the Mujoco simulation. The default parameters approximate a simple measurement of a real robot, but no systematic measurement has been done. No systematic biases have been measured, which matches others experiences. The ability to add these has still been provided incase people want to test this ability out.
Proposed changes
Add helper classes
NoisySensorandNoisyQuternionSensor. This would also simplify if we ever want to add noise to the other sensors.Add parameter handling for the noise parameters. Also update handling of a few of the older parameters, AFAICT, the
get_parameter_ordoes not actually work the way it was used before (at least I couldn't get it to work with my new parameters).Related issues
closes #825
Checklist
pixi run buildTest on the robot