simulatedArm.h
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 
18 #ifndef _SIMULATED_ARM_H_
19 #define _SIMULATED_ARM_H_
20 
22 #include <vector>
23 #include <string>
24 
25 class simulatedMotor;
26 
28 {
29 public:
30  simulatedArm();
31  virtual ~simulatedArm();
32 
33  bool Init(PowerCubeCtrlParams* params);
34 
35  bool isInitialized() const
36  {
37  return m_Initialized;
38  }
39 
40  std::string getErrorMessage() const
41  {
42  return m_ErrorMessage;
43  }
44 
45  bool Close()
46  {
47  m_Initialized = false;
48  return true;
49  }
50 
52  // Funktionen Arm-Ansteuerung: //
54 
57  bool MoveJointSpaceSync(const std::vector<double>& Angle);
58 
60  bool MovePos(const std::vector<double>&);
62  bool MoveVel(const std::vector<double>&);
63 
65  // bool MoveCur(const std::vector<double>&);
66 
68  bool Stop();
69 
71  // Funktionen zum setzen von Parametern: //
73 
76  bool setMaxVelocity(double radpersec);
77  bool setMaxVelocity(const std::vector<double>& radpersec);
78 
81  bool setMaxAcceleration(double radPerSecSquared);
82  bool setMaxAcceleration(const std::vector<double>& radPerSecSquared);
83 
85  // hier die Funktionen zur Statusabfrage: //
87 
89  bool getConfig(std::vector<double>& result);
90 
92  bool getJointVelocities(std::vector<double>& result);
93 
96  bool statusMoving();
97 
99  bool statusDec();
100 
102  bool statusAcc();
103 
105  // bool doHoming();
106  // bool HomingDone();
107 
109  bool waitForSync()
110  {
111  return true;
112  } // makes no difference in simulation
115  {
116  return true;
117  } // makes no difference in simulation
118 
119 protected:
120  int m_DOF;
122  std::string m_ErrorMessage;
123 
124  std::vector<simulatedMotor> m_motors;
125 
126  std::vector<double> m_maxVel;
127  std::vector<double> m_maxAcc;
128 };
129 
130 #endif
simulatedArm::simulatedArm
simulatedArm()
Definition: simulatedArm.cpp:29
simulatedArm::Stop
bool Stop()
current movement currently not supported in simulation
Definition: simulatedArm.cpp:73
simulatedArm::MoveJointSpaceSync
bool MoveJointSpaceSync(const std::vector< double > &Angle)
same as MoveJointSpace, but final angles should by reached simultaniously! Returns the time that the ...
Definition: simulatedArm.cpp:80
simulatedArm::waitForSync
bool waitForSync()
Waits until all Modules are homed, writes status comments to out.
Definition: simulatedArm.h:109
simulatedArm::getErrorMessage
std::string getErrorMessage() const
Definition: simulatedArm.h:40
simulatedArm::statusMoving
bool statusMoving()
Returns true if any of the Joints are still moving Should also return true if Joints are accelerating...
Definition: simulatedArm.cpp:282
simulatedMotor
Definition: simulatedMotor.h:24
simulatedArm::setMaxVelocity
bool setMaxVelocity(double radpersec)
Sets the maximum angular velocity (rad/s) for the Joints, use with care! A Value of 0....
Definition: simulatedArm.cpp:200
simulatedArm::statusDec
bool statusDec()
Returns true if any of the Joints are decelerating.
Definition: simulatedArm.cpp:295
simulatedArm::getJointVelocities
bool getJointVelocities(std::vector< double > &result)
Returns the current Angular velocities (Rad/s)
Definition: simulatedArm.cpp:267
PowerCubeCtrlParams
Parameters for cob_powercube_chain.
Definition: PowerCubeCtrlParams.h:26
simulatedArm::m_DOF
int m_DOF
Definition: simulatedArm.h:120
simulatedArm::Close
bool Close()
Definition: simulatedArm.h:45
simulatedArm::setMaxAcceleration
bool setMaxAcceleration(double radPerSecSquared)
Sets the maximum angular acceleration (rad/s^2) for the Joints, use with care! A Value of 0....
Definition: simulatedArm.cpp:228
simulatedArm::Init
bool Init(PowerCubeCtrlParams *params)
Definition: simulatedArm.cpp:43
simulatedArm::m_maxAcc
std::vector< double > m_maxAcc
Definition: simulatedArm.h:127
simulatedArm::m_ErrorMessage
std::string m_ErrorMessage
Definition: simulatedArm.h:122
simulatedArm
Definition: simulatedArm.h:27
simulatedArm::MoveVel
bool MoveVel(const std::vector< double > &)
Moves all cubes by the given velocities.
Definition: simulatedArm.cpp:170
simulatedArm::m_motors
std::vector< simulatedMotor > m_motors
Definition: simulatedArm.h:124
simulatedArm::getConfig
bool getConfig(std::vector< double > &result)
Returns the current Joint Angles.
Definition: simulatedArm.cpp:253
simulatedArm::statusAcc
bool statusAcc()
Returs true if any of the Joints are accelerating.
Definition: simulatedArm.cpp:308
simulatedArm::MovePos
bool MovePos(const std::vector< double > &)
moves all cubes to the given position
Definition: simulatedArm.cpp:185
simulatedArm::m_maxVel
std::vector< double > m_maxVel
Definition: simulatedArm.h:126
simulatedArm::dontWaitForSync
bool dontWaitForSync()
Execute move commands immediately from now on:
Definition: simulatedArm.h:114
simulatedArm::isInitialized
bool isInitialized() const
Definition: simulatedArm.h:35
PowerCubeCtrl.h
simulatedArm::m_Initialized
bool m_Initialized
Definition: simulatedArm.h:121
simulatedArm::~simulatedArm
virtual ~simulatedArm()
Definition: simulatedArm.cpp:37


schunk_powercube_chain
Author(s): Florian Weisshardt
autogenerated on Sat May 7 2022 02:17:15