Skip to content

Commit

Permalink
Rename device to EmulatedControlboard
Browse files Browse the repository at this point in the history
  • Loading branch information
PeterBowman committed Dec 24, 2019
1 parent 2701245 commit daf0bc5
Show file tree
Hide file tree
Showing 17 changed files with 169 additions and 169 deletions.
2 changes: 1 addition & 1 deletion libraries/YarpPlugins/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ add_subdirectory(CanBusPeak)
add_subdirectory(CanBusSocket)
add_subdirectory(CuiAbsolute)
add_subdirectory(DextraSerialControlboard)
add_subdirectory(FakeControlboard)
add_subdirectory(EmulatedControlboard)
add_subdirectory(FakeJoint)
add_subdirectory(Jr3)
add_subdirectory(LacqueyFetch)
Expand Down
41 changes: 41 additions & 0 deletions libraries/YarpPlugins/EmulatedControlboard/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
# Copyright: (C) 2017 Universidad Carlos III de Madrid
# Author: Juan G. Victores & Raul de Santos Rico

yarp_prepare_plugin(EmulatedControlboard
CATEGORY device
TYPE roboticslab::EmulatedControlboard
INCLUDE EmulatedControlboard.hpp
DEFAULT ON
EXTRA_CONFIG WRAPPER=controlboardwrapper2)

if(NOT SKIP_EmulatedControlboard)

if(NOT YARP_VERSION VERSION_GREATER_EQUAL 3.4)
set(CMAKE_INCLUDE_CURRENT_DIR TRUE) # yarp plugin builder needs this
endif()

yarp_add_plugin(EmulatedControlboard EmulatedControlboard.hpp
EmulatedControlboard.cpp
DeviceDriverImpl.cpp
IControlLimitsImpl.cpp
IControlModeImpl.cpp
IEncodersImpl.cpp
IEncodersTimedImpl.cpp
IPositionControlImpl.cpp
IPositionDirectImpl.cpp
IRemoteVariablesImpl.cpp
ITorqueControlImpl.cpp
IVelocityControlImpl.cpp
PeriodicThreadImpl.cpp
SharedArea.cpp)

target_link_libraries(EmulatedControlboard YARP::YARP_OS
YARP::YARP_dev
ROBOTICSLAB::ColorDebug)

yarp_install(TARGETS EmulatedControlboard
LIBRARY DESTINATION ${ROBOTICSLAB-YARP-DEVICES_DYNAMIC_PLUGINS_INSTALL_DIR}
ARCHIVE DESTINATION ${ROBOTICSLAB-YARP-DEVICES_STATIC_PLUGINS_INSTALL_DIR}
YARP_INI DESTINATION ${ROBOTICSLAB-YARP-DEVICES_PLUGIN_MANIFESTS_INSTALL_DIR})

endif()
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// -*- mode:C++; tab-width:4; c-basic-offset:4; indent-tabs-mode:nil -*-

#include "FakeControlboard.hpp"
#include "EmulatedControlboard.hpp"

#include <yarp/os/Bottle.h>
#include <yarp/os/Time.h>
Expand All @@ -9,7 +9,7 @@

// ------------------- DeviceDriver Related ------------------------------------

bool roboticslab::FakeControlboard::open(yarp::os::Searchable& config)
bool roboticslab::EmulatedControlboard::open(yarp::os::Searchable& config)
{
CD_DEBUG("config: %s\n", config.toString().c_str());

Expand Down Expand Up @@ -44,7 +44,7 @@ bool roboticslab::FakeControlboard::open(yarp::os::Searchable& config)
if (config.check("initPoss", "list of initialization positions (meters or degrees)"))
{
initPoss = config.find("initPoss").asList();
CD_INFO("FakeControlboard using individual initPoss: %s\n", initPoss->toString().c_str());
CD_INFO("EmulatedControlboard using individual initPoss: %s\n", initPoss->toString().c_str());

if ((unsigned)initPoss->size() != axes)
{
Expand All @@ -54,15 +54,15 @@ bool roboticslab::FakeControlboard::open(yarp::os::Searchable& config)
else
{
initPoss = 0;
CD_INFO("FakeControlboard not using individual initPoss, defaulting to genInitPos.\n");
CD_INFO("EmulatedControlboard not using individual initPoss, defaulting to genInitPos.\n");
}

yarp::os::Bottle* jointTols;

if (config.check("jointTols", "list of joint tolerances (meters or degrees)"))
{
jointTols = config.find("jointTols").asList();
CD_INFO("FakeControlboard using individual jointTols: %s\n", jointTols->toString().c_str());
CD_INFO("EmulatedControlboard using individual jointTols: %s\n", jointTols->toString().c_str());

if ((unsigned)jointTols->size() != axes)
{
Expand All @@ -72,15 +72,15 @@ bool roboticslab::FakeControlboard::open(yarp::os::Searchable& config)
else
{
jointTols = 0;
CD_INFO("FakeControlboard not using individual jointTols, defaulting to genJointTol.\n");
CD_INFO("EmulatedControlboard not using individual jointTols, defaulting to genJointTol.\n");
}

yarp::os::Bottle* maxLimits;

if (config.check("maxLimits", "list of max limits (meters or degrees)"))
{
maxLimits = config.find("maxLimits").asList();
CD_INFO("FakeControlboard using individual maxLimits: %s\n", maxLimits->toString().c_str());
CD_INFO("EmulatedControlboard using individual maxLimits: %s\n", maxLimits->toString().c_str());

if ((unsigned)maxLimits->size() != axes)
{
Expand All @@ -90,15 +90,15 @@ bool roboticslab::FakeControlboard::open(yarp::os::Searchable& config)
else
{
maxLimits = 0;
CD_INFO("FakeControlboard not using individual maxLimits, defaulting to genMaxLimit.\n");
CD_INFO("EmulatedControlboard not using individual maxLimits, defaulting to genMaxLimit.\n");
}

yarp::os::Bottle* minLimits;

if (config.check("minLimits", "list of min limits (meters or degrees)"))
{
minLimits = config.find("minLimits").asList();
CD_INFO("FakeControlboard using individual minLimits: %s\n", minLimits->toString().c_str());
CD_INFO("EmulatedControlboard using individual minLimits: %s\n", minLimits->toString().c_str());

if ((unsigned)minLimits->size() != axes)
{
Expand All @@ -108,15 +108,15 @@ bool roboticslab::FakeControlboard::open(yarp::os::Searchable& config)
else
{
minLimits = 0;
CD_INFO("FakeControlboard not using individual minLimits, defaulting to genMinLimit.\n");
CD_INFO("EmulatedControlboard not using individual minLimits, defaulting to genMinLimit.\n");
}

yarp::os::Bottle* refSpeeds;

if (config.check("refSpeeds", "list of ref speeds (meters/second or degrees/second)"))
{
refSpeeds = config.find("refSpeeds").asList();
CD_INFO("FakeControlboard using individual refSpeeds: %s\n", refSpeeds->toString().c_str());
CD_INFO("EmulatedControlboard using individual refSpeeds: %s\n", refSpeeds->toString().c_str());

if ((unsigned)refSpeeds->size() != axes)
{
Expand All @@ -126,15 +126,15 @@ bool roboticslab::FakeControlboard::open(yarp::os::Searchable& config)
else
{
refSpeeds = 0;
CD_INFO("FakeControlboard not using individual refSpeeds, defaulting to genRefSpeed.\n");
CD_INFO("EmulatedControlboard not using individual refSpeeds, defaulting to genRefSpeed.\n");
}

yarp::os::Bottle* encRawExposeds;

if (config.check("encRawExposeds", "list of EncRawExposeds (meters or degrees)"))
{
encRawExposeds = config.find("encRawExposeds").asList();
CD_INFO("FakeControlboard using individual encRawExposeds: %s\n", encRawExposeds->toString().c_str());
CD_INFO("EmulatedControlboard using individual encRawExposeds: %s\n", encRawExposeds->toString().c_str());

if ((unsigned)encRawExposeds->size() != axes)
{
Expand All @@ -144,15 +144,15 @@ bool roboticslab::FakeControlboard::open(yarp::os::Searchable& config)
else
{
encRawExposeds = 0;
CD_INFO("FakeControlboard not using individual encRawExposeds, defaulting to genEncRawExposed.\n");
CD_INFO("EmulatedControlboard not using individual encRawExposeds, defaulting to genEncRawExposed.\n");
}

yarp::os::Bottle* velRawExposeds;

if (config.check("velRawExposeds", "list of VelRawExposed (meters/second or degrees/second)"))
{
velRawExposeds = config.find("velRawExposeds").asList();
CD_INFO("FakeControlboard using individual velRawExposeds: %s\n", velRawExposeds->toString().c_str());
CD_INFO("EmulatedControlboard using individual velRawExposeds: %s\n", velRawExposeds->toString().c_str());

if ((unsigned)velRawExposeds->size() != axes)
{
Expand All @@ -162,7 +162,7 @@ bool roboticslab::FakeControlboard::open(yarp::os::Searchable& config)
else
{
velRawExposeds = 0;
CD_INFO("FakeControlboard not using individual velRawExposeds, defaulting to genVelRawExposed.\n");
CD_INFO("EmulatedControlboard not using individual velRawExposeds, defaulting to genVelRawExposed.\n");
}

encRawExposed.resize(axes);
Expand Down Expand Up @@ -208,10 +208,10 @@ bool roboticslab::FakeControlboard::open(yarp::os::Searchable& config)

// -----------------------------------------------------------------------------

bool roboticslab::FakeControlboard::close()
bool roboticslab::EmulatedControlboard::close()
{
PeriodicThread::stop();
CD_INFO("[FakeControlboard] close()\n");
CD_INFO("[EmulatedControlboard] close()\n");
return true;
}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
// -*- mode:C++; tab-width:4; c-basic-offset:4; indent-tabs-mode:nil -*-

#include "FakeControlboard.hpp"
#include "EmulatedControlboard.hpp"

#include <ColorDebug.h>

// ------------------- Miscellanea ------------------------------------

bool roboticslab::FakeControlboard::setPositionMode(int j)
bool roboticslab::EmulatedControlboard::setPositionMode(int j)
{
CD_DEBUG("(%d)\n", j);

Expand All @@ -28,7 +28,7 @@ bool roboticslab::FakeControlboard::setPositionMode(int j)

// -----------------------------------------------------------------------------

bool roboticslab::FakeControlboard::setVelocityMode(int j)
bool roboticslab::EmulatedControlboard::setVelocityMode(int j)
{
CD_DEBUG("(%d)\n", j);
controlMode = VELOCITY_MODE;
Expand All @@ -37,15 +37,15 @@ bool roboticslab::FakeControlboard::setVelocityMode(int j)

// -----------------------------------------------------------------------------

bool roboticslab::FakeControlboard::setTorqueMode(int j)
bool roboticslab::EmulatedControlboard::setTorqueMode(int j)
{
CD_DEBUG("(%d)\n", j);
return true;
}

// -----------------------------------------------------------------------------

bool roboticslab::FakeControlboard::setPositionDirectMode(int j)
bool roboticslab::EmulatedControlboard::setPositionDirectMode(int j)
{
CD_DEBUG("(%d)\n", j);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,22 +31,22 @@ namespace roboticslab

/**
* @ingroup TeoYarp
* \defgroup FakeControlboard
* \defgroup EmulatedControlboard
*
* @brief Contains teo::FakeControlboard.
* @brief Contains teo::EmulatedControlboard.
*
* @section FakeControlboard_install Installation
* @section EmulatedControlboard_install Installation
*
* The plugin is compiled when ENABLE_TeoYarp_FakeControlboard is activated (not default). For further
* The plugin is compiled when ENABLE_TeoYarp_EmulatedControlboard is activated (not default). For further
* installation steps refer to <a class="el" href="pages.html">your own system installation guidelines</a>.
*/

/**
* @ingroup FakeControlboard
* @ingroup EmulatedControlboard
* @brief Implements the YARP_dev IPositionControl, IVelocityControl, IEncodersTimed, etc.
* interface class member functions.
*/
class FakeControlboard : public yarp::dev::DeviceDriver,
class EmulatedControlboard : public yarp::dev::DeviceDriver,
public yarp::dev::IControlLimits,
public yarp::dev::IControlMode,
public yarp::dev::IEncodersTimed,
Expand All @@ -60,7 +60,7 @@ class FakeControlboard : public yarp::dev::DeviceDriver,
public:

// Set the thread period in the class constructor
FakeControlboard() : PeriodicThread(DEFAULT_JMC_MS * 0.001) {} // In seconds
EmulatedControlboard() : PeriodicThread(DEFAULT_JMC_MS * 0.001) {} // In seconds

// ------- IPositionControl declarations. Implementation in IPositionControlImpl.cpp -------

Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
// -*- mode:C++; tab-width:4; c-basic-offset:4; indent-tabs-mode:nil -*-

#include "FakeControlboard.hpp"
#include "EmulatedControlboard.hpp"

#include <ColorDebug.h>

// ------------------- IControlLimits Related ------------------------------------

bool roboticslab::FakeControlboard::setLimits(int axis, double min, double max)
bool roboticslab::EmulatedControlboard::setLimits(int axis, double min, double max)
{
if (axis >= int(axes))
{
Expand All @@ -23,7 +23,7 @@ bool roboticslab::FakeControlboard::setLimits(int axis, double min, double max)

// -----------------------------------------------------------------------------

bool roboticslab::FakeControlboard::getLimits(int axis, double *min, double *max)
bool roboticslab::EmulatedControlboard::getLimits(int axis, double *min, double *max)
{
if (axis >= int(axes))
{
Expand All @@ -40,15 +40,15 @@ bool roboticslab::FakeControlboard::getLimits(int axis, double *min, double *max

// -----------------------------------------------------------------------------

bool roboticslab::FakeControlboard::setVelLimits(int axis, double min, double max)
bool roboticslab::EmulatedControlboard::setVelLimits(int axis, double min, double max)
{
CD_WARNING("Not implemented.\n");
return true;
}

// -----------------------------------------------------------------------------

bool roboticslab::FakeControlboard::getVelLimits(int axis, double *min, double *max)
bool roboticslab::EmulatedControlboard::getVelLimits(int axis, double *min, double *max)
{
if (axis >= int(axes))
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
// -*- mode:C++; tab-width:4; c-basic-offset:4; indent-tabs-mode:nil -*-

#include "FakeControlboard.hpp"
#include "EmulatedControlboard.hpp"

#include <yarp/os/Vocab.h>
#include <ColorDebug.h>

// ------------------- IControlMode Related ------------------------------------

bool roboticslab::FakeControlboard::getControlMode(int j, int *mode)
bool roboticslab::EmulatedControlboard::getControlMode(int j, int *mode)
{
//CD_DEBUG("\n"); //-- Way too verbose.
if (controlMode == POSITION_MODE)
Expand All @@ -33,7 +33,7 @@ bool roboticslab::FakeControlboard::getControlMode(int j, int *mode)

// -----------------------------------------------------------------------------

bool roboticslab::FakeControlboard::getControlModes(int *modes)
bool roboticslab::EmulatedControlboard::getControlModes(int *modes)
{
//CD_DEBUG("\n"); //-- Way too verbose.
bool ok = true;
Expand All @@ -48,7 +48,7 @@ bool roboticslab::FakeControlboard::getControlModes(int *modes)

// -----------------------------------------------------------------------------

bool roboticslab::FakeControlboard::getControlModes(const int n_joint, const int *joints, int *modes)
bool roboticslab::EmulatedControlboard::getControlModes(const int n_joint, const int *joints, int *modes)
{
CD_DEBUG("(%d)\n", n_joint);
bool ok = true;
Expand All @@ -63,7 +63,7 @@ bool roboticslab::FakeControlboard::getControlModes(const int n_joint, const int

// -----------------------------------------------------------------------------

bool roboticslab::FakeControlboard::setControlMode(const int j, const int mode)
bool roboticslab::EmulatedControlboard::setControlMode(const int j, const int mode)
{
CD_DEBUG("(%d, %s)\n", j, yarp::os::Vocab::decode(mode).c_str());

Expand All @@ -90,7 +90,7 @@ bool roboticslab::FakeControlboard::setControlMode(const int j, const int mode)

// -----------------------------------------------------------------------------

bool roboticslab::FakeControlboard::setControlModes(const int n_joint, const int *joints, int *modes)
bool roboticslab::EmulatedControlboard::setControlModes(const int n_joint, const int *joints, int *modes)
{
CD_DEBUG("(%d)\n", n_joint);
bool ok = true;
Expand All @@ -105,7 +105,7 @@ bool roboticslab::FakeControlboard::setControlModes(const int n_joint, const int

// -----------------------------------------------------------------------------

bool roboticslab::FakeControlboard::setControlModes(int *modes)
bool roboticslab::EmulatedControlboard::setControlModes(int *modes)
{
CD_DEBUG("\n");
bool ok = true;
Expand Down
Loading

0 comments on commit daf0bc5

Please sign in to comment.