CollisionAvoidanceBase Class Reference

Brief description of class CollisionAvoidanceBase. More...

#include <armarx/control/njoint_controller/core/CollisionAvoidanceCore.h>

Classes

struct  CollisionAvoidanceArmData
 

Public Types

using CollArmPtr = std::shared_ptr< CollisionAvoidanceArmData >
 
using CollisionRobot = ::simox::control::environment::CollisionRobot< hpp::fcl::OBBRSS >
 
using CollisionRobotPtr = std::unique_ptr< CollisionRobot >
 
using Config = ::armarx::control::common::control_law::arondto::CollisionAvoidanceConfigDict
 
using ConfigPtr = std::shared_ptr< Config >
 
using CtrlConfig = armarx::control::common::control_law::arondto::CollisionAvoidanceConfig
 
using DistanceResults = std::vector<::simox::control::environment::DistanceResult >
 
using DistanceResultsPtr = std::shared_ptr< DistanceResults >
 
using InertiaPtr = std::shared_ptr< simox::control::geodesics::metric::Inertia >
 
using RtStatus = law::CollisionAvoidanceController::RtStatusForSafetyStrategy
 
using SimoxRobot = ::simox::control::simox::robot::Robot
 
using SimoxRobotPtr = std::shared_ptr< SimoxRobot >
 

Public Member Functions

 CollisionAvoidanceBase (const VirtualRobot::RobotPtr &rtRobot, const Config &cfg)
 
void rtCollisionChecking ()
 
void rtLimbControllerRun (const std::string &robotNodeSetName, Eigen::VectorXf &qpos, Eigen::VectorXf &qvelFiltered, float torqueLimit, Eigen::VectorXf &impedanceJointTorque)
 
void rtPostDeactivate ()
 
void rtPreActivate ()
 
void setUserCfg (const Config &cfg)
 
void updateRtConfigFromUser ()
 
void validateConfigData (Config &cfg)
 
 ~CollisionAvoidanceBase ()
 

Public Attributes

armarx::TripleBuffer< ConfigbufferCfgUserToRT
 
std::map< std::string, CollArmPtrcollLimb
 
Config userCfg
 

Protected Attributes

std::vector< std::string > actuatedJointNames
 
DistanceResultsPtr collisionPairs
 
CollisionRobotPtr collisionRobotPtr
 
Eigen::VectorXd qposActuatedJoints
 TODO, rename to actuatedJointNames. More...
 
SimoxRobotPtr simoxControlRobotPtr
 
SimoxRobotPtr simoxReducedRobotPtr
 
std::vector< int > translationJointIndex
 

Detailed Description

Brief description of class CollisionAvoidanceBase.

Detailed description of class CollisionAvoidanceBase.

Definition at line 52 of file CollisionAvoidanceCore.h.

Member Typedef Documentation

◆ CollArmPtr

using CollArmPtr = std::shared_ptr<CollisionAvoidanceArmData>

Definition at line 103 of file CollisionAvoidanceCore.h.

◆ CollisionRobot

using CollisionRobot = ::simox::control::environment::CollisionRobot<hpp::fcl::OBBRSS>

Definition at line 60 of file CollisionAvoidanceCore.h.

◆ CollisionRobotPtr

using CollisionRobotPtr = std::unique_ptr<CollisionRobot>

Definition at line 61 of file CollisionAvoidanceCore.h.

◆ Config

using Config = ::armarx::control::common::control_law::arondto::CollisionAvoidanceConfigDict

Definition at line 65 of file CollisionAvoidanceCore.h.

◆ ConfigPtr

using ConfigPtr = std::shared_ptr<Config>

Definition at line 66 of file CollisionAvoidanceCore.h.

◆ CtrlConfig

using CtrlConfig = armarx::control::common::control_law::arondto::CollisionAvoidanceConfig

Definition at line 63 of file CollisionAvoidanceCore.h.

◆ DistanceResults

using DistanceResults = std::vector<::simox::control::environment::DistanceResult>

Definition at line 58 of file CollisionAvoidanceCore.h.

◆ DistanceResultsPtr

using DistanceResultsPtr = std::shared_ptr<DistanceResults>

Definition at line 59 of file CollisionAvoidanceCore.h.

◆ InertiaPtr

using InertiaPtr = std::shared_ptr<simox::control::geodesics::metric::Inertia>

Definition at line 62 of file CollisionAvoidanceCore.h.

◆ RtStatus

using RtStatus = law::CollisionAvoidanceController::RtStatusForSafetyStrategy

Definition at line 67 of file CollisionAvoidanceCore.h.

◆ SimoxRobot

using SimoxRobot = ::simox::control::simox::robot::Robot

Definition at line 56 of file CollisionAvoidanceCore.h.

◆ SimoxRobotPtr

using SimoxRobotPtr = std::shared_ptr<SimoxRobot>

Definition at line 57 of file CollisionAvoidanceCore.h.

Constructor & Destructor Documentation

◆ CollisionAvoidanceBase()

CollisionAvoidanceBase ( const VirtualRobot::RobotPtr rtRobot,
const Config cfg 
)

add actuated robot joints use a robot nodeset with all actuated joints, arms including head and torso joints, which change the position of the robot body parts for correct collision checking

initialize simox control robot for self-collision checking

create not reduced simox control robot for inertia calculation

Definition at line 6 of file CollisionAvoidanceCore.cpp.

+ Here is the call graph for this function:

◆ ~CollisionAvoidanceBase()

Definition at line 92 of file CollisionAvoidanceCore.cpp.

Member Function Documentation

◆ rtCollisionChecking()

void rtCollisionChecking ( )

--------------— update joint values for simox Robots ------------------------------—

--------------— update Simox robots -----------------------------------------------—

a VectorXd is needed with nodeSet size (size of actuated joints in order of vector, which has been used for initialization in init

It is very important that the simox robots map the current joint configuration of the real-world robot

--------------— calculation of robot collision pairs ------------------------------—

_______TODO_______ the following line is commented out, to avoid allocation of new memory

!!! individualColObjects has to be set to true (second flag, that is passed) !!! if not set to true, the body and the arms become attractive, be aware _______TODO_______ consider passing the pre-allocated results to the simox lib.

reset temporary pointsOnArmIndex

checks whether the point is located on the arm and fills the pointsOnArm vector with the corresponding indices the entries in the pointsOnArm vector store the indices of the collision pairs that are on the arm and which must be taken into account in the control law

prefilter contact pairs based on distance

set index in integer vector of contact point on arm below preFilterDistance

_______TODO_______ what if there are more collision pairs than 100? added above check with maxCollisionPairs

Definition at line 170 of file CollisionAvoidanceCore.cpp.

◆ rtLimbControllerRun()

void rtLimbControllerRun ( const std::string &  robotNodeSetName,
Eigen::VectorXf &  qpos,
Eigen::VectorXf &  qvelFiltered,
float  torqueLimit,
Eigen::VectorXf &  impedanceJointTorque 
)

set all invalid indeces of this rt cycle to -1

Definition at line 275 of file CollisionAvoidanceCore.cpp.

◆ rtPostDeactivate()

void rtPostDeactivate ( )

Definition at line 153 of file CollisionAvoidanceCore.cpp.

◆ rtPreActivate()

void rtPreActivate ( )

Definition at line 144 of file CollisionAvoidanceCore.cpp.

◆ setUserCfg()

void setUserCfg ( const Config cfg)

Definition at line 319 of file CollisionAvoidanceCore.cpp.

+ Here is the call graph for this function:

◆ updateRtConfigFromUser()

void updateRtConfigFromUser ( )

Running in rt thread.

Definition at line 162 of file CollisionAvoidanceCore.cpp.

+ Here is the call graph for this function:

◆ validateConfigData()

void validateConfigData ( Config cfg)

Definition at line 307 of file CollisionAvoidanceCore.cpp.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

Member Data Documentation

◆ actuatedJointNames

std::vector<std::string> actuatedJointNames
protected

Definition at line 131 of file CollisionAvoidanceCore.h.

◆ bufferCfgUserToRT

armarx::TripleBuffer<Config> bufferCfgUserToRT

Definition at line 120 of file CollisionAvoidanceCore.h.

◆ collisionPairs

DistanceResultsPtr collisionPairs
protected

Definition at line 129 of file CollisionAvoidanceCore.h.

◆ collisionRobotPtr

CollisionRobotPtr collisionRobotPtr
protected

Definition at line 126 of file CollisionAvoidanceCore.h.

◆ collLimb

std::map<std::string, CollArmPtr> collLimb

Definition at line 118 of file CollisionAvoidanceCore.h.

◆ qposActuatedJoints

Eigen::VectorXd qposActuatedJoints
protected

TODO, rename to actuatedJointNames.

Definition at line 132 of file CollisionAvoidanceCore.h.

◆ simoxControlRobotPtr

SimoxRobotPtr simoxControlRobotPtr
protected

Definition at line 127 of file CollisionAvoidanceCore.h.

◆ simoxReducedRobotPtr

SimoxRobotPtr simoxReducedRobotPtr
protected

Definition at line 128 of file CollisionAvoidanceCore.h.

◆ translationJointIndex

std::vector<int> translationJointIndex
protected

Definition at line 133 of file CollisionAvoidanceCore.h.

◆ userCfg

Config userCfg

Definition at line 119 of file CollisionAvoidanceCore.h.


The documentation for this class was generated from the following files: