Indoor flying


I am new in drone technology and I apologize in advance if I will ask stupid question.

  1. I have pixracer attached at Robocat 270 and I would like fly it inside of building (laboratory room). Because of metal construction of the building, magnetic fields are not constant. Is there a possibility that I could disable both magnetometers? Otherwise I am having funky behavior when drone is at stabilized/altitude mode.

  2. If I am able to disable magnetometers, is there a change that altitude control could work? I would need to manually take off the drone and switch to offboard mode. After that things would run through mavros and opto-tracker for positioning control.

Not sure if it is proper solution, but putting ATT_W_MAG = 0 should disable magnetometer. I also putted value to 0.5 and drone yaws like crazy (inside of laboratory). For now I just tested at Altitude Control mode.

I will try to explain in my understanding.
The indoor environment does have a bad infect on the mag sensor. I guess you are using attitude_estimator_q module, for you have ATT_W_MAG. If ATT_W_MAG is 0, it means that mag would not correct the heading estimation of the drone. However, the estimation is still going with the gyro to predict the heading. So normally the heading will rotates at a low speed while on the ground. Another issue is that, while initialization, the initial heading is decided by the mag. In my case, this weight cannot be larger than 0.05 or so, since mag also has noise. This is all about attitude estimation, which only directly affects attitude control. If you want to disable the mag, I think you can directly comment the publish part in the IMU driver.

Do you have any idea how to do this?

Since I do not know which IMU you are using, so I can only give you an example.
If you are using MPU9250, then it is here:
I recommend you double check any changes related to this before comment this.
Good luck:)

I was able to connect QGC, Mavros and Pixracer via UDP protocol. Instead of GPS, I am using optotrak for estimating drone position and sending output to /mavros/mocap/pose. I am still playing with settings in QGC, but when optotrak is connected, I am getting bad oscillations of height estimations. Here is a short recording of RVIZ (red is optotrak output, blue is Pixracer estimation)

Here are logs from flying, firstly altctl mode with enabled optotrack

and here altctl mode with disabled optotrack

Here are also outputs from preflight/postflight documents

Does somebody have idea how to fix this oscillations or why are happening? Maybe barometer produce this error?

I am using this settings for connecting QGC, Mavros and Pixracer:

<arg name="fcu_url" default="udp://:14550@" />
<arg name="gcs_url" default="udp://@" />

I also disabled auto-discovery for UDP protocol at QGC and added new Comm Link instead. Unfortunately I am getting a lot of errors which recently summed also in few crashes…

[ERROR] [1464458497.236723113]: FCU: MANUAL CONTROL LOST (at t=720171ms)
[ INFO] [1464458497.389392135]: FCU: MANUAL CONTROL REGAINED after 600ms
[ERROR] [1464458497.853809756]: FCU: MANUAL CONTROL LOST (at t=720772ms)
[ INFO] [1464458497.935792076]: FCU: MANUAL CONTROL REGAINED after 576ms
[ERROR] [1464458498.882454749]: FCU: MANUAL CONTROL LOST (at t=721839ms)
[ INFO] [1464458499.041397995]: FCU: MANUAL CONTROL REGAINED after 663ms
[ERROR] [1464458499.592804957]: FCU: MANUAL CONTROL LOST (at t=722493ms)
[ INFO] [1464458499.675167709]: FCU: MANUAL CONTROL REGAINED after 539ms
[ERROR] [1464458500.069837862]: FCU: MANUAL CONTROL LOST (at t=723024ms)
[ INFO] [1464458500.230614100]: FCU: MANUAL CONTROL REGAINED after 629ms

Any idea how to connect differently or how to find reason why is this happening?

After few crashes we decided to ditch a ESP8266 WiFi module. We connected Pixracer with Odroid XU4 via UART protocol. We are testing offboard control and somehow height estimation does not work correctly. Either drone is too high or too low. Green color is reference point, red is position from mocap and yellow is drone estimation. One flight was made yesterday evening and one today in the morning, between that we did not change parameters.

Also, when drone reaches the XY position it is oscillating around the reference point. How we could solve this problem? Should I tweak parameters in position control tuning or general PID tunning?

I Have same problem, is somebody solve it ?