cisst-saw
Loading...
Searching...
No Matches
mtsConstraintJointVelLimits.h
Go to the documentation of this file.
1/*
2 Author(s): Henry Phalen, based on previous work by Paul Wilkening and others.
3 Created on: 2022-10-05
4
5 (C) Copyright 2013-2022 Johns Hopkins University (JHU), All Rights Reserved.
6
7--- begin cisst license - do not edit ---
8
9This software is provided "as is" under an open source license, with
10no warranty. The complete license can be found in license.txt and
11http://www.cisst.org/cisst/license.txt.
12
13--- end cisst license ---
14*/
15
16#ifndef mtsConstraintJointVelLimits_H
17#define mtsConstraintJointVelLimits_H
18
20#include <sawConstraintController/prmKinematicsState.h>
21
23{
24public:
25 mtsConstraintJointVelLimits(const Json::Value &constraint_config, const kinematics_map kins_map);
27 void FillInTableauRefs(const CONTROLLERMODE mode, const double TickTime);
29
30 void set_active(const bool &active) // needs to be const ref for provided interface
31 {
32 Active = active;
33 std::cout << Name << " set_active: " << active << std::endl;
34 }
35 void set_lower_limits(const vctDoubleVec &limits)
36 {
37 if (check_limit_input(limits))
38 {
39 lower_limits = limits;
40 std::cout << Name << " set_lower_limits: " << limits << std::endl;
41 }
42 }
43 void set_upper_limits(const vctDoubleVec &limits)
44 {
45 if (check_limit_input(limits))
46 {
47 upper_limits = limits;
48 std::cout << Name << " set_upper_limits: " << limits << std::endl;
49 }
50 }
51
52 prmKinematicsState *kinematics;
55 size_t num_joints;
56
57private:
58 bool check_limit_input(const vctDoubleVec &limits)
59 {
60 if (limits.size() != num_joints)
61 {
62 std::cerr << "[mtsConstraintJointVelLimits]: Given input size: " << limits.size() << " does not match number of joints: " << num_joints << std::endl;
63 return 0;
64 }
65 return 1;
66 }
67};
68
69#endif // mtsConstraintJointVelLimits_H
std::map< std::string, prmKinematicsState * > kinematics_map
Definition mtsConstraintBase.h:31
mtsConstraintBase()
Definition mtsConstraintBase.h:32
std::string Name
Name of the virtual fixture.
Definition mtsVFBase.h:42
vctDoubleVec lower_limits
Definition mtsConstraintJointVelLimits.h:53
size_t num_joints
Definition mtsConstraintJointVelLimits.h:55
void set_upper_limits(const vctDoubleVec &limits)
Definition mtsConstraintJointVelLimits.h:43
void PrepareDataForBridging(mtsInterfaceProvided *provided)
void set_active(const bool &active)
Definition mtsConstraintJointVelLimits.h:30
void FillInTableauRefs(const CONTROLLERMODE mode, const double TickTime)
Updates co with virtual fixture data.
~mtsConstraintJointVelLimits()
Definition mtsConstraintJointVelLimits.h:26
mtsConstraintJointVelLimits(const Json::Value &constraint_config, const kinematics_map kins_map)
void set_lower_limits(const vctDoubleVec &limits)
Definition mtsConstraintJointVelLimits.h:35
vctDoubleVec upper_limits
Definition mtsConstraintJointVelLimits.h:54
prmKinematicsState * kinematics
Definition mtsConstraintJointVelLimits.h:52
Definition mtsInterfaceProvided.h:98
CONTROLLERMODE
Definition mtsVFBase.h:39
vctDynamicVector< double > vctDoubleVec
Definition vctDynamicVectorTypes.h:37