Skip to content
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
merged 38 commits into from
Aug 23, 2017

Conversation

PeterBowman
Copy link
Member

@PeterBowman PeterBowman commented Aug 23, 2017

See #113 for background. Notable changes:

  • New KinematicRepresentationLib library, depends internally on KDL. Provides a collection of static methods in the KinRepresentation class to handle conversion between linear and angular representations, focusing on XXX_to_axisAngleScaled and axisAngleScaled_to_XXX.

  • ICartesianControl, ICartesianSolver and Trajectory 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 from KinRepresentation 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 the CartesianControlServer, other devices ignore it. If non-empty, CCS opens a /rpc_transform:s port and uses utility methods from KinRepresentation 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 new RpcResponder 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 and KdlVectorConverter::toRad have been removed in favour of KinRepresentation::degToRad and KinRepresentation::radToDeg.

  • Added unit tests for KinRepresentation.

  • Added KdlVectorConverter::vectorToTwist for completeness (we already had KdlVectorConverter::twistToVector).

* 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.
@coveralls
Copy link

Coverage Status

Coverage increased (+4.3%) to 33.298% when pulling 93de647 on fix-113-kin-repr into e9255e8 on develop.

@jgvictores jgvictores merged commit 0ff88b2 into develop Aug 23, 2017
@jgvictores jgvictores deleted the fix-113-kin-repr branch August 23, 2017 22:08
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.

3 participants