I am trying to execute the calibration example in the DronecodeSDK on my IRIS quad-copter simulated in Gazebo.
I am getting calibration failed at the end with no motion :
!develop /meta/DronecodeSDK/example/calibrate/build> ./calibrate udp://:14540
[05:35:24|Info ] DronecodeSDK version: 0.11.0 (dronecode_sdk_impl.cpp:24)
Waiting to discover system...
[05:35:24|Info ] New device on: 127.0.0.1:14580 (udp_connection.cpp:200)
[05:35:24|Debug] New: System ID: 1 Comp ID: 1 (dronecode_sdk_impl.cpp:284)
[05:35:24|Debug] Component Autopilot (1) added. (system_impl.cpp:369)
[05:35:24|Debug] MAVLink: info: data link #0 lost (system_impl.cpp:280)
[05:35:25|Debug] MAVLink: info: data link #0 regained (system_impl.cpp:280)
[05:35:25|Debug] Discovered 1 component(s) (UUID: 5283920058631409231) (system_impl.cpp:515)
Discovered system with UUID: 5283920058631409231
Calibrating accelerometer...
[05:35:25|Debug] MAVLink: info: [cal] calibration started: 2 accel (system_impl.cpp:280)
Progress: 0
[05:35:25|Debug] MAVLink: info: [cal] pending: back front left right up down (system_impl.cpp:280)
Instruction: pending: back front left right up down
[05:35:25|Debug] MAVLink: info: [cal] hold vehicle still on a pending side (system_impl.cpp:280)
Instruction: hold vehicle still on a pending side
[05:35:27|Debug] MAVLink: info: [cal] detected rest position, hold still... (system_impl.cpp:280)
Instruction: detected rest position, hold still...
[05:35:29|Debug] MAVLink: info: [cal] down orientation detected (system_impl.cpp:280)
Instruction: down orientation detected
[05:35:29|Debug] MAVLink: info: [cal] down orientation detected (system_impl.cpp:280)
Instruction: down orientation detected
[05:35:29|Debug] MAVLink: info: [cal] Hold still, measuring down side (system_impl.cpp:280)
Instruction: Hold still, measuring down side
[05:35:32|Debug] MAVLink: info: [cal] down side result: [ -0.2078 0.1541 -10.04 (system_impl.cpp:280)
Instruction: down side result: [ -0.2078 0.1541 -10.04
[05:35:32|Debug] MAVLink: info: [cal] progress <17> (system_impl.cpp:280)
Progress: 0.17
[05:35:32|Debug] MAVLink: info: [cal] down side done, rotate to a different side (system_impl.cpp:280)
Instruction: down side done, rotate to a different side
[05:35:32|Debug] MAVLink: info: [cal] down side done, rotate to a different side (system_impl.cpp:280)
Instruction: down side done, rotate to a different side
[05:35:32|Debug] MAVLink: info: [cal] pending: back front left right up (system_impl.cpp:280)
Instruction: pending: back front left right up
[05:35:32|Debug] MAVLink: info: [cal] hold vehicle still on a pending side (system_impl.cpp:280)
Instruction: hold vehicle still on a pending side
[05:35:35|Debug] MAVLink: info: [cal] detected rest position, hold still... (system_impl.cpp:280)
Instruction: detected rest position, hold still...
[05:35:36|Debug] MAVLink: info: [cal] down side already completed (system_impl.cpp:280)
Instruction: down side already completed
[05:35:36|Debug] MAVLink: info: [cal] pending: back front left right up (system_impl.cpp:280)
Instruction: pending: back front left right up
[05:35:36|Debug] MAVLink: info: [cal] hold vehicle still on a pending side (system_impl.cpp:280)
Instruction: hold vehicle still on a pending side
[05:35:39|Debug] MAVLink: info: [cal] detected rest position, hold still... (system_impl.cpp:280)
Instruction: detected rest position, hold still...
[05:35:40|Debug] MAVLink: info: [cal] down side already completed (system_impl.cpp:280)
Instruction: down side already completed
[05:35:40|Debug] MAVLink: info: [cal] pending: back front left right up (system_impl.cpp:280)
Instruction: pending: back front left right up
[05:35:40|Debug] MAVLink: info: [cal] hold vehicle still on a pending side (system_impl.cpp:280)
Instruction: hold vehicle still on a pending side
[05:35:43|Debug] MAVLink: info: [cal] detected rest position, hold still... (system_impl.cpp:280)
Instruction: detected rest position, hold still...
[05:35:44|Debug] MAVLink: info: [cal] down side already completed (system_impl.cpp:280)
Instruction: down side already completed
[05:35:44|Debug] MAVLink: info: [cal] pending: back front left right up (system_impl.cpp:280)
Instruction: pending: back front left right up
[05:35:44|Debug] MAVLink: info: [cal] hold vehicle still on a pending side (system_impl.cpp:280)
Instruction: hold vehicle still on a pending side
[05:35:47|Debug] MAVLink: info: [cal] detected rest position, hold still... (system_impl.cpp:280)
Instruction: detected rest position, hold still...
[05:35:49|Debug] MAVLink: info: [cal] down side already completed (system_impl.cpp:280)
Instruction: down side already completed
[05:35:49|Debug] MAVLink: info: [cal] pending: back front left right up (system_impl.cpp:280)
Instruction: pending: back front left right up
[05:35:49|Debug] MAVLink: info: [cal] hold vehicle still on a pending side (system_impl.cpp:280)
Instruction: hold vehicle still on a pending side
[05:35:52|Debug] MAVLink: info: [cal] detected rest position, hold still... (system_impl.cpp:280)
Instruction: detected rest position, hold still...
[05:35:53|Debug] MAVLink: info: [cal] down side already completed (system_impl.cpp:280)
Instruction: down side already completed
[05:35:53|Debug] MAVLink: critical: [cal] calibration failed: timeout: no motion (system_impl.cpp:280)
[05:35:53|Error] Calibration failed: timeout: no motion (calibration_impl.cpp:353)
--- Calibration failed with message: Failed
I would like to understand the reason for this error. Is it possible to reset the quadcopters in Gazebo???
I am getting accelerometer bias error after resetting the iris quad-copter in the simulator. Thus I thought about using the calibration to resolve the issue. However, I do not know if I should use the reboot function from the Action plugin is going to be better for the simulation
It looks like there was no motion. Did you actually follow the instructions and turn the board on all of it’s sides so it can calibrate all axes?
Edit:
Oh, I guess you’re doing this in SITL and you can’t actually turn the vehicle to calibrate it. We don’t usually calibrate in SITL, it’s pre-calibrated so to say.
I use Gazebo. IRIS, and SDK to control the quadcopters.
I use PX4 as Firmware
I simulate several quadcopters at the same time
I created a specific gazebo plugin to reset the quad copters to their original place after an episode of simulation. However, after the first reset for the quadcopters. I start getting this error, and the quadcopters refuse to arm
The only hack I found is to increase the allowed limit of the bias in the PX4 firmware. Otherwise nothing is working.
I have to wait about 10 seconds after resetting the drones to their initial position, in order to wait for accelerometer value to calm down. Otherwise If I try to takeoff the quadcopter directly after resetting their positions, each drone is going to takeoff with an angle towards a random direction.
By the way, I was getting accelerometer bias for the quadcopter (iris) with optical flow even before flying for the first time, I think there is something wrong of the calibration inside the firmware ().
EKF2 fuse the data from different sensors, in our case GPS with IMU. When adding the optical flow, the bias increased naturally without any modification.
We need more documentation about the firmware, it takes a lot of time to understand what is happening. We need also to update the existing documentation in the user and developer section for the firmware.
One point to add, the reboot() command inside the px4 software is not working during the simulation. Why??
Is there any possibility to have commands auto-complete functionality inside the Px4 shell, Or some kind of man pages to help users understanding the reason behind each command. What do they do ?? What are their semantics?
Please feel free to contribute to the Devguide when you find out things that are missing. Help is always appreciated.
Probably because no one needed it yet, and because it’s not trivial to add.
Feel free to implement it here:
You would have to implement the restart somewhere here, basically you would invoke a shutdown and then just before main() exits you would have to go back to the beginning: