YouBotBase.hpp
Go to the documentation of this file.
1 #ifndef YOUBOT_YOUBOTBASE_H
2 #define YOUBOT_YOUBOTBASE_H
3 
4 /****************************************************************
5  *
6  * Copyright (c) 2011
7  * All rights reserved.
8  *
9  * Hochschule Bonn-Rhein-Sieg
10  * University of Applied Sciences
11  * Computer Science Department
12  *
13  * +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
14  *
15  * Author:
16  * Jan Paulus, Nico Hochgeschwender, Michael Reckhaus, Azamat Shakhimardanov
17  * Supervised by:
18  * Gerhard K. Kraetzschmar
19  *
20  * +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
21  *
22  * This sofware is published under a dual-license: GNU Lesser General Public
23  * License LGPL 2.1 and BSD license. The dual-license implies that users of this
24  * code may choose which terms they prefer.
25  *
26  * +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
27  *
28  * Redistribution and use in source and binary forms, with or without
29  * modification, are permitted provided that the following conditions are met:
30  *
31  * * Redistributions of source code must retain the above copyright
32  * notice, this list of conditions and the following disclaimer.
33  * * Redistributions in binary form must reproduce the above copyright
34  * notice, this list of conditions and the following disclaimer in the
35  * documentation and/or other materials provided with the distribution.
36  * * Neither the name of the Hochschule Bonn-Rhein-Sieg nor the names of its
37  * contributors may be used to endorse or promote products derived from
38  * this software without specific prior written permission.
39  *
40  * This program is free software: you can redistribute it and/or modify
41  * it under the terms of the GNU Lesser General Public License LGPL as
42  * published by the Free Software Foundation, either version 2.1 of the
43  * License, or (at your option) any later version or the BSD license.
44  *
45  * This program is distributed in the hope that it will be useful,
46  * but WITHOUT ANY WARRANTY; without even the implied warranty of
47  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
48  * GNU Lesser General Public License LGPL and the BSD license for more details.
49  *
50  * You should have received a copy of the GNU Lesser General Public
51  * License LGPL and BSD license along with this program.
52  *
53  ****************************************************************/
54 #include <vector>
55 #include <sstream>
56 #include <string>
67 #include <boost/ptr_container/ptr_vector.hpp>
68 #include <boost/scoped_ptr.hpp>
69 namespace youbot {
70 
72 #define BASEJOINTS 4
73 class YouBotBase {
77  public:
78  YouBotBase(const std::string name, const std::string configFilePath = "../config/");
79 
80  virtual ~YouBotBase();
81 
83  void doJointCommutation();
84 
87  YouBotJoint& getBaseJoint(const unsigned int baseJointNumber);
88 
93  void getBasePosition(quantity<si::length>& longitudinalPosition, quantity<si::length>& transversalPosition, quantity<plane_angle>& orientation);
94 
99  void setBasePosition(const quantity<si::length>& longitudinalPosition, const quantity<si::length>& transversalPosition, const quantity<plane_angle>& orientation);
100 
105  void getBaseVelocity(quantity<si::velocity>& longitudinalVelocity, quantity<si::velocity>& transversalVelocity, quantity<si::angular_velocity>& angularVelocity);
106 
111  void setBaseVelocity(const quantity<si::velocity>& longitudinalVelocity, const quantity<si::velocity>& transversalVelocity, const quantity<si::angular_velocity>& angularVelocity);
112 
115 
119  virtual void setJointData(const std::vector<JointAngleSetpoint>& JointData);
120 
124  virtual void getJointData(std::vector<JointSensedAngle>& data);
125 
129  virtual void setJointData(const std::vector<JointVelocitySetpoint>& JointData);
130 
134  virtual void getJointData(std::vector<JointSensedVelocity>& data);
135 
139  virtual void setJointData(const std::vector<JointCurrentSetpoint>& JointData);
140 
144  virtual void getJointData(std::vector<JointSensedCurrent>& data);
145 
149  virtual void setJointData(const std::vector<JointTorqueSetpoint>& JointData);
150 
154  virtual void getJointData(std::vector<JointSensedTorque>& data);
155 
156 
157  private:
158  YouBotBase(const YouBotBase & source);
159 
160  YouBotBase & operator=(const YouBotBase & source);
161 
163  void commutationFirmware200();
164 
166  void commutationFirmware148();
167 
168  void initializeJoints();
169 
170  void initializeKinematic();
171 
172  boost::scoped_ptr<ConfigFile> configfile;
173 
174  boost::ptr_vector<YouBotJoint> joints;
175 
177 
179 
181 
183 
184  std::vector<std::string> supportedFirmwareVersions;
185 
187 
188 };
189 
190 } // namespace youbot
191 #endif
YouBotBase(const std::string name, const std::string configFilePath="../config/")
Definition: YouBotBase.cpp:55
std::string actualFirmwareVersionAllJoints
Definition: YouBotBase.hpp:186
std::vector< std::string > supportedFirmwareVersions
Definition: YouBotBase.hpp:184
void commutationFirmware200()
does the commutation of the arm joints with firmware 2.0
Definition: YouBotBase.cpp:377
YouBotBase & operator=(const YouBotBase &source)
virtual void getJointData(std::vector< JointSensedAngle > &data)
Definition: YouBotBase.cpp:268
void getBaseVelocity(quantity< si::velocity > &longitudinalVelocity, quantity< si::velocity > &transversalVelocity, quantity< si::angular_velocity > &angularVelocity)
Definition: YouBotBase.cpp:195
void commutationFirmware148()
does the commutation of the arm joints with firmware 1.48 and below
Definition: YouBotBase.cpp:461
EthercatMasterWithThread * ethercatMasterWithThread
Definition: YouBotBase.hpp:182
YouBotJoint & getBaseJoint(const unsigned int baseJointNumber)
Definition: YouBotBase.cpp:110
void getBasePosition(quantity< si::length > &longitudinalPosition, quantity< si::length > &transversalPosition, quantity< plane_angle > &orientation)
Definition: YouBotBase.cpp:123
virtual void setJointData(const std::vector< JointAngleSetpoint > &JointData)
Definition: YouBotBase.cpp:250
void setBasePosition(const quantity< si::length > &longitudinalPosition, const quantity< si::length > &transversalPosition, const quantity< plane_angle > &orientation)
Definition: YouBotBase.cpp:150
The Ethercat Master interface.
virtual ~YouBotBase()
Definition: YouBotBase.cpp:84
void setBaseVelocity(const quantity< si::velocity > &longitudinalVelocity, const quantity< si::velocity > &transversalVelocity, const quantity< si::angular_velocity > &angularVelocity)
Definition: YouBotBase.cpp:223
boost::scoped_ptr< ConfigFile > configfile
Definition: YouBotBase.hpp:172
It groups the base joints together.
Definition: YouBotBase.hpp:76
void doJointCommutation()
does the sine commutation of the base joints
Definition: YouBotBase.cpp:95
EthercatMasterInterface & ethercatMaster
Definition: YouBotBase.hpp:180
boost::ptr_vector< YouBotJoint > joints
Definition: YouBotBase.hpp:174
void initializeKinematic()
Definition: YouBotBase.cpp:690
Implementation of a base kinematic with four swedish wheels. The youBot base kinematic.
FourSwedishWheelOmniBaseKinematic youBotBaseKinematic
This class represents the kinematic of the YouBot.
Definition: YouBotBase.hpp:114
abstract data class for joints
Definition: JointData.hpp:61


youbot_driver
Author(s): Jan Paulus
autogenerated on Mon Jun 10 2019 15:46:25