kinematic_extension_builder.cpp
Go to the documentation of this file.
1 /*
2  * Copyright 2017 Fraunhofer Institute for Manufacturing Engineering and Automation (IPA)
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  * http://www.apache.org/licenses/LICENSE-2.0
9 
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */
16 
17 
20 
21 
22 /* BEGIN KinematicExtensionBuilder *****************************************************************************************/
27 {
29 
30  switch (params.kinematic_extension)
31  {
32  case NO_EXTENSION:
33  keb = new KinematicExtensionNone(params);
34  break;
35  case BASE_COMPENSATION:
36  // nothing to do here for BASE_COMPENSATION - only affects twist subscription callback
37  keb = new KinematicExtensionNone(params);
38  break;
39  case BASE_ACTIVE:
40  keb = new KinematicExtensionBaseActive(params);
41  break;
42  case COB_TORSO:
43  keb = new KinematicExtensionTorso(params);
44  break;
45  case LOOKAT:
46  keb = new KinematicExtensionLookat(params);
47  break;
48  default:
49  ROS_ERROR("KinematicExtension %d not defined! Using default: 'NO_EXTENSION'!", params.kinematic_extension);
50  keb = new KinematicExtensionNone(params);
51  break;
52  }
53  if (!keb->initExtension())
54  {
55  ROS_ERROR("Failed to createKinematicExtension %d! Using default: 'NO_EXTENSION'!", params.kinematic_extension);
56  keb = NULL;
57  }
58 
59  return keb;
60 }
61 /* END KinematicExtensionBuilder *******************************************************************************************/
62 
63 
64 /* BEGIN KinematicExtensionNone ********************************************************************************************/
65 
67 {
68  return true;
69 }
70 
75 {
76  return jac_chain;
77 }
78 
83 {
84  return joint_states;
85 }
86 
91 {
92  return limiter_params;
93 }
94 
99 {
100  return;
101 }
102 /* END KinematicExtensionNone **********************************************************************************************/
#define NULL
LimiterParams adjustLimiterParams(const LimiterParams &limiter_params)
Class to be used for Cartesian KinematicExtensions for Lookat.
KinematicExtensionTypes kinematic_extension
Class implementing the interface in case KinematicExtension is disabled.
void processResultExtension(const KDL::JntArray &q_dot_ik)
JointStates adjustJointStates(const JointStates &joint_states)
Base class for kinematic extensions.
Class implementing a mobile base KinematicExtension with Cartesian DoFs (lin_x, lin_y, rot_z) enabled (i.e. 2D).
static KinematicExtensionBase * createKinematicExtension(const TwistControllerParams &params)
virtual bool initExtension()=0
KDL::Jacobian adjustJacobian(const KDL::Jacobian &jac_chain)
Class implementing a KinematicExtension for Torso based on URDF.
#define ROS_ERROR(...)


cob_twist_controller
Author(s): Felix Messmer , Marco Bezzon , Christoph Mark , Francisco Moreno
autogenerated on Thu Apr 8 2021 02:40:00