Skip to content

Commit 1b63a2e

Browse files
GiulioRomualdiicub
authored andcommitted
Temp (please rebase)
1 parent df5ac94 commit 1b63a2e

1 file changed

Lines changed: 19 additions & 5 deletions

File tree

src/WalkingModule/src/Module.cpp

Lines changed: 19 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -245,8 +245,11 @@ bool WalkingModule::configureSensorBridge(const yarp::os::Bottle& rf)
245245
}
246246

247247
auto polyRemapper = BipedalLocomotion::RobotInterface::constructMultipleAnalogSensorsRemapper(
248-
handler->getGroup("MULTIPLE_ANALOG_SENSORS_REMAPPER"));
248+
handler->getGroup("MULTIPLE_ANALOG_SENSORS_REMAPPER"), m_polyDrivers);
249249

250+
std::cerr << polyRemapper.poly << std::endl;
251+
std::cerr << polyRemapper.key << std::endl;
252+
250253
if(!polyRemapper.isValid())
251254
{
252255
yError() << "[WalkingModule::configureSensorBridge] Unable to initialize the remapper";
@@ -256,14 +259,25 @@ bool WalkingModule::configureSensorBridge(const yarp::os::Bottle& rf)
256259

257260

258261
yarp::dev::PolyDriverList list;
259-
for (auto& polyDriver : m_polyDrivers)
262+
list.push(polyRemapper.poly.get(), polyRemapper.key.c_str());
263+
// for (auto& polyDriver : m_polyDrivers)
264+
// {
265+
// list.push(polyDriver.poly.get(), polyDriver.key.c_str());
266+
// }
267+
268+
if (!m_sensorBridge.initialize(handler))
260269
{
261-
list.push(polyDriver.poly.get(), polyDriver.key.c_str());
270+
yError() << "[WalkingModule::configureSensorBridge] Unable to initialize the sensor bridge";
271+
return false;
262272
}
263273

274+
275+
using namespace std::chrono_literals;
276+
std::this_thread::sleep_for(2000ms);
277+
264278
if (!m_sensorBridge.setDriversList(list))
265279
{
266-
yError() << "[WalkingModule::configureSensorBridge] Unable to initialize the sensor bridge";
280+
yError() << "[WalkingModule::configureSensorBridge] Unable to set the driver list";
267281
return false;
268282
}
269283

@@ -529,7 +543,7 @@ bool WalkingModule::configure(yarp::os::ResourceFinder& rf)
529543

530544
bool useLeftFootImu = generalOptions.check("use_left_foot_imu", yarp::os::Value(false)).asBool();
531545
bool useRightFootImu = generalOptions.check("use_right_foot_imu", yarp::os::Value(false)).asBool();
532-
m_useFeetImu = useLeftFootImu || useRightFootImu;
546+
m_useFeetImu = true || useLeftFootImu || useRightFootImu;
533547
if(m_useFeetImu)
534548
{
535549
yarp::os::Bottle sensorBridgeOptions = rf.findGroup("SENSOR_BRIDGE");

0 commit comments

Comments
 (0)