How would you sync a real life accelerometer with an accelerometer in a simulation program. In this case I am using MuJoCo for simulation and a Gy-521 is my physical, real life accelerometer.
2 Answers
Your question is very open ended as "syncing" is not clearly defined. I'm going to answer as best i can interpret your intent.
An accelerometer is a sensor which measures acceleration in the world. A simulated sensor in the simulation should likewise be measuring acceleration in the simulated world.
Do you that end to cause the simulated sensor to provide the same readings you should take the real sensors readings. Estimate the motions of the real system which caused those accelerations. Then send those motions to the simulator to be executed. And if you've estimated the motion accurately and modeled the system will enough in the simulation the accelerometers will be in sync, aka giving the same readings.
I assume you want a simulated input that would be identical to the actual input from a real accelerometer, as has happened during some experiments in the past.This is a typical need for debugging.
In the ROS environment, this can be most easily done by implementing the accelerometer as a separate ROS node that periodically publishes messages about the current acceleration on the ROS bus. You will need another node that listens to these messages and uses them.
With such a setup, it is possible to record the acceleration messages with the RosBag tool and then replay them during the simulation, getting exactly the same readings as from the real accelerometer.
I am using MuJoCo
. $\endgroup$