Management class of a motion. More...
#include <MotionController.h>
Public Member Functions | |
MotionController (JointController &joint_ctrl) | |
Constructor. More... | |
bool | playing () |
Decide if a motion is playing. More... | |
bool | frameUpdatable () |
Decide if a motion frame is updatable. More... | |
bool | updatingFinished () |
Decide that updating a frame has finished. More... | |
bool | nextFrameLoadable () |
Decide if there is a loadable frame at the next time. More... | |
void | play (uint8_t slot) |
Play a motion. More... | |
void | playFrameDirectly (const Motion::Frame &frame) |
Play a frame directly. More... | |
void | willStop () |
Will stop playing a motion. More... | |
void | stop () |
Stop playing a motion. More... | |
void | updateFrame () |
void | loadNextFrame () |
Load next frame. More... | |
void | dump (uint8_t slot) |
Dump a motion with JSON format. More... | |
Management class of a motion.
PLEN2::MotionController::MotionController | ( | JointController & | joint_ctrl | ) |
Constructor.
[in] | joint_ctrl | An instance of joint controller. |
void PLEN2::MotionController::dump | ( | uint8_t | slot | ) |
Dump a motion with JSON format.
Output JSON string like a "motion.json", however, property "device"'s type is not string but integer defined as device id in "device_map.json".
[in] | slot | Slot of a motion. |
bool PLEN2::MotionController::frameUpdatable | ( | ) |
Decide if a motion frame is updatable.
void PLEN2::MotionController::loadNextFrame | ( | ) |
Load next frame.
bool PLEN2::MotionController::nextFrameLoadable | ( | ) |
Decide if there is a loadable frame at the next time.
void PLEN2::MotionController::play | ( | uint8_t | slot | ) |
Play a motion.
[in] | slot | Number of a motion. |
void PLEN2::MotionController::playFrameDirectly | ( | const Motion::Frame & | frame | ) |
Play a frame directly.
[in] | frame | An instance of frame |
bool PLEN2::MotionController::playing | ( | ) |
Decide if a motion is playing.
void PLEN2::MotionController::stop | ( | ) |
Stop playing a motion.
void PLEN2::MotionController::updateFrame | ( | ) |
bool PLEN2::MotionController::updatingFinished | ( | ) |
Decide that updating a frame has finished.
void PLEN2::MotionController::willStop | ( | ) |
Will stop playing a motion.
The method doesn't stop playing a motion just after running itself, but will stop it when a frame that has the stop flag is discovered.