Skip to content
Open
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
Original file line number Diff line number Diff line change
Expand Up @@ -83,12 +83,12 @@ void UnitreeHW::read(const ros::Time& time, const ros::Duration& /*period*/) {
}

// Set feedforward and velocity cmd to zero to avoid for safety when not controller setCommand
std::vector<std::string> names = hybridJointInterface_.getNames();
for (const auto& name : names) {
HybridJointHandle handle = hybridJointInterface_.getHandle(name);
handle.setFeedforward(0.);
handle.setVelocityDesired(0.);
handle.setKd(3.);
for(size_t i=0; i<12; ++i){

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

Should not be i<12.

jointData_[i].posDes_ = jointData_[i].pos_;
jointData_[i].velDes_ = jointData_[i].vel_;
Comment on lines +87 to +88

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

Not need for these two lines.

jointData_[i].ff_ = 0.0;
jointData_[i].kp_ = 0.0;
jointData_[i].kd_ = 0.0;

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

Better to have some damping
jointData_[i].kd_ = 3.0;

}

updateJoystick(time);
Expand Down