Skip to content

Commit

Permalink
Improve YARP device options
Browse files Browse the repository at this point in the history
  • Loading branch information
PeterBowman committed Mar 15, 2018
1 parent a000a92 commit 3a69cbf
Show file tree
Hide file tree
Showing 7 changed files with 43 additions and 37 deletions.
4 changes: 2 additions & 2 deletions libraries/YarpPlugins/AravisGigE/DeviceDriverImpl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ bool roboticslab::AravisGigE::open(yarp::os::Searchable &config)
CD_INFO("Opening AravisGigE device\n");

//-- Configuration of Aravis GigE Camera device
if (config.check("fake"))
if (config.check("fake", "enable fake Aravis camera"))
{
CD_INFO("Enabling fake Aravis camera\n");
arv_enable_interface("Fake"); //-- Enables fake Aravis cameras (useful for debug / testing)
Expand Down Expand Up @@ -67,7 +67,7 @@ bool roboticslab::AravisGigE::open(yarp::os::Searchable &config)
//-- Once we have a camera, we obtain the camera properties limits and initial values
pixelFormats = arv_camera_get_available_pixel_formats(camera, &pixelFormatsCnt);
pixelFormat = arv_camera_get_pixel_format(camera);
if (config.check("introspection"))
if (config.check("introspection", "print available pixel formats on device init"))
{
//-- List all available formats
guint n_pixel_formats;
Expand Down
2 changes: 1 addition & 1 deletion libraries/YarpPlugins/CuiAbsolute/DeviceDriverImpl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ bool roboticslab::CuiAbsolute::open(yarp::os::Searchable& config)

this->canId = config.check("canId",0,"can bus ID").asInt();
this->tr = config.check("tr",1,"reduction").asInt();
this->ptModeMs = config.check("ptModeMs",0,"ptMode ms").asInt();
this->ptModeMs = config.check("ptModeMs",0,"ptMode (milliseconds)").asInt();
this->ptPointCounter = 0;
this->ptMovementDone = false;
this->targetReached = false;
Expand Down
36 changes: 20 additions & 16 deletions libraries/YarpPlugins/FakeControlboard/DeviceDriverImpl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -11,16 +11,20 @@

bool roboticslab::FakeControlboard::open(yarp::os::Searchable& config)
{
CD_DEBUG("config: %s\n", config.toString().c_str());
yarp::os::SearchMonitor * monitor = config.getMonitor();
CD_WARNING("monitor: %d\n", monitor);

axes = config.check("axes", DEFAULT_AXES, "number of axes to control").asInt();
jmcMs = config.check("jmcMs", DEFAULT_JMC_MS, "period of JMC rate thread").asInt();

double genInitPos = config.check("genInitPos", DEFAULT_GEN_INIT_POS, "general initialization positions").asDouble();
double genJointTol = config.check("genJointTol", DEFAULT_GEN_JOINT_TOL, "general joint tolerances").asDouble();
double genMaxLimit = config.check("genMaxLimit", DEFAULT_GEN_MAX_LIMIT, "general max limits").asDouble();
double genMinLimit = config.check("genMinLimit", DEFAULT_GEN_MIN_LIMIT, "general min limits").asDouble();
double genRefSpeed = config.check("genRefSpeed", DEFAULT_GEN_REF_SPEED, "general ref speed").asDouble();
double genEncRawExposed = config.check("genEncRawExposed", DEFAULT_GEN_ENC_RAW_EXPOSED, "general EncRawExposed").asDouble();
double genVelRawExposed = config.check("genVelRawExposed", DEFAULT_GEN_VEL_RAW_EXPOSED, "general VelRawExposed").asDouble();
jmcMs = config.check("jmcMs", DEFAULT_JMC_MS, "period of JMC rate thread (milliseconds)").asInt();

double genInitPos = config.check("genInitPos", DEFAULT_GEN_INIT_POS, "general initialization positions (meters or degrees)").asDouble();
double genJointTol = config.check("genJointTol", DEFAULT_GEN_JOINT_TOL, "general joint tolerances (meters or degrees)").asDouble();
double genMaxLimit = config.check("genMaxLimit", DEFAULT_GEN_MAX_LIMIT, "general max limits (meters or degrees)").asDouble();
double genMinLimit = config.check("genMinLimit", DEFAULT_GEN_MIN_LIMIT, "general min limits (meters or degrees)").asDouble();
double genRefSpeed = config.check("genRefSpeed", DEFAULT_GEN_REF_SPEED, "general ref speed (meters/second or degrees/second)").asDouble();
double genEncRawExposed = config.check("genEncRawExposed", DEFAULT_GEN_ENC_RAW_EXPOSED, "general EncRawExposed (meters or degrees)").asDouble();
double genVelRawExposed = config.check("genVelRawExposed", DEFAULT_GEN_VEL_RAW_EXPOSED, "general VelRawExposed (meters/second or degrees/second)").asDouble();

int modePosVelInt = config.check("modePosVel", DEFAULT_MODE_POS_VEL, "0:pos, 1:vel").asInt();

Expand All @@ -39,7 +43,7 @@ bool roboticslab::FakeControlboard::open(yarp::os::Searchable& config)

yarp::os::Bottle* initPoss;

if (config.check("initPoss"))
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());
Expand All @@ -57,7 +61,7 @@ bool roboticslab::FakeControlboard::open(yarp::os::Searchable& config)

yarp::os::Bottle* jointTols;

if (config.check("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());
Expand All @@ -75,7 +79,7 @@ bool roboticslab::FakeControlboard::open(yarp::os::Searchable& config)

yarp::os::Bottle* maxLimits;

if (config.check("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());
Expand All @@ -93,7 +97,7 @@ bool roboticslab::FakeControlboard::open(yarp::os::Searchable& config)

yarp::os::Bottle* minLimits;

if (config.check("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());
Expand All @@ -111,7 +115,7 @@ bool roboticslab::FakeControlboard::open(yarp::os::Searchable& config)

yarp::os::Bottle* refSpeeds;

if (config.check("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());
Expand All @@ -129,7 +133,7 @@ bool roboticslab::FakeControlboard::open(yarp::os::Searchable& config)

yarp::os::Bottle* encRawExposeds;

if (config.check("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());
Expand All @@ -147,7 +151,7 @@ bool roboticslab::FakeControlboard::open(yarp::os::Searchable& config)

yarp::os::Bottle* velRawExposeds;

if (config.check("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());
Expand Down
10 changes: 5 additions & 5 deletions libraries/YarpPlugins/FakeJoint/DeviceDriverImpl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,14 @@ bool roboticslab::FakeJoint::open(yarp::os::Searchable& config)

this->canId = config.check("canId",0,"can bus ID").asInt();
this->tr = config.check("tr",0,"reduction").asInt();
this->ptModeMs = config.check("ptModeMs",0,"ptMode ms").asInt();
this->ptModeMs = config.check("ptModeMs",0,"ptMode (milliseconds)").asInt();
this->ptPointCounter = 0;
this->ptMovementDone = false;
this->targetReached = false;
this->max = config.check("max",0,"max").asDouble();
this->min = config.check("min",0,"min").asDouble();
this->maxVel = config.check("maxVel",1000,"maxVel").asDouble();
this->minVel = config.check("minVel",0,"minVel").asDouble();
this->max = config.check("max",0,"max (meters or degrees)").asDouble();
this->min = config.check("min",0,"min (meters or degrees)").asDouble();
this->maxVel = config.check("maxVel",1000,"maxVel (meters/second or degrees/second)").asDouble();
this->minVel = config.check("minVel",0,"minVel (meters/second or degrees/second)").asDouble();
this->refAcceleration = 0;
this->refSpeed = 0;
this->encoder = 0;
Expand Down
2 changes: 1 addition & 1 deletion libraries/YarpPlugins/LacqueyFetch/DeviceDriverImpl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ bool roboticslab::LacqueyFetch::open(yarp::os::Searchable& config)

this->canId = config.check("canId",0,"can bus ID").asInt();
this->tr = config.check("tr",0,"reduction").asInt();
this->ptModeMs = config.check("ptModeMs",0,"ptMode ms").asInt();
this->ptModeMs = config.check("ptModeMs",0,"ptMode (milliseconds)").asInt();
this->ptPointCounter = 0;
this->ptMovementDone = false;
this->targetReached = false;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,7 @@ bool roboticslab::ProximitySensorsClient::open(yarp::os::Searchable& config)

std::string carrier;

if (config.check("usePortMonitor") || (config.check("portMonitorType") && config.check("portMonitorContext")
&& config.check("portMonitorFile")))
if (config.check("usePortMonitor", "enable port monitoring and additional options"))
{
std::string pmType = config.check("portMonitorType", yarp::os::Value(DEFAULT_PORTMONITOR_TYPE),
"port monitor type").asString();
Expand All @@ -43,9 +42,12 @@ bool roboticslab::ProximitySensorsClient::open(yarp::os::Searchable& config)
CD_INFO("Using carrier: %s\n", carrier.c_str());
}

thresholdGripper = config.check("thresholdGripper", yarp::os::Value(DEFAULT_THRESHOLD_GRIPPER)).asDouble();
thresholdAlertHigh = config.check("thresholdAlertHigh", yarp::os::Value(DEFAULT_THRESHOLD_ALERT_HIGH)).asDouble();
thresholdAlertLow = config.check("thresholdAlertLow", yarp::os::Value(DEFAULT_THRESHOLD_ALERT_LOW)).asDouble();
thresholdGripper = config.check("thresholdGripper", yarp::os::Value(DEFAULT_THRESHOLD_GRIPPER),
"sensor threshold (gripper reach distance)").asDouble();
thresholdAlertHigh = config.check("thresholdAlertHigh", yarp::os::Value(DEFAULT_THRESHOLD_ALERT_HIGH),
"sensor threshold (proximity alert, high level)").asDouble();
thresholdAlertLow = config.check("thresholdAlertLow", yarp::os::Value(DEFAULT_THRESHOLD_ALERT_LOW),
"sensor threshold (proximity alert, low level)").asDouble();

if (!yarp::os::Network::connect(remote, local, carrier))
{
Expand Down
14 changes: 7 additions & 7 deletions libraries/YarpPlugins/TechnosoftIpos/DeviceDriverImpl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -8,18 +8,18 @@ bool roboticslab::TechnosoftIpos::open(yarp::os::Searchable& config)

// -- .ini parameters (in order)
this->canId = config.check("canId",0,"can bus ID").asInt();
this->max = config.check("max",0,"max").asDouble();
this->min = config.check("min",0,"min").asDouble();
this->maxVel = config.check("maxVel",1000,"maxVel").asDouble();
this->minVel = config.check("minVel",0,"minVel").asDouble();
this->max = config.check("max",0,"max (meters or degrees)").asDouble();
this->min = config.check("min",0,"min (meters or degrees)").asDouble();
this->maxVel = config.check("maxVel",1000,"maxVel (meters/second or degrees/second)").asDouble();
this->minVel = config.check("minVel",0,"minVel (meters/second or degrees/second)").asDouble();
this->tr = config.check("tr",0,"reduction").asDouble();
this->refAcceleration = config.check("refAcceleration",0,"ref acceleration").asDouble();
this->refSpeed = config.check("refSpeed",0,"ref speed").asDouble();
this->refAcceleration = config.check("refAcceleration",0,"ref acceleration (meters/second^2 or degrees/second^2)").asDouble();
this->refSpeed = config.check("refSpeed",0,"ref speed (meters/second or degrees/second)").asDouble();
this->encoderPulses = config.check("encoderPulses",0,"encoderPulses").asInt();

// -- other parameters...
this->k = config.check("k",0,"motor constant").asDouble();
this->ptModeMs = config.check("ptModeMs",0,"ptMode ms").asInt();
this->ptModeMs = config.check("ptModeMs",0,"ptMode (milliseconds)").asInt();
this->ptPointCounter = 0;
this->ptMovementDone = false;
this->targetReached = false;
Expand Down

0 comments on commit 3a69cbf

Please sign in to comment.