-
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
Cartesian-related interfaces should be representation-agnostic #113
Comments
I'll give the second option a try. @jgvictores I'd greatly appreciate any idea or objection you could come up with, I'm a bit in a hurry to have this closed and move on to the next point. Perhaps you already run into any of this; for instance, I noticed that |
The second option looks interesting, it would be great if you could come up with some implementation and see how it works (not too sure about inheriting from any |
After some thought, I've changed my mind. Let's start by asking ourselves why client applications should ever know which angle representation is being used by the cartesian controller (which boils down to the question: what value of the I've prepared a poor drawing of two valid use cases, please bare with me: We distinguish between C++ client applications (e.g. a Now, let's focus on the data flowing through each of these channels. To conform with the My revisited approach targets the distinction in client usage: since beforehand knowledge of the angle representation a BCC has been started with is only relevant for manual interaction via terminal, don't enforce hardcoding such information in C++ client applications (which would clearly fail, should the BCC start with an To summarize, human users can talk to To implement previous ideas, one may conclude that the C++-apps-way force communication channels to either share information about the angle representation, or stick to one and use it everywhere. // IFancyInterface
bool myFancyMethod(???); // what should we pass here? To answer the question in the inlined comment, three alternatives are proposed:
I'd pick the first solution as a first approach, due to its simplicity and use of STL classes (instead of something that may depend publicly on KDL/YARP). Also, no angleRepr data means that we don't need to worry about passing an identifier to incoming/outgoing bottles in CCC/CCS. The obvious consequence is that implementors of |
@jgvictores please check #114. |
Follow-up announcement: @roboticslab-uc3m/teo developers should note that the
...and connect via RPC to the new
In case |
Edited out duplicate |
Currently, the class relationship tree for cartesian control-related interfaces may force its intermediate actors to make assumptions about angle representation up to four times, that is, from the perspective of:
the client (application) code, say a module that needs to interface with our cartesian controller (e.g. the
CartesianControlClient
), or pipe directly to a solver device (KdlSolver
,AsibotSolver
)the cartesian controller (
ICartesianControl
)the cartesian solver, called by 2. or as a stand-alone device as in 1. (
ICartesianSolver
)the trajectory generator, so far only used by 2. (
Trajectory
)All of these make use of generic containers in their public interface, e.g.:
Since the
std::vector<double>
parameters carry no information about the angle representation, clients may not encode said vectors at their convenience; instead, they must conform to theangleRepr
.ini parameter used to consistently instantiate the whole chain (usually passed to an implementor ofICartesianControl
, likeBasicCartesianControl
). Note that it didn't work that way prior to #101 as axisAngle was virtually hardcoded. This is equally true for intermediate classes, e.g.BasicCartesianControl::inv
talks to aICartesianSolver::invKin
and the vector passed between them (ref) must be kept coherent with the chosen representation.Another point of grief is the lack of uniformity across different methods within each of the aforementioned interfaces. Compare:
KdlSolver::diffInvKin
- one may not notice this at first, but the KDL implementation forces callers to pass astd::vector
encoded as a velocity twist (i.e. scaled axis-angle notation, ref). Similarly, the return parameter ofKdlSolver::fwdKinError
is another twist-encoded container (ref); however, its first input parameter is a "partially" constrained vector, in a manner such that callers are not free to decide on which representation to work with, yet it's not fully hardcoded - here, it depends on the device initialization via CLI/.ini file.LineTrajectory::getX
vsLineTrajectory::getXdot
- the latter forces clients to adhere to velocity twists since this is the angle representation used in the CMC thread ofBasicCartesianControl
(ref). Now, we may develop a full picture of this mess:Method calls may seem quite clean by now in
BasicCartesianControl/ICartesianControlImpl.cpp
, but clashes between representations already arised while working on #105 and #86, and also motivated #107.At this point, we may want to distinguish what kind of representations are considered here:
Linear vs angular:
KdlVectorConverter
with more to come (see velocity below)Position vs velocity (vs acceleration?):
KdlVectorConverter
, used to describe a poseProposed solutions:
KdlVectorConverter
to handle all cases of linear/angular position/velocity(/acceleration) representations, make it store positions/angles and pass it as a parameter type to all interface methods listed above (instead ofstd::vector
). Callers and callees will act as encoders and decoders of those representations, respectively (e.g. store our data as eulerZYZ, pass it through an interface, unpack it as axisAngle on the callee's side). Probably, this class would have to implementyarp::os::Portable
in order to make itself readable and writable on the YARP network.The text was updated successfully, but these errors were encountered: