dcm.hpp
Go to the documentation of this file.
1 /*
2  * Copyright 2016 SoftBank Robotics Europe
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 DCM_HPP
19 #define DCM_HPP
20 
21 // NAOqi Headers
22 #include <qi/session.hpp>
23 
27 class DCM
28 {
29 public:
30  DCM(const qi::SessionPtr& session,
31  const double &controller_freq);
32 
34  bool init(const std::vector <std::string> &joints);
35 
37  void writeJoints(const std::vector <double> &joint_commands);
38 
40  bool setStiffness(const float &stiffness);
41 
43  int getTime(const int &offset);
44 
45 private:
47  void createPositionActuatorCommand(const std::vector <std::string> &joints);
48 
50  bool createPositionActuatorAlias(const std::vector <std::string> &joints);
51 
53  bool createHardnessActuatorAlias(const std::vector <std::string> &joints);
54 
56  bool DCMAliasTimedCommand(const std::string& alias,
57  const float& values,
58  const int& timeOffset,
59  const std::string& type_update="Merge");
60 
62  qi::AnyObject dcm_proxy_;
63 
65  std::vector <qi::AnyValue> commands_;
66 
68  std::vector <std::vector <std::vector <qi::AnyValue> > > commands_values_;
69 
72 };
73 #endif // DCM_HPP
This class is a wapper for Naoqi DCM Class.
Definition: dcm.hpp:27
std::vector< double > values
std::vector< std::vector< std::vector< qi::AnyValue > > > commands_values_
Definition: dcm.hpp:68
bool init(const std::vector< std::string > &joints)
initialize all Aliases
Definition: dcm.cpp:38
void writeJoints(const std::vector< double > &joint_commands)
update joints values
Definition: dcm.cpp:206
double controller_freq_
Definition: dcm.hpp:71
DCM(const qi::SessionPtr &session, const double &controller_freq)
Definition: dcm.cpp:24
bool DCMAliasTimedCommand(const std::string &alias, const float &values, const int &timeOffset, const std::string &type_update="Merge")
DCM Wrapper Method.
Definition: dcm.cpp:148
std::vector< qi::AnyValue > commands_
Definition: dcm.hpp:65
qi::AnyObject dcm_proxy_
Definition: dcm.hpp:62
void createPositionActuatorCommand(const std::vector< std::string > &joints)
initialize of DCM Motion commands
Definition: dcm.cpp:54
bool setStiffness(const float &stiffness)
update joints stiffness
Definition: dcm.cpp:240
bool createHardnessActuatorAlias(const std::vector< std::string > &joints)
create Hardness Actuator Alias
Definition: dcm.cpp:112
bool createPositionActuatorAlias(const std::vector< std::string > &joints)
create Position Actuator Alias
Definition: dcm.cpp:79
int getTime(const int &offset)
get time from the DCM proxy
Definition: dcm.cpp:192


naoqi_dcm_driver
Author(s): Konstantinos Chatzilygeroudis , Mikael Arguedas , Karsten Knese , Natalia Lyubova
autogenerated on Thu Jul 25 2019 03:49:27