cisst-saw
Loading...
Searching...
No Matches
prmVelocityCartesianSet.h
Go to the documentation of this file.
1/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2/* ex: set filetype=cpp softtabstop=4 shiftwidth=4 tabstop=4 cindent expandtab: */
3
4/*
5 Author(s): Rajesh Kumar, Anton Deguet
6 Created on: 2008-03-12
7
8 (C) Copyright 2008-2023 Johns Hopkins University (JHU), All Rights Reserved.
9
10--- begin cisst license - do not edit ---
11
12This software is provided "as is" under an open source license, with
13no warranty. The complete license can be found in license.txt and
14http://www.cisst.org/cisst/license.txt.
15
16--- end cisst license ---
17*/
18
19
24
25
26#ifndef _prmVelocityCartesianSet_h
27#define _prmVelocityCartesianSet_h
28
31
32// Always include last
34
35
39
41
43{
44 CMN_DECLARE_SERVICES(CMN_DYNAMIC_CREATION, CMN_LOG_ALLOW_DEFAULT);
45 protected:
46
48
51
54
57
60
64
65 public:
68 {
69 Velocity.SetAll(0.0);
73 Mask.SetAll(false);
74 }
75
77
79 const vctDouble3 & velocityAngular,
80 const vctDouble3 & acceleration,
81 const vctDouble3 & accelerationAngular,
82 const vctBool6 & mask):
83 Velocity(velocity),
84 VelocityAngular(velocityAngular),
85 Acceleration(acceleration),
86 AccelerationAngular(accelerationAngular),
87 Mask(mask)
88 {}
89
92
97 inline void SetGoal(const vctDouble6 & velocities)
98 {
99 this->Velocity[0] = velocities[0];
100 this->Velocity[1] = velocities[1];
101 this->Velocity[2] = velocities[2];
102 this->VelocityAngular[0] = velocities[3];
103 this->VelocityAngular[1] = velocities[4];
104 this->VelocityAngular[2] = velocities[5];
105 Mask.SetAll(true);
106 }
107
108 /*Set Translational Velocities only
109 \param velocity translational velocity
110 \return void
111 */
112 inline void SetTranslationGoal(const vctDouble3 & velocity)
113 {
114 this->Velocity.Assign(velocity);
115 Mask[0] = Mask[1] = Mask[2] = true;
116 }
117
122 inline void SetRotationGoal(const vctDouble3 & velocityAngular)
123 {
124 this->VelocityAngular.Assign(velocityAngular);
125 Mask[3] = Mask[4] = Mask[5] = true;
126 }
127
131 inline vctDouble3 GetGoal(void) const
132 {
133 return this->Velocity;
134 }
135
140 inline void SetVelocity(const vctDouble3 & velocity)
141 {
142 this->Velocity = velocity;
143 Mask[0] = Mask[1] = Mask[2] = true;
144 }
145
149 inline vctDouble3 GetVelocity(void) const
150 {
151 return this->Velocity;
152 }
153
158 inline void SetAngularVelocity(const vctDouble3 & velocityAngular)
159 {
160 this->VelocityAngular = velocityAngular;
161 Mask[3] = Mask[4] = Mask[5] = true;
162 }
163
168 {
169 return this->VelocityAngular;
170 }
171
176 inline void SetAcceleration(const vctDouble3 & acceleration)
177 {
178 this->Acceleration = acceleration;
179 }
180
184 inline vctDouble3 GetAcceleration(void) const
185 {
186 return this->Acceleration;
187 }
188
193 inline void SetAngularAcceleration(const vctDouble3 & accelerationAngular)
194 {
195 this->AccelerationAngular = accelerationAngular;
196 }
197
202 {
203 return this->AccelerationAngular;
204 }
205
210 inline void SetMask(const vctBool6 & mask)
211 {
212 this->Mask = mask;
213 }
214
218 inline vctBool6 GetMask(void) const
219 {
220 return this->Mask;
221 }
222
223
225 void SerializeRaw(std::ostream & outputStream) const override;
226
228 void DeSerializeRaw(std::istream & inputStream) override;
229
230
231}; // _prmVelocityCartesianSet_h
232
233
235
236
237#endif
prmMotionBase()
Definition prmMotionBase.h:43
Definition prmVelocityCartesianSet.h:43
void SerializeRaw(std::ostream &outputStream) const override
virtual ~prmVelocityCartesianSet()
vctDouble3 Acceleration
Definition prmVelocityCartesianSet.h:56
void SetTranslationGoal(const vctDouble3 &velocity)
Definition prmVelocityCartesianSet.h:112
void SetAngularVelocity(const vctDouble3 &velocityAngular)
Definition prmVelocityCartesianSet.h:158
prmVelocityCartesianSet(const vctDouble3 &velocity, const vctDouble3 &velocityAngular, const vctDouble3 &acceleration, const vctDouble3 &accelerationAngular, const vctBool6 &mask)
Definition prmVelocityCartesianSet.h:78
vctBool6 GetMask(void) const
Definition prmVelocityCartesianSet.h:218
void SetMask(const vctBool6 &mask)
Definition prmVelocityCartesianSet.h:210
void DeSerializeRaw(std::istream &inputStream) override
vctDouble3 GetAngularVelocity(void) const
Definition prmVelocityCartesianSet.h:167
void SetVelocity(const vctDouble3 &velocity)
Definition prmVelocityCartesianSet.h:140
vctDouble3 AccelerationAngular
Definition prmVelocityCartesianSet.h:59
vctDouble3 Velocity
Definition prmVelocityCartesianSet.h:50
vctDouble3 GetAngularAcceleration(void) const
Definition prmVelocityCartesianSet.h:201
vctDouble3 VelocityAngular
Definition prmVelocityCartesianSet.h:53
vctBool6 Mask
Definition prmVelocityCartesianSet.h:63
void SetRotationGoal(const vctDouble3 &velocityAngular)
Definition prmVelocityCartesianSet.h:122
vctDouble3 GetAcceleration(void) const
Definition prmVelocityCartesianSet.h:184
vctDouble3 GetVelocity(void) const
Definition prmVelocityCartesianSet.h:149
void SetAngularAcceleration(const vctDouble3 &accelerationAngular)
Definition prmVelocityCartesianSet.h:193
prmVelocityCartesianSet()
Definition prmVelocityCartesianSet.h:67
prmMotionBase BaseType
Definition prmVelocityCartesianSet.h:47
void SetAcceleration(const vctDouble3 &acceleration)
Definition prmVelocityCartesianSet.h:176
vctDouble3 GetGoal(void) const
Definition prmVelocityCartesianSet.h:131
void SetGoal(const vctDouble6 &velocities)
Definition prmVelocityCartesianSet.h:97
ThisType & Assign(const vctFixedSizeConstVectorBase< _size, __stride, __elementType, __dataPtrType > &other)
Definition vctFixedSizeVectorBase.h:274
value_type SetAll(const value_type &value)
Definition vctFixedSizeVectorBase.h:241
#define CMN_DECLARE_SERVICES_INSTANTIATION(className)
Definition cmnClassRegisterMacros.h:199
const int CMN_DYNAMIC_CREATION
Definition cmnClassRegisterMacros.h:328
#define CISST_EXPORT
Definition cmnExportMacros.h:50
#define CMN_LOG_ALLOW_DEFAULT
Definition cmnLogLoD.h:76
Typedef for fixed size vectors.
vctFixedSizeVector< bool, 6 > vctBool6
Definition vctFixedSizeVectorTypes.h:269
vctFixedSizeVector< double, 6 > vctDouble6
Definition vctFixedSizeVectorTypes.h:60
vctFixedSizeVector< double, 3 > vctDouble3
Definition vctFixedSizeVectorTypes.h:45