You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I recently encountered a very strange bug in dircon.cc. When adding the impact constraint when their is not impact (pre_impact_velocity == post_impact_velocity) the code will segfault (Line 252). This does not seem to happen for every robot (planar walker is fine), but it does effect both Spirit and Cassie.
I found that changing line 249/250 from: auto pre_impact_velocity = state_vars(i_mode - 1, pre_impact_index) .tail(plant_.num_velocities());
to: auto pre_impact_state = state_vars(i_mode - 1, pre_impact_index); auto pre_impact_velocity = pre_impact_state.tail(plant_.num_velocities());
Fixes the issue. I don't understand why this fixes the issue because at a glance the code should do the same thing.
Declaring pre_impact_velocity as auto makes it type Eigen::Block and declaring it as a VectorXDecisionVariable makes it type Eigen::PlainObjectBase. The Eigen::Block declaration seems to cause issues in the drake symbolic formula.
I recently encountered a very strange bug in
dircon.cc
. When adding the impact constraint when their is not impact (pre_impact_velocity == post_impact_velocity) the code will segfault (Line 252). This does not seem to happen for every robot (planar walker is fine), but it does effect both Spirit and Cassie.I found that changing line 249/250 from:
auto pre_impact_velocity = state_vars(i_mode - 1, pre_impact_index) .tail(plant_.num_velocities());
to:
auto pre_impact_state = state_vars(i_mode - 1, pre_impact_index);
auto pre_impact_velocity = pre_impact_state.tail(plant_.num_velocities());
Fixes the issue. I don't understand why this fixes the issue because at a glance the code should do the same thing.
Here is a branch where
examples/Spirit:run_spirit_jump
fails due to this bug: https://github.com/KodlabPenn/dairlib/tree/dircon_segfault_post_impact_vel_demoThe text was updated successfully, but these errors were encountered: