bool MSDevice_BTsender::notifyEnter(SUMOVehicle& veh, Notification reason) { if (reason == MSMoveReminder::NOTIFICATION_DEPARTED && sVehicles.find(veh.getID()) == sVehicles.end()) { sVehicles[veh.getID()] = new VehicleInformation(veh.getID()); } sVehicles[veh.getID()]->updates.push_back(VehicleState( MSNet::getInstance()->getCurrentTimeStep(), veh.getSpeed(), static_cast<MSVehicle&>(veh).getAngle(), static_cast<MSVehicle&>(veh).getPosition(), static_cast<MSVehicle&>(veh).getLane()->getID(), veh.getPositionOnLane() )); return true; }
bool MSDevice_BTsender::notifyMove(SUMOVehicle& veh, SUMOReal /* oldPos */, SUMOReal newPos, SUMOReal newSpeed) { if (sVehicles.find(veh.getID()) == sVehicles.end()) { WRITE_WARNING("btsender: Can not update position of a vehicle that is not within the road network (" + veh.getID() + ")."); return true; } sVehicles[veh.getID()]->updates.push_back(VehicleState( MSNet::getInstance()->getCurrentTimeStep(), newSpeed, static_cast<MSVehicle&>(veh).getAngle(), static_cast<MSVehicle&>(veh).getPosition(), static_cast<MSVehicle&>(veh).getLane()->getID(), newPos )); return true; }
bool MSDevice_BTsender::notifyLeave(SUMOVehicle& veh, SUMOReal /* lastPos */, Notification reason) { if (reason < MSMoveReminder::NOTIFICATION_TELEPORT) { return true; } if (sVehicles.find(veh.getID()) == sVehicles.end()) { WRITE_WARNING("btsender: Can not update position of a vehicle that is not within the road network (" + veh.getID() + ")."); return true; } sVehicles[veh.getID()]->updates.push_back(VehicleState( MSNet::getInstance()->getCurrentTimeStep(), veh.getSpeed(), static_cast<MSVehicle&>(veh).getAngle(), static_cast<MSVehicle&>(veh).getPosition(), static_cast<MSVehicle&>(veh).getLane()->getID(), veh.getPositionOnLane() )); if (reason >= MSMoveReminder::NOTIFICATION_TELEPORT) { sVehicles[veh.getID()]->amOnNet = false; } if (reason >= MSMoveReminder::NOTIFICATION_ARRIVED) { sVehicles[veh.getID()]->haveArrived = true; } return true; }
VehicleState VehicleUpdater::getQuadCopterPositon() { return VehicleState(9, 10, 11, 12.0f); }
VehicleState VehicleUpdater::getATVPosition() { return VehicleState(5, 6, 7, 8.0f); }
VehicleState VehicleUpdater::getRosbeePosition() { return VehicleState(1, 2, 3, 4.0f); }