-
Notifications
You must be signed in to change notification settings - Fork 31
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
Use of embot::app::eth::theEncoderReader
in all ETH boards
#399
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good work!
and fantastic documentation!
bool embot::app::eth::theEncoderReader::Impl::Read(uint8_t position, embot::app::eth::encoder::v1::valueInfo &primary, embot::app::eth::encoder::v1::valueInfo &secondary) | ||
{ | ||
eOencoderreader_valueInfo_t *e1 = reinterpret_cast<eOencoderreader_valueInfo_t*>(&primary); | ||
eOencoderreader_valueInfo_t *e2 = reinterpret_cast<eOencoderreader_valueInfo_t*>(&primary); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@marcoaccame I think the error related to the problem about reading the values from the state and stateExt port is here. The assignment to e1 and e2 is made using the same reference. Fixing it to &secondary
fix the problem
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
well spotted, thanx
Update evaluation on final offset to be passed by JointSet to POS service so that user set calibration5 param for calibration type 14 as it is printed when port state is read Add fix to bug introduced by PR robotology#399: values not updated by state and stateExt ports
Description
This PR enables all the ETH boards to use a common interface for the the reading of the encoders used in motion control.
It ensures:
That is possible because we now use a PIMPL singleton object called
embot::app::eth::theEncoderReader
which is derived from an interfaceembot::app::eth::encoder::v1::IFreader
that offers functionalities as needed by today's encoders.But it can also be derived from other interfaces to offer easy migration to encoders w/ higher resolution or to add improved diagnostics by keeping the legacy functionalities.
Details
This PR makes the singleton
embot::app::eth::theEncoderReader
the unique point of usage for acquisition of encoders' information in motion control on ETH boards.It is care of the protected implementation (PIMPL) of the singleton to manage the required resources and retrieve the requested encoder values.
Figure. The object
embot::app::eth::theEncoderReader
and its PIMPL.For now we use two implementations:
ems
,mc4plus
andmc2plus
which require theHAL
of thestm32f407
chip. This one uses the legacy objectsEOtheEncoderReader
andEOappEncodersReader
which can stay as they are or can be easily refactored later on.amc
(but later on also for theamc2foc
) which can use theembot::hw
framework.The two implementations
Figure. Implementation used by
ems
,mc4plus
andmc2plus
: all the encoders, both HAL based and CAN locatedFigure. Implementation used by
amc
: only AEA encoders so far.Evolution of the functionalities
This singleton
embot::app::eth::theEncoderReader
is derived from a given interface,embot::app::eth::encoder::v1::IFreader
, which ensures the encoder reading functionalities as requested by today's ETH boards:ems
,mc4plus
,mc2plus
,amc
.Figure. The interfaces implemented by
embot::app::eth::theEncoderReader
.The
embot::app::eth::theEncoderReader
can also implement other interfaces able to offer future advances services such as high resolution encoders or improved diagnostic mechanisms.As a mere demonstration of feasibility I have added derivation from an
experimental::IFreader
which can offer 64 bit resolution.Code Listing. Possible new high resolution value.
Code Listing. The
theEncoderReader
is derived from av1::IFreader
which give the required services but also from aexperimental::IFreader
which can live alongside to enrich the functionalities.Mergeability
Tests OK on a setup dedicated setup w/ an
amc
, a motor and an encoder.So, I think that we can safely merge.
Binaries
They are in here: