Skip to content

Commit

Permalink
Reuse monitor object in subdevices
Browse files Browse the repository at this point in the history
  • Loading branch information
PeterBowman committed Feb 25, 2018
1 parent dcbd1d6 commit fef5657
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -102,9 +102,11 @@ bool roboticslab::AmorCartesianControl::open(yarp::os::Searchable& config)
return false;
}

cartesianDeviceOptions.put("device", "KdlSolver");
std::string solverStr = "KdlSolver";
cartesianDeviceOptions.put("device", solverStr);
cartesianDeviceOptions.put("mins", yarp::os::Value::makeList(qMin.toString().c_str()));
cartesianDeviceOptions.put("maxs", yarp::os::Value::makeList(qMax.toString().c_str()));
cartesianDeviceOptions.setMonitor(config.getMonitor(), solverStr.c_str());

if (!cartesianDevice.open(cartesianDeviceOptions))
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ bool roboticslab::BasicCartesianControl::open(yarp::os::Searchable& config) {
yarp::os::Property robotOptions;
robotOptions.fromString( config.toString() );
robotOptions.put("device",robotStr);
robotOptions.setMonitor(config.getMonitor(), robotStr.c_str());
robotDevice.open(robotOptions);
if( ! robotDevice.isValid() ) {
CD_ERROR("robot device not valid: %s.\n",robotStr.c_str());
Expand Down Expand Up @@ -87,6 +88,7 @@ bool roboticslab::BasicCartesianControl::open(yarp::os::Searchable& config) {
solverOptions.put("device",solverStr);
solverOptions.put("mins", yarp::os::Value::makeList(qMin.toString().c_str()));
solverOptions.put("maxs", yarp::os::Value::makeList(qMax.toString().c_str()));
solverOptions.setMonitor(config.getMonitor(), solverStr.c_str());

solverDevice.open(solverOptions);
if( ! solverDevice.isValid() ) {
Expand Down

0 comments on commit fef5657

Please sign in to comment.