Support for addressing ICC communication in MC #431
Merged
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.
In brief
This PR changes prepares support for sending MC frames not only to actuators on CAN locations (boards such as
foc
oramcbldc
) but also to actuators placed on the ETH board. This latter is the case of theamc
board which has an actuator on its second core that can be reached by using inter core communication (ICC).So far, no functionality is added: only code refactoring.
In more details
The code for the transmission of the frames related to MC is moved from the file
Motor.c
into objects of a dedicated namespace where it is possible to discriminate between CAN and ICC destinations.As an example, we send a velocity PID message with the following code:
The constructor of the message surely accepts the values to send
{Kp, Ki, Kd, Ks}
but it also accepts a location that can be either on CAN or on ICC. It is inside the.transmit()
method that eventually the transmission is directed towards CAN or ICC:Where for the CAN we have a call to the
EOtheCANservices
object we have always used:And for ICC we have for now an empty function that we shall fill in a later PR with a call to a
embot::app::eth::theICCservices
object.Tests
I have tested the code and successfully moved a motor on three different setups using
amc
,ems
andmc4plus
boards.Mergeability
Following the above tests the PR can surely be merged.
Associated PRs
There is a PR for the binaries:
Further work
icub-firmware-shared
/icub-main
to describe the location of an actuator to be on ETH and I will enable the code now shadowed byYRI_uses_MC_foc_actuator_descriptor_generic
.embot::app::eth::theICCservices
object in theamc
board to transmit and receive frames towards its second core and also in theamc2c
code to manage communication w/ theamc
.