cyberbotics / webots

Webots Robot Simulator
https://cyberbotics.com
Apache License 2.0
3.27k stars 1.7k forks source link

mavic pro 2 battery simulation #5712

Open achintha96 opened 1 year ago

achintha96 commented 1 year ago

I have implemented a mavic pro 2 drone in webots and it operates successfully. But when I added the battery, webots window closes immediately. So I printed battery capacity in console and it shows -1 always. Doesn't matter how much I change the value in battery field it shows -1. How can I solve this issue?

I want to discharge battery while the simulation goes on. How can I implement battery successfully?

omichel commented 1 year ago

I believe this crash was fixed recently in #5669. Could please download a recent nightly build and let us know if the problem is fixed?

The battery should work automatically out-of-the-box. You can adjust the motor consumptionFactor to adjust how much your motors are consuming energy from the battery. Similarly, the robot cpuConsumption can be adjusted. Let us know how well this works for you.