API Documentation
Loading...
Searching...
No Matches
Motor.h
Go to the documentation of this file.
1/**--------------------------------------------------------------------------------------------
2Copyright (c) 2019, NDEVR LLC
3tyler.parke@ndevr.org
4 __ __ ____ _____ __ __ _______
5 | \ | | | __ \ | ___|\ \ / / | __ \
6 | \ | | | | \ \ | |___ \ \ / / | |__) |
7 | . \| | | |__/ / | |___ \ V / | _ /
8 | |\ |_|_____/__|_____|___\_/____| | \ \
9 |__| \__________________________________| \__\
10
11Subject to the terms of the Enterprise+ Agreement, NDEVR hereby grants
12Licensee a limited, non-exclusive, non-transferable, royalty-free license
13(without the right to sublicense) to use the API solely for the purpose of
14Licensee's internal development efforts to develop applications for which
15the API was provided.
16
17The above copyright notice and this permission notice shall be included in all
18copies or substantial portions of the Software.
19
20THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
21INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
22PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE
23FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
24OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
25DEALINGS IN THE SOFTWARE.
26
27Library: Hardware
28File: Motor
29Included in API: True
30Author(s): Tyler Parke
31 *-----------------------------------------------------------------------------------------**/
32#pragma once
33#include "DLLInfo.h"
34#include <NDEVR/Device.h>
35#include <NDEVR/Angle.h>
36namespace NDEVR
37{
38 class Log;
39 class HARDWARE_API Motor : public Device
40 {
41 public:
42 Motor(const Model& model, ProgressInfo* log = nullptr, QObject* parent = nullptr);
43 [[nodiscard]] virtual Angle<fltp08> location() const;
44 [[nodiscard]] virtual Angle<fltp08> speed() const { return m_current_speed; }
45 [[nodiscard]] virtual Angle<fltp08> parkAngle() const { return m_park_angle; }
46 [[nodiscard]] virtual Angle<fltp08> preferredSpeed() const { return m_preferred_speed; }
47 [[nodiscard]] virtual bool supportsMoveTo() const;
48 [[nodiscard]] virtual bool supportsSetSpeed() const;
49 [[nodiscard]] virtual bool activated() const { return m_activated; };
50 virtual void setLocation(const Angle<fltp08>& location);
51 void setTarget(const Angle<fltp08>& location);
52 virtual void setTarget(const Angle<fltp08>& location, const Angle<fltp08>& speed);
53 virtual void setModelTransformOffset(const Matrix<fltp08>& offset);
54 virtual void setParkAngle(const Angle<fltp08>& location);
55 virtual void setPreferredSpeed(const Angle<fltp08>& location) { m_preferred_speed = location; };
56 virtual void setAxisOfRotation(const Vector<3, fltp08>& rotation_axis);
57 virtual void setTorqueLimit(fltp08 limit) { m_torque_limit = limit; }
58
59 //Speed forward and reverse
61 virtual void setSpeed(const Angle<fltp08>& speed);
62 //turn the motor on or off
63 virtual void setActivated(bool activated);
64 void parkMotor();
65 virtual void parkMotor(const Angle<fltp08>& speed);
66 virtual void updateModel();
67 protected:
79 };
80}
#define HARDWARE_API
Definition DLLInfo.h:74
Stores an angle in an optimized format.
Definition StringStream.h:352
A specification of upper and lower bounds in N-dimensions.
Definition Bounds.hpp:57
Definition Device.h:48
Definition Matrix.hpp:173
Definition Model.h:54
Definition Motor.h:40
Matrix< fltp08 > m_model_transform_offset
Definition Motor.h:74
virtual Angle< fltp08 > parkAngle() const
Definition Motor.h:45
Angle< fltp08 > m_preferred_speed
Definition Motor.h:72
Vector< 3, fltp08 > m_axis_of_rotation
Definition Motor.h:69
virtual Angle< fltp08 > preferredSpeed() const
Definition Motor.h:46
Angle< fltp08 > m_current_angle
Definition Motor.h:70
virtual bool activated() const
Definition Motor.h:49
Angle< fltp08 > m_park_angle
Definition Motor.h:75
virtual Bounds< 2, Angle< fltp08 > > speedRange() const
Definition Motor.h:60
virtual Angle< fltp08 > speed() const
Definition Motor.h:44
Angle< fltp08 > m_current_speed
Definition Motor.h:71
Angle< fltp08 > m_target_angle
Definition Motor.h:73
bool m_activated
Definition Motor.h:78
fltp08 m_torque_limit
Definition Motor.h:77
Time m_initial_target_time
Definition Motor.h:76
virtual void setPreferredSpeed(const Angle< fltp08 > &location)
Definition Motor.h:55
Bounds< 1, Angle< fltp08 > > m_bounds
Definition Motor.h:68
virtual void setTorqueLimit(fltp08 limit)
Definition Motor.h:57
Definition ProgressInfo.hpp:43
Represents a timestamp with utilities for manipulation and conversion.
Definition Time.h:54
An element of a vector space. An element of the real coordinate space Rn Basis vector,...
Definition Vector.hpp:62
Definition ACIColor.h:37
double fltp08
Defines an alias representing an 8 byte floating-point number.
Definition BaseValues.hpp:181
Definition BaseValues.hpp:272