Skip to content

Commit

Permalink
Drop custom set/get vocabs, use YARP standard
Browse files Browse the repository at this point in the history
  • Loading branch information
PeterBowman committed Jan 22, 2018
1 parent 147f6bf commit 7d2e073
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
#include "CartesianControlClient.hpp"

#include <yarp/os/Time.h>
#include <yarp/dev/ControlBoardInterfaces.h> // vocabs: OK, FAIL, SET, GET

#include <ColorDebug.hpp>

Expand Down Expand Up @@ -231,7 +232,7 @@ bool roboticslab::CartesianControlClient::setParameter(int vocab, double value)
{
yarp::os::Bottle cmd, response;

cmd.addVocab(VOCAB_CC_CONFIG_SET);
cmd.addVocab(VOCAB_SET);
cmd.addVocab(vocab);
cmd.addDouble(value);

Expand All @@ -251,7 +252,7 @@ bool roboticslab::CartesianControlClient::getParameter(int vocab, double * value
{
yarp::os::Bottle cmd, response;

cmd.addVocab(VOCAB_CC_CONFIG_GET);
cmd.addVocab(VOCAB_GET);
cmd.addVocab(vocab);

rpcClient.write(cmd, response);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,8 @@
#include <yarp/os/all.h>
#include <yarp/dev/Drivers.h>
#include <yarp/dev/PolyDriver.h>
#include <yarp/dev/ControlBoardInterfaces.h>

#include <iostream> // only windows
#include <vector>

#include "ICartesianControl.h"
#include "KinematicRepresentation.hpp"
Expand Down
6 changes: 4 additions & 2 deletions libraries/YarpPlugins/CartesianControlServer/RpcResponder.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@

#include "CartesianControlServer.hpp"

#include <yarp/dev/ControlBoardInterfaces.h> // vocabs: OK, FAIL, SET, GET

#include <ColorDebug.hpp>

// ------------------- RpcResponder Related ------------------------------------
Expand Down Expand Up @@ -33,9 +35,9 @@ bool roboticslab::RpcResponder::respond(const yarp::os::Bottle& in, yarp::os::Bo
return handleRunnableCmdMsg(in, out, &ICartesianControl::stopControl);
case VOCAB_CC_TOOL:
return handleConsumerCmdMsg(in, out, &ICartesianControl::tool);
case VOCAB_CC_CONFIG_SET:
case VOCAB_SET:
return handleParameterSetter(in, out);
case VOCAB_CC_CONFIG_GET:
case VOCAB_GET:
return handleParameterGetter(in, out);
default:
return DeviceResponder::respond(in, out);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@

#include "CartesianControlServer.hpp"

#include <vector>

#include <ColorDebug.hpp>

// ------------------- StreamResponder Related ------------------------------------
Expand Down
2 changes: 0 additions & 2 deletions libraries/YarpPlugins/ICartesianControl.h
Original file line number Diff line number Diff line change
Expand Up @@ -77,8 +77,6 @@
*/

// Controller configuration (parameter keys)
#define VOCAB_CC_CONFIG_SET VOCAB3('c','p','s') ///< Set parameter
#define VOCAB_CC_CONFIG_GET VOCAB3('c','p','g') ///< Get parameter
#define VOCAB_CC_CONFIG_GAIN VOCAB4('c','p','c','g') ///< Controller gain
#define VOCAB_CC_CONFIG_MAX_JOINT_VEL VOCAB4('c','p','j','v') ///< Maximum joint velocity
#define VOCAB_CC_CONFIG_TRAJ_DURATION VOCAB4('c','p','t','d') ///< Trajectory duration
Expand Down

0 comments on commit 7d2e073

Please sign in to comment.