@@ -64,7 +64,8 @@ namespace controllers {
6464
6565OSCRunningControllerDiagram::OSCRunningControllerDiagram (
6666 drake::multibody::MultibodyPlant<double >& plant,
67- const string& osc_running_gains_filename, const string& osqp_settings_filename)
67+ const string& osc_running_gains_filename,
68+ const string& osqp_settings_filename)
6869 : plant_(&plant),
6970 pos_map (multibody::MakeNameToPositionsMap(plant)),
7071 vel_map(multibody::MakeNameToVelocitiesMap(plant)),
@@ -155,19 +156,20 @@ OSCRunningControllerDiagram::OSCRunningControllerDiagram(
155156 auto state_receiver = builder.AddSystem <systems::RobotOutputReceiver>(plant);
156157 auto command_sender = builder.AddSystem <systems::RobotCommandSender>(plant);
157158 auto osc = builder.AddSystem <systems::controllers::OperationalSpaceControl>(
158- plant, plant, plant_context. get (), plant_context.get (), true );
159+ plant, plant_context.get (), true );
159160 auto radio_parser = builder.AddSystem <systems::RadioParser>();
160161 auto failure_aggregator =
161162 builder.AddSystem <systems::ControllerFailureAggregator>(
162163 control_channel_name_, 1 );
163164
164165 /* *** OSC setup ****/
165166 // / REGULARIZATION COSTS
166- osc->SetAccelerationCostWeights (osc_running_gains.w_accel * osc_running_gains.W_acceleration );
167+ osc->SetAccelerationCostWeights (osc_running_gains.w_accel *
168+ osc_running_gains.W_acceleration );
167169 osc->SetInputSmoothingCostWeights (osc_running_gains.w_input_reg *
168- osc_running_gains.W_input_regularization );
170+ osc_running_gains.W_input_regularization );
169171 osc->SetInputCostWeights (osc_running_gains.w_input *
170- osc_running_gains.W_input_regularization );
172+ osc_running_gains.W_input_regularization );
171173 osc->SetLambdaContactRegularizationWeight (
172174 osc_running_gains.w_lambda * osc_running_gains.W_lambda_c_regularization );
173175 osc->SetLambdaHolonomicRegularizationWeight (
@@ -179,14 +181,22 @@ OSCRunningControllerDiagram::OSCRunningControllerDiagram(
179181 // Contact information for OSC
180182 osc->SetContactFriction (osc_running_gains.mu );
181183
182- osc->AddStateAndContactPoint (RunningFsmState::kLeftStance ,
183- &left_toe_evaluator);
184- osc->AddStateAndContactPoint (RunningFsmState::kLeftStance ,
185- &left_heel_evaluator);
186- osc->AddStateAndContactPoint (RunningFsmState::kRightStance ,
187- &right_toe_evaluator);
188- osc->AddStateAndContactPoint (RunningFsmState::kRightStance ,
189- &right_heel_evaluator);
184+ osc->AddContactPoint (" left_toe" ,
185+ std::unique_ptr<multibody::WorldPointEvaluator<double >>(
186+ &left_toe_evaluator),
187+ {RunningFsmState::kLeftStance });
188+ osc->AddContactPoint (" left_heel" ,
189+ std::unique_ptr<multibody::WorldPointEvaluator<double >>(
190+ &left_heel_evaluator),
191+ {RunningFsmState::kLeftStance });
192+ osc->AddContactPoint (" right_toe" ,
193+ std::unique_ptr<multibody::WorldPointEvaluator<double >>(
194+ &right_toe_evaluator),
195+ {RunningFsmState::kRightStance });
196+ osc->AddContactPoint (" right_heel" ,
197+ std::unique_ptr<multibody::WorldPointEvaluator<double >>(
198+ &right_heel_evaluator),
199+ {RunningFsmState::kRightStance });
190200
191201 // Fix the springs in the dynamics
192202 evaluators.add_evaluator (&left_fixed_knee_spring);
@@ -196,8 +206,9 @@ OSCRunningControllerDiagram::OSCRunningControllerDiagram(
196206 evaluators.add_evaluator (&left_loop);
197207 evaluators.add_evaluator (&right_loop);
198208
199-
200- osc->AddKinematicConstraint (&evaluators);
209+ osc->AddKinematicConstraint (
210+ std::unique_ptr<const multibody::KinematicEvaluatorSet<double >>(
211+ &evaluators));
201212
202213 /* *** Tracking Data *****/
203214
@@ -208,8 +219,8 @@ OSCRunningControllerDiagram::OSCRunningControllerDiagram(
208219 osc_running_gains.vel_scale_trans_lateral );
209220
210221 auto pelvis_trans_traj_generator =
211- builder.AddSystem <PelvisTransTrajGenerator>(
212- plant, plant_context. get (), feet_contact_points);
222+ builder.AddSystem <PelvisTransTrajGenerator>(plant, plant_context. get (),
223+ feet_contact_points);
213224 pelvis_trans_traj_generator->SetSLIPParams (
214225 osc_running_gains.rest_length , osc_running_gains.rest_length_offset );
215226 auto l_foot_traj_generator = builder.AddSystem <FootTrajGenerator>(
@@ -261,8 +272,8 @@ OSCRunningControllerDiagram::OSCRunningControllerDiagram(
261272 right_foot_tracking_data->AddStateAndPointToTrack (
262273 RunningFsmState::kLeftFlight , " toe_right" );
263274
264- left_foot_tracking_data->AddStateAndPointToTrack (
265- RunningFsmState:: kLeftFlight , " toe_left" );
275+ left_foot_tracking_data->AddStateAndPointToTrack (RunningFsmState:: kLeftFlight ,
276+ " toe_left" );
266277 right_foot_tracking_data->AddStateAndPointToTrack (
267278 RunningFsmState::kRightFlight , " toe_right" );
268279
@@ -274,17 +285,17 @@ OSCRunningControllerDiagram::OSCRunningControllerDiagram(
274285 " right_hip_traj" , osc_running_gains.K_p_swing_foot ,
275286 osc_running_gains.K_d_swing_foot , osc_running_gains.W_swing_foot , plant,
276287 plant);
277- left_hip_tracking_data->AddStateAndPointToTrack (
278- RunningFsmState:: kRightStance , " pelvis" );
279- right_hip_tracking_data->AddStateAndPointToTrack (
280- RunningFsmState:: kLeftStance , " pelvis" );
281- right_hip_tracking_data->AddStateAndPointToTrack (
282- RunningFsmState:: kLeftFlight , " pelvis" );
283- left_hip_tracking_data->AddStateAndPointToTrack (
284- RunningFsmState:: kRightFlight , " pelvis" );
285-
286- left_hip_tracking_data->AddStateAndPointToTrack (
287- RunningFsmState:: kLeftFlight , " pelvis" );
288+ left_hip_tracking_data->AddStateAndPointToTrack (RunningFsmState:: kRightStance ,
289+ " pelvis" );
290+ right_hip_tracking_data->AddStateAndPointToTrack (RunningFsmState:: kLeftStance ,
291+ " pelvis" );
292+ right_hip_tracking_data->AddStateAndPointToTrack (RunningFsmState:: kLeftFlight ,
293+ " pelvis" );
294+ left_hip_tracking_data->AddStateAndPointToTrack (RunningFsmState:: kRightFlight ,
295+ " pelvis" );
296+
297+ left_hip_tracking_data->AddStateAndPointToTrack (RunningFsmState:: kLeftFlight ,
298+ " pelvis" );
288299 right_hip_tracking_data->AddStateAndPointToTrack (
289300 RunningFsmState::kRightFlight , " pelvis" );
290301
0 commit comments