libfranka 0.15.0
FCI C++ API
Loading...
Searching...
No Matches
Functions
control_tools.h File Reference

Contains helper functions for writing control loops. More...

#include <algorithm>
#include <array>
#include <cmath>
#include <stdexcept>
#include <string>
Include dependency graph for control_tools.h:

Go to the source code of this file.

Functions

bool franka::isValidElbow (const std::array< double, 2 > &elbow) noexcept
 Determines whether the given elbow configuration is valid or not.
 
bool franka::isHomogeneousTransformation (const std::array< double, 16 > &transform) noexcept
 Determines whether the given array represents a valid homogeneous transformation matrix.
 
bool franka::hasRealtimeKernel ()
 Determines whether the current OS kernel is a realtime kernel.
 
bool franka::setCurrentThreadToHighestSchedulerPriority (std::string *error_message)
 Sets the current thread to the highest possible scheduler priority.
 
template<size_t N>
void franka::checkFinite (const std::array< double, N > &array)
 Checks if all elements of an array of the size N have a finite value.
 
void franka::checkMatrix (const std::array< double, 16 > &transform)
 Checks if all elements of the transformation matrix are finite and if it is a homogeneous transformation.
 
void franka::checkElbow (const std::array< double, 2 > &elbow)
 Checks if all elements of the elbow vector are finite and if the elbow configuration is valid.
 

Detailed Description

Contains helper functions for writing control loops.

Function Documentation

◆ checkElbow()

void franka::checkElbow ( const std::array< double, 2 > &  elbow)
inline

Checks if all elements of the elbow vector are finite and if the elbow configuration is valid.

Parameters
elbowthe elbow vector to check

◆ checkFinite()

template<size_t N>
void franka::checkFinite ( const std::array< double, N > &  array)
inline

Checks if all elements of an array of the size N have a finite value.

Template Parameters
Nthe size of the array
Parameters
arraythe array to be checked

◆ checkMatrix()

void franka::checkMatrix ( const std::array< double, 16 > &  transform)
inline

Checks if all elements of the transformation matrix are finite and if it is a homogeneous transformation.

Parameters
transformthe transformation matrix to check

◆ hasRealtimeKernel()

bool franka::hasRealtimeKernel ( )

Determines whether the current OS kernel is a realtime kernel.

On Linux, this checks for the existence of /sys/kernel/realtime. On Windows, this always returns true.

Returns
True if running a realtime kernel, false otherwise.

◆ isHomogeneousTransformation()

bool franka::isHomogeneousTransformation ( const std::array< double, 16 > &  transform)
inlinenoexcept

Determines whether the given array represents a valid homogeneous transformation matrix.

Parameters
[in]transform4x4 matrix in column-major format.
Returns
True if the array represents a homogeneous transformation matrix, otherwise false.

◆ isValidElbow()

bool franka::isValidElbow ( const std::array< double, 2 > &  elbow)
inlinenoexcept

Determines whether the given elbow configuration is valid or not.

Parameters
[in]elbowElbow configuration.
Returns
True if valid, otherwise false.

◆ setCurrentThreadToHighestSchedulerPriority()

bool franka::setCurrentThreadToHighestSchedulerPriority ( std::string *  error_message)

Sets the current thread to the highest possible scheduler priority.

Parameters
[out]error_messageContains an error message if the scheduler priority cannot be set successfully.
Returns
True if successful, false otherwise.