Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added a coordinate frame. #30

Merged
merged 12 commits into from
May 19, 2019
Merged
Changes from 11 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
45 changes: 45 additions & 0 deletions code/headers/frame_types.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,7 @@ namespace r2d2 {
UI_COMMAND,
MANUAL_CONTROL,
MOVEMENT_CONTROL,
COORDINATE_STRUCT,
PATH_STEP,

// Don't touch
Expand Down Expand Up @@ -375,6 +376,49 @@ namespace r2d2 {
};

/**
* Struct that represents a coordinate on the planet.
*
* Location_detector wiki:
* https://github.com/R2D2-2019/location_detector
*/

R2D2_PACK_STRUCT
struct frame_coordinate_s {
LRstudentHU marked this conversation as resolved.
Show resolved Hide resolved
// This variable represents the height relative to the average sea level.
int16_t altitude;

// This variable represents the thousandths seconds of the longitude coordinate.
uint16_t longitude_thousandth_second;
LRstudentHU marked this conversation as resolved.
Show resolved Hide resolved

// This variable represents the thousandths seconds of the latitude coordinate.
uint16_t latitude_thousandth_second;

// This variable represents the degrees of the latitude coordinate.
uint8_t latitude_degrees;

// This variable represents the minutes of the latitude coordinate.
uint8_t latitude_minutes;

// This variable represents the seconds of the latitude coordinate.
uint8_t latitude_seconds;

// This variable represents the degrees of the longitude coordinate.
uint8_t longitude_degrees;

// This variable represents the minutes of the longitude coordinate.
uint8_t longitude_minutes;

// This variable represents the seconds of the longitude coordinate.
uint8_t longitude_seconds;

// This variable represents the nothern or southern hemisphere the coordinate is located on.
char north_south_hemisphere;
LRstudentHU marked this conversation as resolved.
Show resolved Hide resolved

// This variable represents the eastern or western hemisphere the coordinate is located on.
char east_west_hemisphere;
};

/*
* Our A-star algorithm outputs a list of 2D vector so the path_id
* indentifies which list it's from, the step id is basically
* the list index. x and y are the 2D vector's attributes.
Expand Down Expand Up @@ -406,4 +450,5 @@ namespace r2d2 {
R2D2_INTERNAL_FRAME_HELPER(frame_path_step_s, PATH_STEP)
R2D2_INTERNAL_FRAME_HELPER(frame_manual_control_s, MANUAL_CONTROL)
R2D2_INTERNAL_FRAME_HELPER(frame_movement_control_s, MOVEMENT_CONTROL)
R2D2_INTERNAL_FRAME_HELPER(frame_coordinate_s, COORDINATE_STRUCT)
}