Fawkes API  Fawkes Development Version
manipulator.cpp
1 
2 /***************************************************************************
3  * manipulator.cpp - Fawkes to OpenRAVE Manipulator Data
4  *
5  * Created: Thu Sep 16 14:50:34 2010
6  * Copyright 2010 Bahram Maleki-Fard, AllemaniACs RoboCup Team
7  *
8  ****************************************************************************/
9 
10 /* This program is free software; you can redistribute it and/or modify
11  * it under the terms of the GNU General Public License as published by
12  * the Free Software Foundation; either version 2 of the License, or
13  * (at your option) any later version.
14  *
15  * This program is distributed in the hope that it will be useful,
16  * but WITHOUT ANY WARRANTY; without even the implied warranty of
17  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18  * GNU Library General Public License for more details.
19  *
20  * Read the full text in the LICENSE.GPL file in the doc directory.
21  */
22 
23 #include "manipulator.h"
24 
25 #include <vector>
26 
27 namespace fawkes {
28 #if 0 /* just to make Emacs auto-indent happy */
29 }
30 #endif
31 
32 /** @class OpenRaveManipulator <plugins/openrave/manipulator.h>
33  * Class containing information about all manipulator motors.
34  * @author Bahram Maleki-Fard
35  */
36 
37 /** Constructor
38  * @param count number of motors of OpenRAVE model
39  * @param count_device number of motors of real device
40  */
41 OpenRaveManipulator::OpenRaveManipulator(unsigned int count, unsigned int count_device) :
42  __cnt( count ),
43  __cnt_device( count_device )
44 {
45 }
46 
47 /** Destructor. */
49 {
50 }
51 
52 
53 /** Adds a motor to the list(vector) of motors
54  * @param number motor number in OpenRAVE
55  * @param number_device motor number of real device
56  */
57 void
58 OpenRaveManipulator::add_motor(unsigned int number, unsigned int number_device)
59 {
60  motor_t motor;
61  motor.no = number;
62  motor.no_device = number_device;
63  motor.angle = 0.f;
64 
65  __motors.push_back(motor);
66 }
67 
68 } // end of namespace fawkes
Fawkes library namespace.
unsigned int no_device
motor number of real device
Definition: types.h:69
unsigned int no
motor number in OpenRAVE
Definition: types.h:68
OpenRaveManipulator(unsigned int count, unsigned int count_device)
Constructor.
Definition: manipulator.cpp:41
float angle
radian angle
Definition: types.h:70
Struct containing angle of current motor, its number in OpenRAVE and corresponding motor number of re...
Definition: types.h:67
virtual ~OpenRaveManipulator()
Destructor.
Definition: manipulator.cpp:48
void add_motor(unsigned int number, unsigned int number_device)
Adds a motor to the list(vector) of motors.
Definition: manipulator.cpp:58
std::vector< motor_t > __motors
vector of motors
Definition: manipulator.h:71