Skip to content

Commit

Permalink
[bugfix] Fixed set_reference in state residual
Browse files Browse the repository at this point in the history
  • Loading branch information
cmastalli committed Aug 11, 2023
1 parent 0eae0de commit 783f558
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions include/crocoddyl/multibody/residuals/state.hxx
Original file line number Diff line number Diff line change
Expand Up @@ -147,11 +147,11 @@ ResidualModelStateTpl<Scalar>::get_reference() const {

template <typename Scalar>
void ResidualModelStateTpl<Scalar>::set_reference(const VectorXs& reference) {
if (static_cast<std::size_t>(reference.size()) != nr_) {
if (static_cast<std::size_t>(reference.size()) != state_->get_nx()) {
throw_pretty("Invalid argument: "
<< "the state reference has wrong dimension ("
<< reference.size()
<< " provided - it should be " + std::to_string(nr_) + ")")
<< " provided - it should be " + std::to_string(state_->get_nx() + ")")
}
xref_ = reference;
}
Expand Down

0 comments on commit 783f558

Please sign in to comment.