Skip to content

Conversation

destogl
Copy link
Member

@destogl destogl commented Apr 21, 2021

Add stock admittance controller.

Description - TBD

@destogl destogl marked this pull request as draft April 21, 2021 21:06
@AndyZe
Copy link
Contributor

AndyZe commented May 2, 2021

I think you should squash my commits down to 1 👍

std::string sensor_frame_;

// Admittance parameters
// bool unified_mode_ = false;
Copy link
Contributor

@AndyZe AndyZe May 6, 2021

Choose a reason for hiding this comment

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

No idea what unified mode means. Needs a comment

geometry_msgs::msg::WrenchStamped measured_force_;
geometry_msgs::msg::WrenchStamped measured_force_control_frame_;

geometry_msgs::msg::PoseStamped current_origin_;
Copy link
Contributor

Choose a reason for hiding this comment

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

Current origin of what? Needs a comment

auto input_pose_cmd = input_pose_command_.readFromRT();

// Get current robot joint angles
// Position has to always there
Copy link
Contributor

Choose a reason for hiding this comment

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

^ sentence doesn't make sense


The paramters are adjustable using ``dynamic_reconfigure`` functionality and rqt-plugin.

The controller has following parameters:
Copy link
Contributor

Choose a reason for hiding this comment

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

Really appreciate this documentation!

}
}

// TODO: Add here desired vector at the IK tip and not tool!!!!
Copy link
Contributor

Choose a reason for hiding this comment

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

I'm going to add notes for several lines that aren't reachable from this PR.

Line 213 (above) seems unnecessary. Please double-check

Copy link
Contributor

Choose a reason for hiding this comment

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

L227:

TODO: this formula could cause a "gimbal lock" if the angular difference is large

Copy link
Contributor

Choose a reason for hiding this comment

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

Above L239, add comment:

// Acceleration is regarded as the control input. It is integrated to calculate velocity and acceleration.

tf2::doTransform(current_pose_control_frame_, desired_pose_, relative_desired_pose_);

// Use Jacobian-based IK
// Calculate desired Cartesian displacement of the robot
Copy link
Contributor

Choose a reason for hiding this comment

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

Update the comment (prob my mistake):

// Convert desired position deltas to joint deltas

@codecov-commenter
Copy link

codecov-commenter commented May 7, 2021

Codecov Report

Merging #173 (4de5d79) into master (7187083) will increase coverage by 0.00%.
The diff coverage is n/a.

@@            Coverage Diff             @@
##           master     #173      +/-   ##
==========================================
  Coverage   35.27%   35.28%              
==========================================
  Files         286       26     -260     
  Lines       24816     2256   -22560     
  Branches    16082     1462   -14620     
==========================================
- Hits         8755      796    -7959     
+ Misses       1452      132    -1320     
+ Partials    14609     1328   -13281     
Flag Coverage Δ
unittests 35.28% <ø> (+<0.01%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
...nt_state_controller/src/joint_state_controller.cpp
...include/joint_trajectory_controller/trajectory.hpp
..._broadcaster/test/test_joint_state_broadcaster.cpp
...ller/test/test_load_forward_command_controller.cpp
...include/joint_trajectory_controller/trajectory.hpp
...ller/test/test_load_forward_command_controller.cpp
...nt_state_controller/src/joint_state_controller.cpp
...include/joint_trajectory_controller/trajectory.hpp
...int_trajectory_controller/test/test_trajectory.cpp
...ontrollers/src/joint_group_velocity_controller.cpp
... and 302 more

@AndyZe AndyZe force-pushed the add-admittance-controller branch 2 times, most recently from 73d1b24 to e788915 Compare May 18, 2021 14:48
@AndyZe AndyZe deleted the add-admittance-controller branch May 26, 2021 15:34
@AndyZe AndyZe restored the add-admittance-controller branch May 26, 2021 15:34
@destogl destogl force-pushed the add-admittance-controller branch from a257737 to 1739024 Compare October 21, 2021 13:55
destogl and others added 21 commits October 26, 2021 16:26
…ulation of the refrence pose from the reference deltas.
…nsion5) branch

Co-authored-by: Nathan Brooks<[email protected]>
Co-authored-by: AndyZe<[email protected]>
@destogl destogl force-pushed the add-admittance-controller branch from 5b885cb to d99ebed Compare October 26, 2021 14:26
for (auto index = 0u; index < num_joints; ++index) {
// TODO(destogl): ATTENTION: This does not work properly, deltas are getting neutralized and robot is not moving on external forces
// TODO(anyone): Is here OK to use shortest_angular_distance?
joint_deltas[index] = angles::shortest_angular_distance(current_joint_states.positions[index], (*input_joint_cmd)->points[0].positions[index]);
Copy link
Contributor

Choose a reason for hiding this comment

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

First time looking at this in awhile!

I just wanted to note, this should probably use shortest_angular_distance_with_large_limits().

https://github.com/ros/angles/blob/811da0230f13348fd40337f63219c3b1520088f3/angles/include/angles/angles.h#L222

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.

5 participants