-
Notifications
You must be signed in to change notification settings - Fork 7
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
Reroute CAN write calls to controlboard device #209
Comments
I'd rather isolate CAN RX/TX so that only the CanBusControlboard can access this device (CanBusHico, CanBusPeak and so on). Therefore, this "master" device would encompass read&write operations as well as routing YARP interfaces (as it does now, but not so effectively as described above). |
I'm not sure that TX is attainable in the way I described above, given that certain operations, e.g. mode change, involve a handful of SDO requests that need to be processed sequentially, i.e. sometimes it is required to await a response at step i before proceeding to step i+1. For instance, switching to PT/PVT mode conveys several steps. |
RX ready at 8130c70. |
Some thoughts on parallelization:
|
TX ready at 3002147. I have refactored read/write threads within CanBusControlboard (for now), also ICanBusSharer has been moved to its own header-only (for now) library, and several dependent apps (programs, examples, tests) have been disabled following #227 (comment). |
Small follow-up: TX thread cleaned at 20a2390 and CAN devices forced to non-blocking mode. Also, the period is now configurable. PS interesting read: https://www.oreilly.com/library/view/linux-device-drivers/0596005903/ch06.html
PS2 in case I would ever want to interrupt a blocked device: https://stackoverflow.com/q/6249577. I see little use of blocking RX operations, whereas TX blocks would render harmful given that |
In the CanBusControlboard+TechnosoftIpos architecture, write operations are performed in a joint-by-joint manner - that is, whenever we want to
IPositionControl::positionMove
, the control board forwards demanded positions to oneIPositionControlRaw::positionMoveRaw
call per joint. Each TechnosoftIpos is therefore responsible for constructing and sending its own message(s) through the CAN bus.Ideally, we would take advantage of TX/RX
yarp::dev::ICanBus
buffers (see #159, proposed implementation plan at #208) and send messages in batches. Reception is handled by the read thread in CanBusControlboard. In contrast, transmission is performed in several places, that is, by each TechnosoftIpos device (and others) as explained above. This issue aims to defer the instant in which messages are sent until these are properly formed by each subdevice (TechnosoftIpos). Once collected, let (for instance)CanBusControlboard::positionMove
dispatch them in one single call.Implementation idea:
ICanBusSharer
interface (mind Clean CAN master's DeviceDriver methods #74 (comment)) or create a new one, make TechnosoftIpos and other CAN devices implement it.TechnosoftIpos::positionMoveRaw
(and others) would store all messages in a list. This list is managed by the aforementioned interface (perhaps aregister(const yarp::dev::CanMessage &)
method?).CanBusControlboard::positionMove
iterates through all raw subdevices. In this process, per-joint CAN messages are collected, see previous point. This batch of messages is dispatched before leaving the function body.The text was updated successfully, but these errors were encountered: