Skip to content

Commit

Permalink
Update namespace, interface API and if loop
Browse files Browse the repository at this point in the history
  • Loading branch information
MSECode authored and Nicogene committed Nov 7, 2024
1 parent a26b4d1 commit ab037dc
Showing 1 changed file with 14 additions and 12 deletions.
26 changes: 14 additions & 12 deletions src/telemetryDeviceDumper/TelemetryDeviceDumper.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
using namespace robometry;
using namespace yarp::os;
using namespace yarp::dev;
using namespace iCub;

constexpr double log_thread_default{ 0.010 };

Expand Down Expand Up @@ -258,7 +259,8 @@ bool TelemetryDeviceDumper::open(yarp::os::Searchable& config) {
}

// Open RawValuesPublisherClient
if (settings.logIRawValuesPublisher) {
if (settings.logIRawValuesPublisher)
{
yarp::os::Property rawValPubClientProp{{"device", Value("rawValuesPublisherClient")},
{"remote", Value(settings.rawValuesPublisherRemoteName)}, //must have the name of the remote port defined in the related nws, i.e. RawValuesPublisherServer
{"local", Value("/telemetryDeviceDumper" + settings.rawValuesPublisherRemoteName + "/client")}};
Expand Down Expand Up @@ -332,15 +334,15 @@ bool TelemetryDeviceDumper::openRemapperControlBoard(yarp::os::Searchable& confi
}

int axes = 0;
if (settings.logControlBoardQuantities){
ok = ok && remappedControlBoardInterfaces.encs->getAxes(&axes);
if (ok) {
this->resizeBuffers(axes);
}
else {
yError() << "telemetryDeviceDumper: open impossible to use the necessary interfaces in remappedControlBoard";
return ok;
}
ok = ok && remappedControlBoardInterfaces.encs->getAxes(&axes);
if (ok)
{
this->resizeBuffers(axes);
}
else
{
yError() << "telemetryDeviceDumper: open impossible to use the necessary interfaces in remappedControlBoard";
return ok;
}

return true;
Expand Down Expand Up @@ -451,9 +453,9 @@ bool TelemetryDeviceDumper::attachAll(const yarp::dev::PolyDriverList& device2at

if (ok && (settings.logIRawValuesPublisher))
{
// COnfiguring channels using metadata from interfaces
// Configuring channels using metadata from interfaces
rawValuesKeyMetadataMap metadata = {}; // I just need to call it once while configuring (I think)
iravap->getMetadataMAP(metadata);
iravap->getMetadataMap(metadata);
for (auto [k, m] : metadata.metadataMap)
{
ok = ok && bufferManager.addChannel({ "raw_data_values::"+k, {static_cast<uint16_t>(m.size), 1}, m.rawValueNames });
Expand Down

0 comments on commit ab037dc

Please sign in to comment.