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
A version of TOTG computeTimeStamps() that accounts for torque limits #3412
Conversation
6ec5915
to
de3d8eb
Compare
Codecov ReportPatch coverage:
Additional details and impacted files@@ Coverage Diff @@
## master #3412 +/- ##
==========================================
- Coverage 61.72% 61.70% -0.01%
==========================================
Files 382 385 +3
Lines 33788 34095 +307
==========================================
+ Hits 20851 21036 +185
- Misses 12937 13059 +122
☔ View full report in Codecov by Sentry. |
5710ebd
to
9e8aebb
Compare
22b62a7
to
3ca562c
Compare
bb3c1db
to
f66d9cf
Compare
...jectory_processing/include/moveit/trajectory_processing/time_optimal_trajectory_generation.h
Outdated
Show resolved
Hide resolved
...jectory_processing/include/moveit/trajectory_processing/time_optimal_trajectory_generation.h
Outdated
Show resolved
Hide resolved
moveit_core/trajectory_processing/src/time_optimal_trajectory_generation.cpp
Show resolved
Hide resolved
...jectory_processing/include/moveit/trajectory_processing/time_optimal_trajectory_generation.h
Show resolved
Hide resolved
moveit_core/trajectory_processing/src/time_optimal_trajectory_generation.cpp
Outdated
Show resolved
Hide resolved
moveit_core/trajectory_processing/src/time_optimal_trajectory_generation.cpp
Outdated
Show resolved
Hide resolved
moveit_core/trajectory_processing/src/time_optimal_trajectory_generation.cpp
Outdated
Show resolved
Hide resolved
moveit_core/trajectory_processing/src/time_optimal_trajectory_generation.cpp
Outdated
Show resolved
Hide resolved
moveit_core/trajectory_processing/src/time_optimal_trajectory_generation.cpp
Outdated
Show resolved
Hide resolved
2603a8d
to
7c96d80
Compare
f383054
to
fe9ce8d
Compare
fe9ce8d
to
488b175
Compare
9b2cc65
to
65240b9
Compare
...ry_processing/include/moveit/trajectory_processing/iterative_torque_limit_parameterization.h
Show resolved
Hide resolved
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.
Dear @AndyZe, I have a few important pose-merge comments. Please address them.
moveit_core/trajectory_processing/src/time_optimal_trajectory_generation.cpp
Show resolved
Hide resolved
return doTimeParameterizationCalculations(trajectory, max_velocity, max_acceleration); | ||
} | ||
|
||
bool TimeOptimalTrajectoryGeneration::computeTimeStamps( |
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 method has strong overlap with the other computeTimeStamps method.
Better factor out common code into a separate helper function!
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.
Completely agree with you but won't address now. It's not really related to this "torque-limited" feature.
BTW I'm no longer at PickNik. I'm working on ag robots with AppliedLogix now.
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.
You seem to like programming by copy-and-paste! I'm trying to cleanup the redundancy and discovered some more issues in this PR, namely you are incorrectly indexing the joints. Could you please open your PR #3426 for additional commits?
moveit_core/trajectory_processing/src/time_optimal_trajectory_generation.cpp
Show resolved
Hide resolved
|
||
double TimeOptimalTrajectoryGeneration::verifyScalingFactor(const double requested_scaling_factor) const | ||
{ | ||
double scaling_factor = std::clamp(requested_scaling_factor, -1.0, 1.0); |
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.
Why do you allow for negative scaling factors?
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.
I believe you're correct. Done.
Thanks Robert, I will do this in the next few days 👍 |
/** \brief Computes the indices of joint variables given a vector of joint names to look up */ | ||
bool computeJointVariableIndices(const std::vector<std::string>& joint_names, | ||
std::vector<size_t>& joint_bijection) const; | ||
|
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 seems to be an exact copy of computeIKIndexBijection
- except throwing a different error message!
Increasing code redundancy should be strongly avoided!
// Get the velocity and acceleration limits for all active joints | ||
const moveit::core::RobotModel& rmodel = group->getParentModel(); | ||
const std::vector<std::string>& vars = group->getVariableNames(); | ||
std::vector<size_t> active_joint_indices; | ||
if (!group->computeJointVariableIndices(group->getActiveJointModelNames(), active_joint_indices)) |
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.
Hi @AndyZe,
In contrast to the previous code, you switched from all variables to active variables when looking up max velocities and accelerations. However, the TOTG algorithm still considers all variables, doesn't it?
I expect this to segfault due to mismatching vector lengths for variables and limits! Did you test this with robot models comprising mimic joints?
@AndyZe, we get complaints from users on the TOTG behavior since the latest release: #3450 (comment) |
Description
This adds a new version of TOTG
computeTimeStamps()
which takes robot dynamics into consideration. The robot inertia model is pulled from the URDF.Here's the algorithm in a nutshell:
This will probably be interesting to @mechwiz @stephanie-eng @sjahr
Sorry for the large line count. Most of that comes from syncing with MoveIt2 (the 2nd commit). You could ignore that one when reviewing, if you want -- focus mostly on
computeTimeStampsWithTorqueLimits()