12 const std::string& prefix)
16 prefix +
"checkHeadVelocity",
17 "If true, check whether the head is moving and discard updates in the meantime.");
19 prefix +
"maxJointVelocity",
20 "If a head joint's velocity is higher, the head is considered moving.");
22 prefix +
"discardIntervalAfterMoveMS",
23 "For how long new updates are ignored after moving the head.");
31 for (
const std::string& jointName :
jointNames)
33 std::string
error =
"";
44 catch (
const InvalidDatafieldException& e)
54 ARMARX_WARNING <<
"Could not get datafield for joint '" << jointName
62 ARMARX_INFO <<
"Cannot fetch joint velocity datafields because there is no kinematic "
74 float jointVelocity = df->getFloat();
118 objpose::SignalHeadMovementOutput
121 objpose::SignalHeadMovementOutput output;
122 switch (input.action)
124 case objpose::HeadMovementAction::HeadMovementAction_Starting:
126 ? this->discardIntervalAfterMoveMS
127 : input.discardUpdatesIntervalMilliSeconds);
129 case objpose::HeadMovementAction::HeadMovementAction_Stopping:
130 this->
movementStops(input.discardUpdatesIntervalMilliSeconds);
136 output.discardUpdatesUntilMilliSeconds =
191 grid.
add(
Label(
"Discard Interval after Move [ms]"), {row, 0})
195 group.setLabel(
"Robot Head Movement");
196 group.addChild(grid);
int Label(int n[], int size, int *curLabel, MiscLib::Vector< std::pair< int, size_t > > *labels)
#define ARMARX_UNEXPECTED_ENUM_VALUE(EnumType, value)
Throw an UnexpectedEnumValueException.
static DateTime Invalid()
std::string jointVelocitiesChannelName
KinematicUnitObserverInterfacePrx kinematicUnitObserver
std::vector< std::string > jointNames
void movementStarts(long discardIntervalMs)
int discardIntervalAfterMoveMS
DateTime discardUpdatesUntil
objpose::SignalHeadMovementOutput signalHeadMovement(const objpose::SignalHeadMovementInput &input)
void movementStops(long discardIntervalMs)
std::vector< DatafieldRefPtr > jointVelocitiesDatafields
void defineProperties(armarx::PropertyDefinitionsPtr defs, const std::string &prefix="head.")
std::int64_t toMilliSeconds() const
Returns the amount of milliseconds.
static Duration MilliSeconds(std::int64_t milliSeconds)
Constructs a duration in milliseconds.
#define ARMARX_INFO
The normal logging level.
#define ARMARX_WARNING
The logging level for unexpected behaviour, but not a serious problem.
armarx::core::time::Duration Duration
IceInternal::Handle< DatafieldRef > DatafieldRefPtr
IceUtil::Handle< class PropertyDefinitionContainer > PropertyDefinitionsPtr
PropertyDefinitions smart pointer type.
std::vector< T > max(const std::vector< T > &v1, const std::vector< T > &v2)
GridLayout & add(Widget const &child, Pos pos, Span span=Span{1, 1})
std::optional< DateTime > updatesUntil
armarx::RemoteGui::Client::CheckBox checkHeadVelocity
armarx::RemoteGui::Client::GroupBox group
armarx::RemoteGui::Client::FloatSpinBox maxJointVelocity
void setup(const RobotHeadMovement &rhm)
void update(RobotHeadMovement &rhm)
armarx::RemoteGui::Client::IntSpinBox discardIntervalAfterMoveMS