JMotor
|
struct for storing a 2 dimensional transformation. Used for telling a drivetrain how to move. More...
#include <JTwoDTransform.h>
Public Member Functions | |
JTwoDTransform | operator& (const JTwoDTransform &t) |
adds the second transform after the first, assuming movement, then rotation | |
JTwoDTransform | operator+ (const JTwoDTransform &t) |
JTwoDTransform | operator- (const JTwoDTransform &t) |
JTwoDTransform | operator* (const JTwoDTransform &t) |
JTwoDTransform | operator/ (const JTwoDTransform &t) |
JTwoDTransform | operator* (const float v) |
JTwoDTransform | operator/ (const float v) |
JTwoDTransform | operator- () |
JTwoDTransform | operator+= (const JTwoDTransform &t) |
JTwoDTransform | operator-= (const JTwoDTransform &t) |
JTwoDTransform | operator*= (const JTwoDTransform &t) |
JTwoDTransform | operator/= (const JTwoDTransform &t) |
JTwoDTransform | operator*= (const float v) |
JTwoDTransform | operator/= (const float v) |
float | getByNumber (int8_t index) |
access the three values based on a numerical index | |
void | setByNumber (int8_t index, float value) |
sets one of the three values based on a numerical index | |
float | sumAbs () |
sum of absolute value of the three values | |
void | print (bool labels=true, bool newline=false, Stream *serial=&Serial) |
use to print values of transform to serial port | |
Static Public Member Functions | |
static JTwoDTransform | rotate (JTwoDTransform tIn, float theta) |
static JTwoDTransform | fromNice (float fb, float sideways, float turn) |
converts from a coordinate system that might be more intuitive for some people | |
static float | getForwards (JTwoDTransform t) |
static float | getRight (JTwoDTransform t) |
static float | getTurnDegreesCW (JTwoDTransform t) |
Public Attributes | |
float | x |
backwards- | forward+ | |
float | y |
right- | left+ | |
float | theta |
clockwise- | counterclockwise+ | |
struct for storing a 2 dimensional transformation. Used for telling a drivetrain how to move.
|
inlinestatic |
converts from a coordinate system that might be more intuitive for some people
fb | backwards- | forward+ |
sideways | left- | right+ |
turn | CCW- | CW+ in DEGREES |
converted | JTwoDTransform |
|
inline |
access the three values based on a numerical index
index | 0 returns x, 1 returns y, 2 returns z, other numbers returns NAN |
(float) |
|
inlinestatic |
|
inlinestatic |
|
inlinestatic |
|
inline |
adds the second transform after the first, assuming movement, then rotation
combined | transform |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
use to print values of transform to serial port
labels | (bool, default=true) label what axis each value corresponds to |
newline | (bool, default=false) send a newline character at the end |
serial | (Stream*, default=Serial) what serial port to print to |
|
inlinestatic |
|
inline |
sets one of the three values based on a numerical index
index | 0 sets x, 1 sets y, 2 sets z, other numbers have no effect |
|
inline |
sum of absolute value of the three values
float JTwoDTransform::theta |
clockwise- | counterclockwise+
float JTwoDTransform::x |
backwards- | forward+
float JTwoDTransform::y |
right- | left+