Repository navigation
Conversation
After the switch to IDL-based RPC, the ControlBoard NWS only exposed the IControlMode setters over RPC. Add getControlModeOneRPC, getControlModeAllRPC and getControlModeGroupRPC to ControlBoardMsgs.thrift, mirroring the existing IInteractionMode getters, and implement them in ControlBoardRPCd on top of IControlMode::getControlMode(s). Returned modes use yarp::dev::ControlModeEnum, so non-selectable states (e.g. hardware fault, calibrating) are reported faithfully. Regenerate the committed IDL code and add a regression test that talks to the NWS RPC port like `yarp rpc` does: set a mode through the existing setter, then read it back through the new getters (per-axis, all and group). Fixes robotology#3405
|
Thanks for opening this pull request! The maintainers of this repository would appreciate it if you would update the release notes by adding a file in |
Up to standards ✅🟢 Issues
|
| Metric | Results |
|---|---|
| Complexity | 719 |
| Duplication | 132 |
🟢 Coverage ∅ diff coverage
Metric Results Coverage variation Report missing for 763a4fb1 Diff coverage ✅ ∅ diff coverage Coverage variation details
Coverable lines Covered lines Coverage Common ancestor commit (763a4fb) Report Missing Report Missing Report Missing Head commit (86954cb) 361803 42104 11.64% Coverage variation is the difference between the coverage for the head and common ancestor commits of the pull request branch:
<coverage of head commit> - <coverage of common ancestor commit>Diff coverage details
Coverable lines Covered lines Diff coverage Pull request (#3406) 0 0 ∅ (not applicable) Diff coverage is the percentage of lines that are covered by tests out of the coverable lines that the pull request added or modified:
<covered lines added or modified>/<coverable lines added or modified> * 100%1 Codacy didn't receive coverage data for the commit, or there was an error processing the received data. Check your integration for errors and validate that your coverage setup is correct.
NEW Get contextual insights on your PRs based on Codacy's metrics, along with PR and Jira context, without leaving GitHub. Enable AI reviewer
TIP This summary will be updated as you push new changes.
There was a problem hiding this comment.
The use of yarp::os::Bottle should be always avoided in examples, clients and tests if a safe alternative is available.
In file controlBoard_nws_yarp_test.cpp please remove them and use something similar to:
ControlBoardMsgs rpc_client;
REQUIRE(rpc_client.yarp().attachAsClient(rpc));
{
return_getControlModeOne reply = rpc_client.getControlModeOneRPC(0);
CHECK(reply.ret == ReturnValue_ok);
CHECK(static_cast<std::int32_t>(reply.mode) == pos_direct);
}
...
As requested in review: avoid yarp::os::Bottle in tests when a safe alternative is available. The RPC section now talks to the device through the generated ControlBoardMsgs client, and the test links the ControlBoardMsgs messages library.
|
Thanks for the review, Marco. The RPC section of the test now talks to the device through the generated |
Fixes #3405.
After the switch to IDL-based RPC, the ControlBoard NWS only exposed the IControlMode setters over RPC, so
yarp rpccould set modes but not read them back.This mirrors the existing IInteractionMode getters: it adds
getControlModeOneRPC,getControlModeAllRPCandgetControlModeGroupRPCtoControlBoardMsgs.thrift, implements them inControlBoardRPCdon top ofIControlMode::getControlMode(s), and regenerates the committed IDL code. Returned modes useyarp::dev::ControlModeEnumso non-selectable states (hardware fault, calibrating, unknown) are reported faithfully.Adds a regression test that talks to the NWS RPC port like
yarp rpcdoes: it sets a mode through the existing setter, then reads it back through the new getters (per-axis, all and group).