Skip to content

Commit

Permalink
[python] Included setter for nu + updated changelog
Browse files Browse the repository at this point in the history
  • Loading branch information
cmastalli committed Dec 4, 2023
1 parent 0d723a1 commit 11c10cb
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 3 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).

## [Unreleased]

* Added nu, ng, and nh setters for Python bindings in https://github.com/loco-3d/crocoddyl/pull/1192

## [2.0.2] - 2023-11-30

* Added CHANGELOG.md in https://github.com/loco-3d/crocoddyl/pull/1188
Expand Down
7 changes: 5 additions & 2 deletions bindings/python/crocoddyl/core/action-base.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -116,8 +116,11 @@ void exposeActionAbstract() {
.def("quasiStatic", &ActionModelAbstract_wrap::quasiStatic,
&ActionModelAbstract_wrap::default_quasiStatic,
bp::args("self", "data", "u", "x", "maxiter", "tol"))
.add_property("nu", bp::make_function(&ActionModelAbstract_wrap::get_nu),
"dimension of control vector")
.add_property(
"nu", bp::make_function(&ActionModelAbstract_wrap::get_nu),
bp::make_setter(
&ActionModelAbstract_wrap::nu_,
bp::return_internal_reference<>()) "dimension of control vector")
.add_property("nr", bp::make_function(&ActionModelAbstract_wrap::get_nr),
"dimension of cost-residual vector")
.add_property("ng", bp::make_function(&ActionModelAbstract_wrap::get_ng),
Expand Down
4 changes: 3 additions & 1 deletion bindings/python/crocoddyl/core/action-base.hpp
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
///////////////////////////////////////////////////////////////////////////////
// BSD 3-Clause License
//
// Copyright (C) 2019-2022, LAAS-CNRS, University of Edinburgh
// Copyright (C) 2019-2023, LAAS-CNRS, University of Edinburgh,
// Heriot-Watt University
// Copyright note valid unless otherwise stated in individual files.
// All rights reserved.
///////////////////////////////////////////////////////////////////////////////
Expand All @@ -22,6 +23,7 @@ class ActionModelAbstract_wrap : public ActionModelAbstract,
EIGEN_MAKE_ALIGNED_OPERATOR_NEW
using ActionModelAbstract::ng_;
using ActionModelAbstract::nh_;
using ActionModelAbstract::nu_;

ActionModelAbstract_wrap(boost::shared_ptr<StateAbstract> state,
const std::size_t nu, const std::size_t nr = 1,
Expand Down

0 comments on commit 11c10cb

Please sign in to comment.