Closed jgvictores closed 3 years ago
Blocks #135 in addition to #133.
((comment omitted, DoF applies to joint space, here we are in Cartesian space))
Note that several design decisions must be taken. We might have a meeting in person for this, I'll keep you informed. cc: @PeterBowman @rsantos88
@PeterBowman commented that he had started refractoring TrajectoryLib a while ago. Maybe some code or ideas hat we can reuse.
@PeterBowman expressed concerns regarding being able to add several waypoints in a single function call. @rsantos88 this is also useful for teo-grasp in relation to porting trajectories from openrave.
With https://github.com/roboticslab-uc3m/tools also in mind, I'm raising the bar and invoking some magic keywords:
serialization/deserialization
A.k.a. marshalling and unmarshalling.
Just an idea, I think it would be interesting to make an example with the functional part of this library (in case it is usable) for example with LineTrajectory
Just an idea, I think it would be interesting to make an example with the functional part of this library (in case it is usable) for example with
LineTrajectory
Yes! Definitively. As a bare minimum, we should at least test
the resulting class(es).
Lots of progress (developed ITrajectoy
, ICartesianTrajectoy
, KdlTrajectory
) at f02a0d8283c063eddd347f1ed10ca0221c01ef2d, actually improving BasicCartesianControl
too (#135).
Just an idea, I think it would be interesting to make an example with the functional part of this library (in case it is usable) for example with LineTrajectory
Added this test at 92a0c0b018ce55c936b812b0d204281125516822.
Still pending (but coming soon!): trajectories with paths other than ICartesianTrajectory::LINE
.
Next thoughts should be in the line of discrete trajectories, to address the use case of, say, wanting to retrieve the timestamp of the n-th waypoint.
In addition to a potential (linear?) interpolation if requesting a movementTime
from any of the methods that does not correspond precisely to a waypoint (and e.g. avoiding the interpolation if it does correspond.... within a certain tolerance xD).
Began IJointTrajectory
at bd660a4dc94cf10b76ca84037211c2d4f2653c20, currently at issue-164-joint
branch.
https://github.com/roboticslab-uc3m/kinematics-dynamics/issues/157 affects on how trajectories are to be generated: pass a duration parameter straight to the KDL API, or do some math with distances/velocities and obtain approximate duration first.
Currently, maximum velocity and acceleration defaults are enforced:
I believe we should enable their customization somehow (through additional interface methods or via constructor?).
I believe we should enable their customization somehow (through additional interface methods or via constructor?).
Added to constructor in https://github.com/roboticslab-uc3m/kinematics-dynamics/commit/d223d392e0cbb63b28e3e7594ee16251148045ae (not merged yet).
WIP at 6f3e7d8.
It turns out that libraries/YarpPlugins/AsibotSolver/TrajGen.hpp would be useful for the new libraries/TrajectoryLib/BasicJointTrajectory.hpp. @PeterBowman Maybe we could move things around (also rename a bit, something like OneJointTrajectory
)?
TrajGen was kept for historical reasons, no code of ours is using that ATOW. If I'm correct, we even came close to removing it since KDL provides a similar functionality: KDL::VelocityProfile_Spline
(supports up to 5th order splines, which we don't). Does it make sense to integrate/move TrajGen in the IJointTrajectory
inheritance tree (even expand it so that initial/final accelerations are taken into account) and, if we ever need it, support velocity splines in the ICartesianTrajectory
tree by means of the existing KdlTrajectory
wrapper? Concerns: code duplication on one hand, avoiding unnecessary(/unrelated?) dependencies on the other hand.
I'm not a big fan of adding dependencies, but even less a fan of code duplication. After reading your comment, this makes me inclined towards the use of KDL even for joint space trajectories. At time of writing KDL::VelocityProfile
provides 5 different implementations that we may have ended up re-implementing (including the KDL::VelocityProfile_Spline
you cite).
Looking at current issue-164-joint
branch, maybe some renaming to be done?
KDL::VelocityProfile
provides 5 different implementations that we may have ended up re-implementing
For the record, we already use KDL::VelocityProfile_Trap
, and KDL::VelocityProfile_Rectangular
is WIP for https://github.com/roboticslab-uc3m/kinematics-dynamics/issues/166. But, there is no other re-implementation I know of apart from said TrajLib/KDL::DL::VelocityProfile_Spline
. That one originated at asibot-main, probably before KDL was first used in RL code.
maybe some renaming to be done?
If KDL already has everything we need to implement IJointTrajectory
, fine, then. I'll take care of edit conflicts across branches.
That one originated at asibot-main, probably before KDL was first used in RL code.
TrajGen
was intended to be a light-weight alternative to KDL with no additional dependencies. There was also a learn-by-doing motivation on my side. These reasons are IMHO historical and there is no strong motivation against using KDL even for joint space trajectories. It will actually allow Joint and Cartesian space trajectories to mutually benefit from any improvements/extensions in velocity profiles.
If KDL already has everything we need to implement IJointTrajectory, fine, then. I'll take care of edit conflicts across branches.
I'll give a try at using KDL in BasicJointTrajectory
, I don't want to count my :chicken: before they hatch. If all goes well, I'll comment here and ask for your help for renaming while avoiding conflicts across branches.
Slightly blocked, focusing on https://github.com/roboticslab-uc3m/teo-main/issues/38 right now.
ASWJ we might consider dropping the ITrajectory
wrapper class tree in favor of vanilla KDL's motion API.
As spoken at https://github.com/roboticslab-uc3m/kinematics-dynamics/issues/134#issuecomment-505659623, KDL's motion API seems reasonable.
Furthermore, here are some notes to future selves:
spaceNavigator
as well as https://github.com/roboticslab-uc3m/daw2robotRemember to update:
Recent discovery: https://www.yarp.it/namespaceyarp_1_1rosmsg_1_1trajectory__msgs.html
@jgvictores, let's ask the bold question: should we drop branch issue-164-joint
(badly named, by the way) and turn this issue into "Nuke TrajectoryLib"? That is, use KDL directly instead of this thin wrapper of ours. I'm not quite proud of it and its pitfalls, had to code very carefully in the past and yet kept finding memory leaks. Extending this library (e.g. for rectangular velocity profiles) felt kinda useless as I could just call KDL methods instead.
let's ask the bold question: should we drop branch issue-164-joint (badly named, by the way) and turn this issue into "Nuke TrajectoryLib"? That is, use KDL directly instead of this thin wrapper of ours. I'm not quite proud of it and its pitfalls, had to code very carefully in the past and yet kept finding memory leaks. Extending this library (e.g. for rectangular velocity profiles) felt kinda useless as I could just call KDL methods instead.
Yesssssssssssssssssss :+1:
Tactical nuke dropped, there is no more TrajectoryLib at https://github.com/roboticslab-uc3m/kinematics-dynamics/commit/692888d12996d1fdd47169979c28839b55dbc16e. Last stable implementation was available here. The issue-164-joint
branch will be deleted, here is the full patchset for reference: https://github.com/roboticslab-uc3m/kinematics-dynamics/compare/a2bd56ccb7b6cbaa98adc00c2f7298eb1de4c659...d2665723906c9f4c555714e696f8f4fe8c766e9b.
Keep in mind the KDL motion API allows you not to configure certain parameters on construction, such as trajectory duration, maximum velocity, reference acceleration and so on. However, those must be accounted for anyway. A particular scenario involves trajectories with a starting point, a constant velocity and infinite duration (no end point):
SetProfileDuration
can be used with a dummy waypoint which we know would never be reached, e.g. 10 meters away from start:
Improve TrajectoryLib, starting by decoupling one and two limb trajectory generation.
Blocks #133, and more to come.