Team302 / 2024Crescendo

MIT License
2 stars 0 forks source link

Clean up Drive Path Planner #111

Open witcpalek opened 10 months ago

witcpalek commented 10 months ago

Path Planner was revamped for 2024, so we need to re-work this class to use the new methods

witcpalek commented 10 months ago

Find the TODO in DrivePathPlanner::Init

Add the following lines at that location:

auto path = PathPlannerPath::fromPathFile(m_pathname);
if (path.get() != nullptr)
{
    m_trajectory = path.get()->getTrajectory();
}

Delete commented out todo code in IsDone replace

    if (trajectoryDrive->IsDone()) // TrajectoryDrive is done -> log the reason why and end drive path primitive
    {
        Logger::GetLogger()->LogData(LOGGER_LEVEL::PRINT, m_ntName, "WhyDone", trajectoryDrive->WhyDone());
        return true;
    }
    else // TrajectoryDrive isn't done
    {
        Logger::GetLogger()->LogData(LOGGER_LEVEL::PRINT, m_ntName, "WhyDone", "Not done");
        return false;
    }

    return false;

with

return trajectoryDrive != nullptr ? trajectoryDrive->IsDone() : false;

Fix includes use "" instead of <> Remove excess includes