Yes, but this settings pattern works for ArduCopter V3.6-dev
May I know why using EKF3 instead of EKF2 while optical flow was enabled?
Just like Copter, the EKF do have releases, so EKF3 is the last release, and this is why you need it as primary state estimator in order to acces to the new features.
Thank you all for this discussion. I want to do the same and make the copter use rangefinder sensor and px4flow to control its altitude and position and control everything in the code using MAVLink.
As I understand from the discussion, It is possible to use that sensors in Guided mode after setting the value of the parameters.
You mentioned above that I have to “Set home here” before working. If the GPS is disabled, how can I do that? I mean I checked the MAV_CMD_DO_SET_HOME command and it need Latitude and Longitude but if the GPS is disable how can I solve it?
I tried using SITL (APM:Copter V3.6-dev (3852427e)) to arm and takeoff in loiter mode but the drone did not take off. Is that the correct behaviour or that issue is just in the simulator?
Is there any updates about this issue in general I have to take care about?
Again, Thank you very much
To set home, you right click on Mission Planner Map or on SITL
To take off you need to arm and set motor speed == rc 3 1500 (or more)
Here also the log file :https://www.dropbox.com/s/qf…/00003-2017-04-22_00-56-25.bin…
Is the result is good? I noticed that the body and Gyro are close to each other.
Can I now try a short and simple test in loiter mode or I have to do more checks?
@SoubhiOptecks just like I wrote on FB; FlowY need more gain, adjust FLOW_FYSCALER
Then you can give it a try, my mode switch is Stabilize-Alt-Hold-Loiter, I used to test through this sequence, so get ready to switch back to alt-hold if the quad start drifting weird.
Also make sure the focus is adjusted to the testing altitude and that you have good ground texture.
Hi @ppoirier, @dollop,
I found very interesting the problem you solved here, because is the same that I’m faceing during these weeks.
I would like to make my copter fly indoor using a rangefinder (MaxSonar EZ4) and the Pix4Flow. The problem is that with all the options set as you described, the result of my script is that in Guided No GPS mode the motors do not rotate.
Giving the take off command from the mission planner the copter completes the take off correctly.
Another try was to give the thrust to the copter until it reaches the corret height and then switch the mode to loiter. But once reached the correct height the copter chenges mode to loiter and falls down.
Outdoor the copter is stable and easy to control with mission planner, in order to move through way points.
If it could help, this is my configuration :
param.param (13.5 KB)
And this is the script that I’m using to take off:
def arm_and_simple_takeoff(Target, vehicle):
my_location_alt = vehicle.location.global_frame my_location_alt.alt = 0 vehicle.home_location = my_location_alt print 'ENTERING LOITER MODE' while not vehicle.mode == 'LOITER': vehicle.mode = VehicleMode("LOITER") time.sleep(0.05) print 'LOITER MODE SET' vehicle.armed = True vehicle.flush() while not vehicle.armed: time.sleep(1) # Waiting for armed vehicle.simple_takeoff(Target) # Wait until the vehicle reaches a safe height before processing the goto (otherwise the command # after Vehicle.simple_takeoff will execute immediately). while True: print " Altitude: ", vehicle.location.global_relative_frame.alt # Break and return from function just below target altitude. if vehicle.location.global_relative_frame.alt >= Target * 0.95: print "Reached target altitude" break time.sleep(1)
Can you help me to solve the problem. Thank you in advance.
I have done new trials today. After that I noticed I was not sending the RC override  = 1500, I added this command to my script but nothing changed.
I don’t understand why but it rotates with few rpm anyway stopping its motion after 4 - 5 seconds.
So I tried to send the command
msg = vehicle.message_factory.set_attitude_target_encode(
0, # target system
0, # target component
0b00000000, # type mask: bit 1 is LSB
to_quaternion(roll_angle, pitch_angle), # q
0, # body roll rate in radian
0, # body pitch rate in radian
math.radians(yaw_rate), # body yaw rate in radian
With roll = pitch = yaw = 0 and thrust = 0.7. In this way my copter takes off but I don’t understand why I can’t do it with simple_takeoff function.