#include <step_queue.h>
Public Types | |
typedef boost::shared_ptr < const StepQueue > | ConstPtr |
typedef boost::shared_ptr < StepQueue > | Ptr |
Public Member Functions | |
void | clearDirtyFlag () |
Resets dirty flag. | |
bool | empty () const |
Checks if there are steps in queue. | |
int | firstStepIndex () const |
Returns next step index enqueued for execution. | |
bool | getStep (msgs::Step &step, unsigned int step_index=0u) |
Retrieves step of execution queue. | |
bool | getStepAt (msgs::Step &step, unsigned int position=0u) |
Retrieves step of execution queue. | |
std::vector< msgs::Step > | getSteps (unsigned int start_index, unsigned int end_index) const |
getSteps Retrieves all steps with index in range of [start_index; end_index] | |
bool | isDirty () const |
Returns if step queue has been changed. | |
int | lastStepIndex () const |
Returns last step index enqueued for execution. | |
bool | popStep (msgs::Step &step) |
Dequeues and returns next step from execution queue. | |
bool | popStep () |
void | removeStep (unsigned int step_index) |
Remove steps with specific index from queue. | |
void | removeSteps (unsigned int from_step_index, int to_step_index=-1) |
Remove steps in the given range [from_step_index, to_step_index]. | |
void | reset () |
size_t | size () const |
Returns size of step queue. | |
StepQueue () | |
bool | updateStepPlan (const msgs::StepPlan &step_plan, int min_step_index=0) |
Merges given step plan to the current execution queue of steps. Hereby, two cases have to considered: 1. In case of an empty execution queue (robot is standing) the step plan has to begin with step index 0. 2. In case of an non-empty execution queue (robot is walking) TODO: Stitching rules, new total step plan length. | |
virtual | ~StepQueue () |
Protected Attributes | |
bool | is_dirty_ |
Mutex | queue_mutex_ |
StepPlan | step_plan_ |
Definition at line 51 of file step_queue.h.
typedef boost::shared_ptr<const StepQueue> vigir_step_control::StepQueue::ConstPtr |
Definition at line 56 of file step_queue.h.
typedef boost::shared_ptr<StepQueue> vigir_step_control::StepQueue::Ptr |
Definition at line 55 of file step_queue.h.
Definition at line 7 of file step_queue.cpp.
vigir_step_control::StepQueue::~StepQueue | ( | ) | [virtual] |
Definition at line 11 of file step_queue.cpp.
Resets dirty flag.
Definition at line 40 of file step_queue.cpp.
bool vigir_step_control::StepQueue::empty | ( | ) | const |
Checks if there are steps in queue.
Definition at line 22 of file step_queue.cpp.
int vigir_step_control::StepQueue::firstStepIndex | ( | ) | const |
Returns next step index enqueued for execution.
Definition at line 177 of file step_queue.cpp.
bool vigir_step_control::StepQueue::getStep | ( | msgs::Step & | step, |
unsigned int | step_index = 0u |
||
) |
Retrieves step of execution queue.
step | Outgoing variable for retrieved step. |
index | Position of step in queue to be returned. 0 points to the next step to be executed next. |
Definition at line 121 of file step_queue.cpp.
bool vigir_step_control::StepQueue::getStepAt | ( | msgs::Step & | step, |
unsigned int | position = 0u |
||
) |
Retrieves step of execution queue.
step | Outgoing variable for retrieved step. |
position | Position of step in queue to be returned. 0 points to the next step to be executed next. |
Definition at line 127 of file step_queue.cpp.
std::vector< msgs::Step > vigir_step_control::StepQueue::getSteps | ( | unsigned int | start_index, |
unsigned int | end_index | ||
) | const |
getSteps Retrieves all steps with index in range of [start_index; end_index]
start_index | Starting index |
end_index | Ending index |
Definition at line 133 of file step_queue.cpp.
bool vigir_step_control::StepQueue::isDirty | ( | ) | const |
Returns if step queue has been changed.
Definition at line 34 of file step_queue.cpp.
int vigir_step_control::StepQueue::lastStepIndex | ( | ) | const |
Returns last step index enqueued for execution.
Definition at line 188 of file step_queue.cpp.
bool vigir_step_control::StepQueue::popStep | ( | msgs::Step & | step | ) |
Dequeues and returns next step from execution queue.
step | Outgoing variable for dequeued step. |
Definition at line 163 of file step_queue.cpp.
Definition at line 170 of file step_queue.cpp.
void vigir_step_control::StepQueue::removeStep | ( | unsigned int | step_index | ) |
Remove steps with specific index from queue.
step_index | Step to be removed |
Definition at line 149 of file step_queue.cpp.
void vigir_step_control::StepQueue::removeSteps | ( | unsigned int | from_step_index, |
int | to_step_index = -1 |
||
) |
Remove steps in the given range [from_step_index, to_step_index].
from_step_index | start index |
to_step_index | end index; to_step_index < 0 is equal to removing all steps with index >= from_step_index |
Definition at line 156 of file step_queue.cpp.
void vigir_step_control::StepQueue::reset | ( | ) |
Definition at line 15 of file step_queue.cpp.
size_t vigir_step_control::StepQueue::size | ( | ) | const |
Returns size of step queue.
Definition at line 28 of file step_queue.cpp.
bool vigir_step_control::StepQueue::updateStepPlan | ( | const msgs::StepPlan & | step_plan, |
int | min_step_index = 0 |
||
) |
Merges given step plan to the current execution queue of steps. Hereby, two cases have to considered: 1. In case of an empty execution queue (robot is standing) the step plan has to begin with step index 0. 2. In case of an non-empty execution queue (robot is walking) TODO: Stitching rules, new total step plan length.
step_plan | Step plan to be merged into execution queue. |
min_step_index | Only steps with index >= min_step_index are considered for merge |
check for consistency
merge step plan
Definition at line 46 of file step_queue.cpp.
bool vigir_step_control::StepQueue::is_dirty_ [protected] |
Definition at line 157 of file step_queue.h.
Mutex vigir_step_control::StepQueue::queue_mutex_ [mutable, protected] |
Definition at line 160 of file step_queue.h.
StepPlan vigir_step_control::StepQueue::step_plan_ [protected] |
Definition at line 155 of file step_queue.h.