Indoor flight with external navigation data

@chobitsfan: I will be using a clip from your video for an intro. Is it ok for you?

hi @tiffo: Sure, it is shared in Creative Commons

1 Like

I’ve tested this motion capture setup. For me it is working well as expected, but only if origin is set with SET_GPS_GLOBAL_ORIGIN, otherwise not only I can’t use guided or auto mode but I can’t read the position anywhere in telemetry or logs.

I’ve encountered a few issues (more relate to position controller) with my copter explained here with video and log. Maybe you know how to deal with them :slight_smile:

@chobitsfan, I’ve created this PR over in mavros to enable the mocap_pose_estimate plugin for ArduPilot by default. This is the right thing to do right?

1 Like

hi @rmackay9 That is really helpful! Thank you very much :slight_smile:

I test both bebop2 and skyviper v2450. running ardupilot master, in the same motion capture system setup. It is strange that bebop2 is more stable than skyviper. Skyviper seems a little toilet bowl which is not possible because I do not use compass

bebop2_indoor.BIN (595.7 KB)

skyviper_indoor.BIN (829.1 KB)

3 Likes

Thats fantastic @chobitsfan. I am trying to do the exact same thing for my skyviper drone using Aruco markers but so far I have been unsuccessful. Can you please tell me what parameters you use?

Here is my issue: Using Vision Position Estimate for Skyviper-v2450 running ArduCopter-3.7-dev

My skyviper oscillates up and down and constantly gives warning that battery is low(even if it’s not)! And then climbs up to hit the roof. I don’t understand this behavior.

Do you set the take off height? And what mode are you in when you take off? I keep my drone in guided mode but when I keep a takeoff command it probably switches to loiter. It doesn’t even takeoff to the commanded altitude/height. It just takes off, drifts a bit and then climbs up to hit the roof. I will post a video later.

@kkojima, nice video. What do you refer to when you say “poor man’s indoor positioning system”? Does it refer to aruco markers or april tags?

I’m using high bright LEDs as markers

which can give a few point images only. The positioning system uses them and the roll&pitch data from ardupilot to estimate the heading and position:

2 Likes

@kkojima that’s amazing!

Hey @chobitsfan, which firmware are you running on your skyviper? Does it show the warning that battery is low(even if it’s not!) when you fly it?

I run current master (3.7-dev) on my skyviper. Since I fly indoor, I usually ignore battery warning

1 Like

@chobitsfan, How do you fly your skyviper? Do you give it a setpoint to track or you just give it a takeoff signal? And which mode are you in when you are flying your skyviper using motion capture? Is it guided mode or loiter mode?

@chobitsfan, can you please share with me the parameter list you used for flying skyviper with motion capture data?

After applying #9485 and #9505 and fine tune some PID. loiter performance is better now, about ~10cm

code branch used is https://github.com/chobitsfan/ardupilot/tree/cur_indoor_test2

@Subodh_Mishra this is my parameters for skyviper v2450 skyviper_extnav.parm (22.9 KB)

4 Likes

Thank you so much. I will look it up.

@chobitsfan, I get the following errors while building your firmware:

../../ArduCopter/toy_mode.cpp: In member function 'void ToyMode::update()':
../../ArduCopter/toy_mode.cpp:209:24: error: 'class AP_MotorsHeli' has no member named 'set_thrust_compensation_callback'
         copter.motors->set_thrust_compensation_callback(FUNCTOR_BIND_MEMBER(&ToyMode::thrust_limiting, void, float *, uint8_t));
                        ^
compilation terminated due to -Wfatal-errors.

[541/985] Compiling ArduCopter/esc_calibration.cpp
Waf: Leaving directory `/home/subodh/github-projects/chobitsfan/ardupilot/build/skyviper-v2450-px4'
Build failed

Any suggestions to make this work?

I manually made the changes mentioned in the pull request https://github.com/ArduPilot/ardupilot/pull/9485 to the arducopter repo I am using and the build was successful. Is it necessary to implement the changes made in the second pull request you have mentioned here? I don’t think it is necessary because I am not using any vision based speed data.

I don’t think it is necessary because I am not using any vision based speed data.

Sure

1 Like

Hey @chobitsfan,

Thank you for sharing your work. I am also trying to use Optitrack data for indoor flight. Here is my setup:
Optitrack - Flex 13 Cameras
Motive 2.1
NatNet based software >> wifi >>
Raspberry Pi 3 >> Serial >> Telemetry 2 port
Pixhawk - ArduCopter 3.6.1
Custom Built Quad

I am Using (dronekit and pymavlink) libraries on Raspberry Pi and use ( att_pos_mocap_send ) function to send orientation and location data to pixhawk. Now here is my problem:

  1. Although I see the message “EKF2 IMU0 is using external nav data” and “EKF2 IMU0 ext nav yaw alignment complete” and “EKF2 IMU0 initial pos NED = 1.0,51.0,26.0 (m)” on Mission planner (connected via Telemetry 1), Lat, Lon, and Alt values do not change. It looks like that the values that I send are ignored by autopilot. (I made sure that the GPS_Type is 3 and COMPASS_USE is 0 - I even downloaded your params and uploaded them on my pixhawk, same result!) Interestingly, my Yaw value initially changes to the value given by RPI but then if I rotate the quad it will change!! I have no idea what should I do.

  2. I do not want to update Pitch and Roll values with optitrack values. Is there any setting that I just update yaw, x, y, z values and let internal IMU update pitch and roll?

I really appreciate if you (or anyone else familiar with the subject) can help me.

Thank you,
Niki

Lat, Lon, and Alt values do not change.

You may need to use SET_GPS_GLOBAL_ORIGIN to set lat, lon of EKF origin (any valid lat, lon will do)