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 throttle_ramp_time parameter #13154

Merged
merged 1 commit into from
Oct 14, 2019
Merged

Conversation

jinchengde
Copy link
Contributor

add throttle_ramp_time parameter support fixed wing runway takeoff #13146

Copy link
Member

@bresch bresch left a comment

Choose a reason for hiding this comment

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

LGTM, just remove those overly protective brackets, priority of operations isn't ambiguous here.

@@ -195,7 +194,7 @@ float RunwayTakeoff::getThrottle(float tecsThrottle)
{
switch (_state) {
case RunwayTakeoffState::THROTTLE_RAMP: {
float throttle = hrt_elapsed_time(&_initialized_time) / (float)_throttle_ramp_time *
float throttle = (hrt_elapsed_time(&_initialized_time) / ((float)_param_rwto_ramp_time.get() * 1e6f)) *
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
float throttle = (hrt_elapsed_time(&_initialized_time) / ((float)_param_rwto_ramp_time.get() * 1e6f)) *
float throttle = hrt_elapsed_time(&_initialized_time) / (float)_param_rwto_ramp_time.get() * 1e6f *

Copy link
Contributor Author

Choose a reason for hiding this comment

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

ok, I will

@@ -79,7 +78,7 @@ void RunwayTakeoff::update(float airspeed, float alt_agl,

switch (_state) {
case RunwayTakeoffState::THROTTLE_RAMP:
if (hrt_elapsed_time(&_initialized_time) > _throttle_ramp_time) {
if (hrt_elapsed_time(&_initialized_time) > (_param_rwto_ramp_time.get() * 1e6f)) {
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
if (hrt_elapsed_time(&_initialized_time) > (_param_rwto_ramp_time.get() * 1e6f)) {
if (hrt_elapsed_time(&_initialized_time) > _param_rwto_ramp_time.get() * 1e6f) {

@jinchengde jinchengde force-pushed the pr-throttle_ramp_time branch 2 times, most recently from ef43a8c to 3bc88b1 Compare October 13, 2019 01:51
add throttle_ramp_time parameter support fixed wing runway takeoff PX4#13146
remove overly protective brackets
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants