Here you have the methods you mentioned:
BatteryDriver::BatteryDriver(ConfigFile* cf, int section)
: Driver(cf, section, false,
if(cf->ReadDeviceAddr(&this->can_addr, section, "requires",
PLAYER_OPAQUE_CODE, -1, NULL) != 0)
printf("Will subscribe to opaque:%d\n", this->can_addr.index);
// Read the data updating period
cf->ReadInt(section, "period", 10);
std::cout << "The
data updating period is " << this->period << " seconds"
puts("Battery driver initialising");
// Retrieve the
handle to the can device.
PLAYER_ERROR("unable to locate suitable can device");
// Subscribe my
message queue to the can device.
if(this->can_dev->Subscribe(this->InQueue) != 0)
PLAYER_ERROR("unable to subscribe to can device");
// Start the device thread; spawns a new
thread and executes
Battery driver down");
// Stop and join the driver thread
// Unsubscribe from can
puts("Battery driver has been shutdown");
I checked out some drivers you mentioned and I have already written some
other drivers that do inter device subscription without any problem (usually
subscribing to simulation interfaces, for Stage stuff). I will check out
them again just in case. Thanks!