Skip to content

Commit

Permalink
Store dummy interaction mode, fix control mode getter
Browse files Browse the repository at this point in the history
  • Loading branch information
PeterBowman committed Jan 17, 2024
1 parent e1bf8c4 commit e05e64a
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions libraries/YarpPlugins/FakeJoint/FakeJoint.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ class FakeJoint : public yarp::dev::DeviceDriver,
// --------- IControlModeRaw declarations ---------

bool getControlModeRaw(int j, int * mode) override
{ *mode = VOCAB_CM_CONFIGURED; return true; }
{ *mode = controlMode; return true; }
bool getControlModesRaw(int * modes) override
{ return getControlModeRaw(0, &modes[0]); }
bool getControlModesRaw(int n_joint, const int * joints, int * modes) override
Expand Down Expand Up @@ -213,13 +213,13 @@ class FakeJoint : public yarp::dev::DeviceDriver,
// ------- IInteractionModeRaw declarations -------

bool getInteractionModeRaw(int axis, yarp::dev::InteractionModeEnum * mode) override
{ *mode = yarp::dev::InteractionModeEnum::VOCAB_IM_UNKNOWN; return true; }
{ *mode = interactionMode; return true; }
bool getInteractionModesRaw(yarp::dev::InteractionModeEnum * modes) override
{ return getInteractionModeRaw(0, &modes[0]); }
bool getInteractionModesRaw(int n_joints, int * joints, yarp::dev::InteractionModeEnum * modes) override
{ return getInteractionModeRaw(0, &modes[0]); }
bool setInteractionModeRaw(int axis, yarp::dev::InteractionModeEnum mode) override
{ return true; }
{ interactionMode = mode; return true; }
bool setInteractionModesRaw(yarp::dev::InteractionModeEnum * modes) override
{ return true; }
bool setInteractionModesRaw(int n_joints, int * joints, yarp::dev::InteractionModeEnum * modes) override
Expand Down Expand Up @@ -473,6 +473,7 @@ class FakeJoint : public yarp::dev::DeviceDriver,
private:
std::string jointName;
int controlMode {VOCAB_CM_CONFIGURED};
yarp::dev::InteractionModeEnum interactionMode {yarp::dev::VOCAB_IM_UNKNOWN};
};

} // namespace roboticslab
Expand Down

0 comments on commit e05e64a

Please sign in to comment.