-
Notifications
You must be signed in to change notification settings - Fork 14
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
Force CC-related interfaces to stick to scaled axis-angle representation, provide conversion utilities #114
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
* allocate memory for vector container only once, on instantiation * avoid creating a copy of the first element of the input bottle
Also replace inline code with call to KdlVectorConverter::twistToVector in KdlSolver::fwdKinError.
See d59c5d4. It turns out that reserve() does allocate memory and allows further calls to operator[], but the reserved *capacity* does not matter when resize() is called, that is: std::vector<int> v; // size = capacity = 0 v.reserve(1); // next instruction would fail without this v[0] = 1; v.resize(1); // same as v.resize(1, 0) std::cout < v[0]; yields '0' since resize() sees a zero-sized vector and overwrites the 'unmanaged' elements (also, at() would throw an exception). This, in turn, does work when push_back() is used instead.
Conflicts: libraries/TeoYarp/CartesianControlServer/CartesianControlServer.cpp
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
See #113 for background. Notable changes:
New
KinematicRepresentationLib
library, depends internally on KDL. Provides a collection of static methods in theKinRepresentation
class to handle conversion between linear and angular representations, focusing on XXX_to_axisAngleScaled and axisAngleScaled_to_XXX.ICartesianControl
,ICartesianSolver
andTrajectory
interfaces assume that generic containers storing task-space data stick to the scaled axis-angle representation (radians) and linear cartesian coordinates (meters). Where needed, utility methods fromKinRepresentation
are used.KdlVectorConverter
has been simplified, it's sole purpose ATM is to provide a seamless conversion between STL and KDL classes.The
--angleRepr
parameter is now only relevant to theCartesianControlServer
, other devices ignore it. If non-empty, CCS opens a/rpc_transform:s
port and uses utility methods fromKinRepresentation
to convert between axis-angle scaled and the representation pointed by--angleRepr
.For backward compatibility,
CartesianControlClient
may talk to/rpc_transform:s
(instead of/rpc:s
) if--transform
is provided.The port reader implementation in
CartesianControlServer
has been split into a newRpcResponder
class for readability and ease of maintenance. Further, this class is derived from to correctly handle callbacks for the/rpc_transform:s
port.Helper methods
KdlVectorConverter::toDeg
andKdlVectorConverter::toRad
have been removed in favour ofKinRepresentation::degToRad
andKinRepresentation::radToDeg
.Added unit tests for
KinRepresentation
.Added
KdlVectorConverter::vectorToTwist
for completeness (we already hadKdlVectorConverter::twistToVector
).