Skip to content

Commit

Permalink
fix autonomous: SQUASH ME
Browse files Browse the repository at this point in the history
  • Loading branch information
huttongrabiel committed Jan 12, 2024
1 parent daca255 commit 0729d15
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
2 changes: 1 addition & 1 deletion src/autonomous/AutonomousTask.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ void AutonomousTask::navigate() {

if (latestGPS.isFresh(2000ms) && latestHeading.isFresh(2000ms)) {
auto gpsData = latestGPS.getData();
navtypes::pose_t latestPos(gpsData.x(), gpsData.y(), latestHeading);
navtypes::pose_t latestPos(gpsData.x(), gpsData.y(), latestHeading.getData());
cmd.setState(latestPos, robot::types::dataclock::now());
commands::command_t output = cmd.getOutput();
robot::setCmdVel(output.thetaVel, output.xVel);
Expand Down
14 changes: 7 additions & 7 deletions src/network/MissionControlProtocol.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -226,19 +226,19 @@ void MissionControlProtocol::sendRoverPos() {

static bool validateWaypointNavRequest(const json& j) {
return util::validateKey(j, "latitude", val_t::string) &&
util::validateKey(j, "longitude", val_t::string) &&
util::validateKey(j, "isApproximate", val_t::boolean) &&
util::validateKey(j, "isGate", val_t::boolean);
util::validateKey(j, "longitude", val_t::string);
util::validateKey(j, "isApproximate", val_t::boolean) &&
util::validateKey(j, "isGate", val_t::boolean);
}

void MissionControlProtocol::handleWaypointNavRequest(const json& j) {
double latitude = j["latitude"];
double longitude = j["longitude"];
std::string latitude = j["latitude"];
std::string longitude = j["longitude"];
bool isApproximate = j["isApproximate"];
bool isGate = j["isGate"];

if (Globals::AUTONOMOUS && !isApproximate && !isGate) {
navtypes::point_t waypointCoords(latitude, longitude, 1);
if (Globals::AUTONOMOUS) { // && !isApproximate && !isGate) {
navtypes::point_t waypointCoords(std::stod(latitude), std::stod(longitude), 1);
_autonomous_task.start(waypointCoords);
}
}
Expand Down

0 comments on commit 0729d15

Please sign in to comment.