Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

This PR fixes issue 59 of the Python version of the DQ Robotics #67

Merged
merged 5 commits into from
Sep 26, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 11 additions & 4 deletions src/robot_control/DQ_ClassicQPController.cpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/**
(C) Copyright 2019 DQ Robotics Developers
(C) Copyright 2019-2024 DQ Robotics Developers

This file is part of DQ Robotics.

Expand All @@ -17,7 +17,14 @@ This file is part of DQ Robotics.
along with DQ Robotics. If not, see <http://www.gnu.org/licenses/>.

Contributors:
- Murilo M. Marinho (murilomarinho@ieee.org)

1. Murilo M. Marinho (murilomarinho@ieee.org)
Responsible for the original implementation

2. Juan Jose Quiroz Omana
Fixed bug 59 (https://github.com/dqrobotics/python/issues/59)
- Initialized a default damping to match the Matlab implementation
of the class DQ_ClassicQPController.m
*/

#include <dqrobotics/robot_control/DQ_ClassicQPController.h>
Expand All @@ -28,14 +35,14 @@ namespace DQ_robotics
DQ_ClassicQPController::DQ_ClassicQPController(DQ_Kinematics* robot, DQ_QuadraticProgrammingSolver* solver):
DQ_QuadraticProgrammingController (robot,solver)
{

set_damping(1e-3); // Default damping.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

}

DQ_ClassicQPController::DQ_ClassicQPController(const std::shared_ptr<DQ_Kinematics> &robot,
const std::shared_ptr<DQ_QuadraticProgrammingSolver> &solver):
DQ_QuadraticProgrammingController(robot,solver)
{

set_damping(1e-3); // Default damping.
}

MatrixXd DQ_ClassicQPController::compute_objective_function_symmetric_matrix(const MatrixXd &J, const VectorXd&)
Expand Down
13 changes: 7 additions & 6 deletions src/robot_control/DQ_KinematicController.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -54,15 +54,16 @@ DQ_KinematicController::DQ_KinematicController(const std::shared_ptr<DQ_Kinemati
DQ_KinematicController::DQ_KinematicController():
robot_(nullptr),
control_objective_(ControlObjective::None),
attached_primitive_(0.0),
target_primitive_(0.0),
gain_(0.0),
system_reached_stable_region_(false),
last_error_signal_(VectorXd::Zero(1)),//Todo: change this inialization to use empty vector
last_control_signal_(VectorXd::Zero(1)),//Todo: change this inialization to use empty vector
damping_(0),//Todo: change this inialization to use empty vector
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

system_reached_stable_region_(false),//Todo: change this inialization to use empty vector
last_control_signal_(VectorXd::Zero(1)),
last_error_signal_(VectorXd::Zero(1)),
stability_threshold_(0.0),
stability_counter_(0.0),
stability_counter_max_(10.0),
attached_primitive_(0.0),
target_primitive_(0.0)
stability_counter_max_(10.0)
{

}
Expand Down
Loading