@@ -35,7 +35,7 @@ pub struct CreationContext {
3535pub struct CycleContext {
3636 leg_balancing_factor :
3737 Parameter < nalgebra:: Vector2 < f32 > , "stand_up_sitting_slow.leg_balancing_factor" > ,
38-
38+ speed_factor : Parameter < f32 , "stand_up_sitting_slow.speed_factor" > ,
3939 condition_input : Input < ConditionInput , "condition_input" > ,
4040 cycle_time : Input < CycleTime , "cycle_time" > ,
4141 motion_selection : Input < MotionSelection , "motion_selection" > ,
@@ -71,14 +71,19 @@ impl StandUpSittingSlow {
7171 let estimated_remaining_duration = if context. motion_selection . current_motion
7272 == MotionType :: StandUpSittingSlow
7373 {
74- let last_cycle_duration = context. cycle_time . last_cycle_duration / 2 ;
74+ let last_cycle_duration = context
75+ . cycle_time
76+ . last_cycle_duration
77+ . div_f32 ( * context. speed_factor ) ;
7578 let condition_input = context. condition_input ;
7679
7780 self . interpolator
7881 . advance_state ( & mut self . state , last_cycle_duration, condition_input) ;
7982
8083 RemainingStandUpDuration :: Running (
81- self . interpolator . estimated_remaining_duration ( self . state ) * 2 ,
84+ self . interpolator
85+ . estimated_remaining_duration ( self . state )
86+ . mul_f32 ( * context. speed_factor ) ,
8287 )
8388 } else {
8489 self . state . reset ( ) ;
0 commit comments