-
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
Make solver implementations more aware of their internal state #145
Comments
Further ideas regarding internal state in solvers (per roboticslab-uc3m/teo-main#15 (comment)):
|
|
Blocks #118. |
Indeed, I forgot to call |
+1 to draconian. |
With #146, I started using kinematics-dynamics/programs/transCoords/TransCoords.cpp Lines 98 to 99 in 7ea960b
However, I didn't realize that this kind of creator funcion uses dynamic allocation, and returns a pointer to an object that needs to be destroyed further on. In other words, without a |
Ok, yes, that is important! |
It's fine. Per
|
I've been thinking... Perhaps the CCRH wouldn't even need an additional interface class, since there is only going to be one, right? |
There are actually 3 possiblites:
|
91fec27 has been partially reverted in 4557220 because of AMOR returning 0.0 as minimum and maximum joint limits (check roboticslab-uc3m/amor-yarp-devices#2). |
@jgvictores after having taken another look at my Sorry for the mess, let's discuss the next steps face to face. |
Cool. IMHO a representation layer over the controller was a slight higher priority than over the solver,, but they are not redundant nor mutually exclusive. PS: IMHO they are not ultra-high priority tasks, but it's also nice to see some progress. Code can help see design decisions we are making and prove if they are in a right/wrong direction. |
There is much more work to do. I started from the bottom of the chain (cartesian solver), but all components should be made representation-aware before merging anything. Also, we need to discuss the main shortcoming of the current solution (#113), which went largely unnoticed: transformations of velocities and accelerations. |
Let me sum this up. Problem: historically, we used to mix different geometrical representations up. Orientations were inconsistently represented in the axis-angle, scaled axis-angle and eulerXY conventions, among others (#113). This got sorted out and explicitly documented - our controller/solver interfaces want scaled axis-angle no matter what. However, clients (mostly existing code) may request a specific representation that differs from the standard. Also, new codebase (namely the soft-neck project) demanded more flexibility and additional geometric transformations. Current situation: the NWS, CartesianControlServer, accepts specific parameters regarding coordinate system, angle representation and angular units (ref). Besides the standard Now, the question is: if consumers demand a different geometrical representation, i.e. scaled axis-angle does not fit their needs, who must be placed the burden on in order to perform the necesssary conversions?
I liked 2 since nothing else needs to change, whereas 3 and 4 are prone to code duplication (easy to solve with a refactorization and additional layers, but it doesn't make me feel good...). I'm considering either droping 2 in favor of 1, or improving 2 so that representation shenanigans are also spanned to streaming commands. In that latter case, perhaps Another idea: configure a protocol check on NWC/NWS. It might be possible that an unaware client connects to a specific server that expects a non-standard representation. To prevent havoc from ensuing, consumers may be forced to configure the NWC in the exact same way, and this information could be compared against the server in a similar way that a protocol check works. |
ASWJ @jgvictores we have decided to remove the hackish The legacy "fix-145-solver-state" WIP branch will be deleted now: 6d252ce, 821234c...6d252ce. Closing the issue as solved, but WONTFIX. |
Solver devices could store more information about their internal state, such as the angle representation (removed at #113 so that a single copy is managed by the server device and passed down the chain, i.e. controller & trajectory generator & solver), thus rendering more useful as standalone components not necessarily linked to a controller device at all times (cf. transCoords app).
One potential benefit of said awareness is related to the fact that users are now fully responsible for managing the right angle representation and its conversions between
ICartesianSolver
's standard format and whatever their app handles. In other words, spare them several annoying calls toKinRepresentation::encodePose
andKinRepresentation::decodePose
every time they want to interface with a solver.As proposed by @jgvictores, there could be an intermediate layer between the actual
ICartesianSolver
interface and the implementation. In that vein, the former accepts the angle representation of choice, as specified by the user. The latter works with KDL standard (scaled axis-angle) or whatever suits it better, and in fact would behave as aICartesianSolverRaw
or such. The new layer may now hold the angle representation and use it to manage all conversions needed between interface-implementation. We already work with something similar in the server device, check theRpcTransformResponder
conversion methods.Several solutions were laid out at #113 and could be now considered again. My main concern, and one of the reasons behind how things are currently done, is that angleRepr will be supervised by several components, perhaps introducing duplicate routines and time overheads. Also, consistency must be kept when working with the full chain (server + controller + solver).
The text was updated successfully, but these errors were encountered: