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

Update copter_takeoff.py #28946

Closed
wants to merge 1 commit into from
Closed

Conversation

YongxueLiu
Copy link

add a not before is_ascending_to_takeoff_alt

@Ryanf55 Ryanf55 added the ROS label Dec 28, 2024
@Ryanf55
Copy link
Collaborator

Ryanf55 commented Dec 30, 2024

@tizianofiorenzani Thoughts?

@@ -165,7 +165,7 @@ def main(args=None):

is_ascending_to_takeoff_alt = node.get_cur_geopose().pose.position.altitude < TAKEOFF_ALT

if is_ascending_to_takeoff_alt:
if not is_ascending_to_takeoff_alt:
Copy link
Contributor

Choose a reason for hiding this comment

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

is_ascending_to_takeoff_alt need to be false to exit the while loop. and false mean that we are >= TAKEOFF_ALT and that is what we want.

So this patch is wrong

@Ryanf55
Copy link
Collaborator

Ryanf55 commented Dec 30, 2024

I tested this, as soon as the copter arms, the script exits. It hasn't achieved the takeoff altitude.

ros2 launch ardupilot_sitl sitl_dds_udp.launch.py
python3 copter_takeoff.py 
[INFO] [1735588139.197570929] [copter_takeoff]: From AP : Geopose [sec:1735588138, nsec: 808770000]
[INFO] [1735588140.199427570] [copter_takeoff]: From AP : Geopose [sec:1735588139, nsec: 813368000]
[INFO] [1735588141.208486093] [copter_takeoff]: From AP : Geopose [sec:1735588140, nsec: 822131000]
[INFO] [1735588141.215702203] [copter_takeoff]: From AP : Geopose [sec:1735588140, nsec: 857117000]
[INFO] [1735588142.217510642] [copter_takeoff]: From AP : Geopose [sec:1735588141, nsec: 854218000]
[INFO] [1735588143.225571754] [copter_takeoff]: From AP : Geopose [sec:1735588142, nsec: 845488000]
[INFO] [1735588144.233773105] [copter_takeoff]: From AP : Geopose [sec:1735588143, nsec: 871748000]
[INFO] [1735588145.242969200] [copter_takeoff]: From AP : Geopose [sec:1735588144, nsec: 851356000]
[INFO] [1735588145.245269012] [copter_takeoff]: From AP : Geopose [sec:1735588144, nsec: 886342000]
[INFO] [1735588146.252197977] [copter_takeoff]: From AP : Geopose [sec:1735588145, nsec: 871781000]
[INFO] [1735588147.260882087] [copter_takeoff]: From AP : Geopose [sec:1735588146, nsec: 874713000]

@Ryanf55 Ryanf55 closed this Dec 30, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

3 participants