-
Notifications
You must be signed in to change notification settings - Fork 91
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
base: develop
Are you sure you want to change the base?
Conversation
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); |
There was a problem hiding this comment.
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_); |
There was a problem hiding this comment.
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.
No description provided.