Skip to content
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

Yarpmotorgui with displayed hardware faults messages #2764

Merged
merged 3 commits into from
Dec 2, 2021

Conversation

randaz81
Copy link
Member

See discussion: robotology/community#561

  • Modified yarpmotorgui to support a new page "Hardware Fault" which displays the internal hardware error
  • Added new interface IJointFault with method: IJointFault::getLastJointFault(int j, int& fault, std::string& message)
  • IJointFault is now implemented by RemoteControlBoard and ControlBoard_nws_yarp
  • fakeMotionControl.cpp now simulates an hardware fault when it receives a TorqueCommand > 1Nm

@randaz81 randaz81 self-assigned this Nov 18, 2021
@randaz81 randaz81 temporarily deployed to code-analysis November 18, 2021 17:05 Inactive
@randaz81 randaz81 temporarily deployed to code-analysis November 18, 2021 17:05 Inactive
@randaz81 randaz81 temporarily deployed to code-analysis November 18, 2021 17:05 Inactive
@randaz81 randaz81 temporarily deployed to code-analysis November 18, 2021 17:26 Inactive
@randaz81 randaz81 temporarily deployed to code-analysis November 18, 2021 17:26 Inactive
@randaz81 randaz81 temporarily deployed to code-analysis November 18, 2021 17:26 Inactive
Copy link
Member

@PeterBowman PeterBowman left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  1. I wonder if bool getLastJointFault(int j, int* fault, std::string& message) would be more consistent with existing interfaces (note the second parameter, as a primitive type, is passed as a pointer instead of by-reference).
  2. Could you please also register this new interface in yarp.i? I think it just needs an %include, a CAST_POLYDRIVER_TO_INTERFACE(IJointFault) and an extension for output parameters such as this (not tested):
    %extend yarp::dev::IJointFault {
        bool getLastJointFault(int j, std::vector<int>& fault, std::vector<std::string>& message) {
            return self->getLastJointFault(j, fault[0], message[0]);
        }
    }
    (change fault[0] to &fault[0] if a pointer is passed instead of a reference)

@randaz81 randaz81 force-pushed the yarpmotorgui_hwfault branch from 2584562 to 1e2a4c4 Compare November 24, 2021 11:23
@randaz81 randaz81 temporarily deployed to code-analysis November 24, 2021 11:25 Inactive
@randaz81 randaz81 temporarily deployed to code-analysis November 24, 2021 11:25 Inactive
@randaz81 randaz81 temporarily deployed to code-analysis November 24, 2021 11:37 Inactive
@randaz81 randaz81 temporarily deployed to code-analysis November 24, 2021 11:38 Inactive
@randaz81 randaz81 temporarily deployed to code-analysis November 24, 2021 11:38 Inactive
@randaz81
Copy link
Member Author

Thank you @PeterBowman
Point 1: I'm trying to use & instead of * in new interfaces. It prevents users from doing bad things, such as passing a nullptr. Of course, I cannot easily change old ones.
Point 2: done

@drdanz
Copy link
Member

drdanz commented Dec 2, 2021

/rebase

…displays the internal hardware error

* Added new interface IJointFault with method: IJointFault
* IJointFault is now implemented by RemoteControlBoard and ControlBoard_nws_yarp
* fakeMotionControl.cpp now simulates an hardware fault when it receives a TorqueCommand > 1Nm
@drdanz drdanz force-pushed the yarpmotorgui_hwfault branch from 0caf315 to ed8c652 Compare December 2, 2021 11:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants