Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add new flight mode: Airspeed (only for fixed-wing flight) - continued #18419

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

Jaeyoung-Lim
Copy link
Member

@Jaeyoung-Lim Jaeyoung-Lim commented Oct 12, 2021

Describe problem solved by this pull request
#17924 continued with the new structure of #18340 included

Test data / coverage

  • Tested in SITL Gazebo
make px4_sitl gazebo_plane

Additional context

@Jaeyoung-Lim
Copy link
Member Author

@dagar Is there something wrong with caching on github actions? This PR builds and runs on my local machine, but somehow fails on github actions

@dagar
Copy link
Member

dagar commented Oct 13, 2021

@dagar Is there something wrong with caching on github actions? This PR builds and runs on my local machine, but somehow fails on github actions

I hope not, but I'll take a look...

@dagar
Copy link
Member

dagar commented Oct 14, 2021

I'm seeing the same build failures locally.
Screen Shot 2021-10-13 at 9 20 51 PM

@Jaeyoung-Lim
Copy link
Member Author

@dagar It took a while that that header was being generated and I was editing a generated file. Sorry about the confusion

@Jaeyoung-Lim Jaeyoung-Lim changed the title [WIP] Add new flight mode: Airspeed (only for fixed-wing flight) - continued Add new flight mode: Airspeed (only for fixed-wing flight) - continued Oct 14, 2021
@Jaeyoung-Lim
Copy link
Member Author

Rebased due to conflict

@kaklik
Copy link
Contributor

kaklik commented Nov 7, 2021

Hi! This new flight mode is actually what I looking for in the case of an unpowered flight. Would be nice, if it could be merged soon.
Thanks.

@Jaeyoung-Lim
Copy link
Member Author

@kaklik We need a flight test for this to be merged. Would you be interested on testing this?

@@ -16,7 +16,8 @@ uint8 MAIN_STATE_AUTO_LAND = 11
uint8 MAIN_STATE_AUTO_FOLLOW_TARGET = 12
uint8 MAIN_STATE_AUTO_PRECLAND = 13
uint8 MAIN_STATE_ORBIT = 14
uint8 MAIN_STATE_MAX = 15
uint8 MAIN_STATE_AIRSPEED = 15
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Steal the legacy rattitude slot?

Signed-off-by: Silvan Fuhrer <silvan@auterion.com>
@kaklik
Copy link
Contributor

kaklik commented Nov 7, 2021

@kaklik We need a flight test for this to be merged. Would you be interested on testing this?

Yes, but to clarify the situation. I want to use it with the autogyro. Therefore I am unable to test it with "fixed-wing" exactly.

@roman-dvorak
Copy link
Contributor

roman-dvorak commented Nov 7, 2021

Hi @Jaeyoung-Lim, I think we are able to do such a flight test with our TF-G2 autogyro. (TF-G2 is currently controlled by FW controllers)

We would need a few things to do that:

  • Resolve new conflicts against to the current master version
  • Tell me how to run this mode .. Is it already supported by QGC? Or do we have to send our own mavlink message that switches flight mode?
  • Are there any specific requirements for such test?

@@ -527,6 +537,10 @@ bool set_nav_state(vehicle_status_s &status, actuator_armed_s &armed, commander_
status.nav_state = vehicle_status_s::NAVIGATION_STATE_STAB;
break;

case commander_state_s::MAIN_STATE_AIRSPEED:
status.nav_state = vehicle_status_s::NAVIGATION_STATE_AIRSPEED;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we only allow entering this mode if airspeed is currently valid?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we should yes, it's of no use in case of invalid airspeed.
We can also think about using it as failsafe mode from Altitude mode in case of invalid altitude estimation.

@roman-dvorak
Copy link
Contributor

Hi, I assume the line 2272 should be bool in_air_use_tecs = ...?

/* tell TECS to update its state, but let it know when it cannot actually control the plane */
bool in_air_alt_control = (!_landed &&
(_control_mode.flag_control_auto_enabled ||
_control_mode.flag_control_velocity_enabled ||
_control_mode.flag_control_altitude_enabled ||
_control_mode.flag_control_climb_rate_enabled ||
_control_mode.flag_control_airspeed_enabled));
/* update TECS vehicle state estimates */
_tecs.update_vehicle_state_estimates(_airspeed, _body_acceleration(0), (_local_pos.timestamp > 0), in_air_use_tecs,
_current_altitude, _local_pos.vz);

@roman-dvorak
Copy link
Contributor

roman-dvorak commented Nov 10, 2021

Hi @Jaeyoung-Lim we plan to do some flight tests tomorrow. And we could test this airspeed mode.

But I can't enter intu airspeed mod in simulator (in FlightGear). Specifically, it was this commit

I tried to takeoff in the simulator and do the command in flight:

pxh> 
pxh> commander mode airspeed
pxh> main_ret: -1
INFO  [tone_alarm] notify negative

Snímek z 2021-11-10 21-41-50

How I can enter into flight mode?

@roman-dvorak
Copy link
Contributor

roman-dvorak commented Dec 4, 2021

Hi, we made two successful attempts with airspeed mode. Booth tests were done with TF-G2 autogyro.

First try

There was a logging issue on the first try. So we don't have a log.

It was very interesting to control such a setting and it gave the dron completely different properties. For certain flights, such flight mode certainly make sense. Switching to this mode was done from the command line with the command commander mode airspeed.
The flight in this mode lasted over 10 minutes and several horizontal flights were performed, several climbing to higher altitudes and subsequent gliding without motor was done. No unexpected behaviour was observed during the flight. Drone is quite "action" and adroit in it.

Second try

During the test, we wanted to do more partial tests (because it was a long time after which we have a log) for example, automatic autogyro takeoff (#18582) and other test verifying the new properties of the autogyro. Therefore, the flight in airspeed mode was short. It was twice a climb and a motorless descend.

No problem with airspeed was observed this time either. And the controls were pretty good.

log: https://review.px4.io/plot_app?log=be4b0ce6-b51c-4826-907d-f980df96fbc1
(This is the first flight in a long time, from which we have a proper log :) )

I noticed strange things in the log, that the use of RAM at the time of switching to airspeed mode has increased a bit.
obrazek

Next usage

In the near future, we would like to use this flight mode to launch our TF-G2 autogyro from a stratospheric balloon. Without a motor. This mode will be suitable for such an experiment.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants