diff --git a/libraries/YarpPlugins/YarpOpenraveControlboard/CMakeLists.txt b/libraries/YarpPlugins/YarpOpenraveControlboard/CMakeLists.txt index 6fca37b2..b3698d29 100644 --- a/libraries/YarpPlugins/YarpOpenraveControlboard/CMakeLists.txt +++ b/libraries/YarpPlugins/YarpOpenraveControlboard/CMakeLists.txt @@ -24,6 +24,7 @@ yarp_add_plugin(YarpOpenraveControlboard YarpOpenraveControlboard.hpp IPositionControlImpl.cpp IPositionControl2Impl.cpp IPositionDirectImpl.cpp + IRemoteVariablesImpl.cpp ITorqueControlImpl.cpp IVelocityControlImpl.cpp IVelocityControl2Impl.cpp) diff --git a/libraries/YarpPlugins/YarpOpenraveControlboard/IRemoteVariablesImpl.cpp b/libraries/YarpPlugins/YarpOpenraveControlboard/IRemoteVariablesImpl.cpp new file mode 100644 index 00000000..8cfeb4e5 --- /dev/null +++ b/libraries/YarpPlugins/YarpOpenraveControlboard/IRemoteVariablesImpl.cpp @@ -0,0 +1,43 @@ +// -*- mode:C++; tab-width:4; c-basic-offset:4; indent-tabs-mode:nil -*- + +#include "YarpOpenraveControlboard.hpp" + +#include + +#include + +// ------------------- IRemoteVariables Related ------------------------------------ + +bool roboticslab::YarpOpenraveControlboard::getRemoteVariable(std::string key, yarp::os::Bottle& val) +{ + CD_DEBUG("%s\n", key.c_str()); + + val.clear(); + + if (key == "ptModeMs") + { + val.addDouble(std::numeric_limits::max()); + } + + return true; +} + +// ----------------------------------------------------------------------------- + +bool roboticslab::YarpOpenraveControlboard::setRemoteVariable(std::string key, const yarp::os::Bottle& val) +{ + CD_DEBUG("%s\n", key.c_str()); + return true; +} + +// ----------------------------------------------------------------------------- + +bool roboticslab::YarpOpenraveControlboard::getRemoteVariablesList(yarp::os::Bottle* listOfKeys) +{ + CD_DEBUG("\n"); + listOfKeys->clear(); + listOfKeys->addString("ptModeMs"); + return true; +} + +// ----------------------------------------------------------------------------- diff --git a/libraries/YarpPlugins/YarpOpenraveControlboard/YarpOpenraveControlboard.hpp b/libraries/YarpPlugins/YarpOpenraveControlboard/YarpOpenraveControlboard.hpp index 92584ea2..d92444a3 100644 --- a/libraries/YarpPlugins/YarpOpenraveControlboard/YarpOpenraveControlboard.hpp +++ b/libraries/YarpPlugins/YarpOpenraveControlboard/YarpOpenraveControlboard.hpp @@ -29,13 +29,14 @@ namespace roboticslab */ class YarpOpenraveControlboard : YarpOpenraveBase, public yarp::dev::DeviceDriver, - public yarp::dev::IControlLimits2, //-- IControlLimits2 inherits from IControlLimits - public yarp::dev::IControlMode2, //-- IControlMode2 inherits from IControlMode - public yarp::dev::IEncodersTimed, //-- IEncodersTimed inherits from IEncoders - public yarp::dev::IPositionControl2, //-- IPositionControl2 inherits from IPositionControl + public yarp::dev::IControlLimits2, + public yarp::dev::IControlMode2, + public yarp::dev::IEncodersTimed, + public yarp::dev::IPositionControl2, public yarp::dev::IPositionDirect, public yarp::dev::ITorqueControl, - public yarp::dev::IVelocityControl2 //-- IVelocityControl2 inherits from IVelocityControl + public yarp::dev::IVelocityControl2, + public yarp::dev::IRemoteVariables { public: @@ -640,6 +641,14 @@ class YarpOpenraveControlboard : YarpOpenraveBase, virtual bool setBemfParam(int j, double bemf); #endif // YARP_VERSION_MAJOR != 3 + // ------- IRemoteVariables declarations. Implementation in IRemoteVariablesImpl.cpp ------- + + virtual bool getRemoteVariable(std::string key, yarp::os::Bottle& val); + + virtual bool setRemoteVariable(std::string key, const yarp::os::Bottle& val); + + virtual bool getRemoteVariablesList(yarp::os::Bottle* listOfKeys); + // -------- DeviceDriver declarations. Implementation in IDeviceImpl.cpp -------- /**