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

Feature/external controller #529

Open
wants to merge 8 commits into
base: develop
Choose a base branch
from

Conversation

rjgriffin42
Copy link
Member

No description provided.

desired_state_data_ = Eigen::VectorXd(13 + 2 * number_of_joints);
desired_control_data_ = Eigen::VectorXd(number_of_joints);
p_gains_ = Eigen::VectorXd(number_of_joints);
d_gains_ = Eigen::VectorXd(number_of_joints);
Copy link
Member

Choose a reason for hiding this comment

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

This way of defining size may cause memory allocation issues.
resizing the vector could be in this way
desired_state_data_.resize(13 + 2* number_of_joints);
desired_control_data_.resize(number_of_joints);
p_gains.resize(number_of_joints);
d_gains_.resize(number_of_joints);

And .resize() does not set the variable to be zero. So, using desired_state_data_.setZero() would be safe.

desired_joint_velocities_ = Eigen::VectorXd(number_of_joints_);
desired_joint_torques_ = Eigen::VectorXd(number_of_joints_);
desired_joint_stiffnesses_ = Eigen::VectorXd(number_of_joints_);
desired_joint_damping_ = Eigen::VectorXd(number_of_joints_);
Copy link
Member

Choose a reason for hiding this comment

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

use .resize(Number_of_size); instead using Eigen::VectorXd(#). This may cause the memory issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants