RoboidControl for Arduino
Loading...
Searching...
No Matches
Propulsion.h
Go to the documentation of this file.
1#pragma once
2
3#include "Motor.h"
4#include "Placement.h"
5#include "Vector2.h"
6
7namespace Passer {
8namespace RoboidControl {
9
17 public:
19 Propulsion();
20
23 void Update(float currentTimeMs);
24
27 unsigned int GetMotorCount();
32 Motor* GetMotor(unsigned int motorIx);
37 Placement* GetMotorPlacement(unsigned int motorIx);
38
39 // Velocity control
40
46 virtual void SetTwistSpeed(float forward, float yaw = 0.0F);
53 virtual void SetTwistSpeed(Vector2 linear, float yaw = 0.0F);
59 virtual void SetTwistSpeed(Vector3 linear,
60 float yaw = 0.0F,
61 float pitch = 0.0F,
62 float roll = 0.0F);
63
64 protected:
66 unsigned int motorCount = 0;
68 Placement* placement = nullptr;
69};
70
71} // namespace RoboidControl
72} // namespace Passer
73using namespace Passer::RoboidControl;
A Motor is a Thing which can move parts of the Roboid.
Definition Motor.h:11
A plament is used to specify where a Thing is placed on the Roboid.
Definition Placement.h:38
The Propulsion module for a Roboid is used to move the Roboid in space.
Definition Propulsion.h:16
void Update(float currentTimeMs)
Update the propulsion state of the Roboid.
Definition Propulsion.cpp:38
virtual void SetTwistSpeed(float forward, float yaw=0.0F)
Sets the forward and rotation speed of a (grounded) Roboid.
Definition Propulsion.cpp:40
Motor * GetMotor(unsigned int motorIx)
Get a specific motor.
Definition Propulsion.cpp:16
unsigned int motorCount
The number of motors used for Propulsion.
Definition Propulsion.h:66
Placement * placement
The Placement of the motors used for Propulsion.
Definition Propulsion.h:68
Placement * GetMotorPlacement(unsigned int motorIx)
Get the Placement of a specific Motor.
Definition Propulsion.cpp:27
Propulsion()
Default Constructor for Propulsion.
Definition Propulsion.cpp:7
unsigned int GetMotorCount()
Get the number of motors in this roboid.
Definition Propulsion.cpp:12
Definition DRV8833.h:7
Definition DRV8833.h:6
A 2-dimensional vector.
Definition Vector2.h:31
A 3-dimensional vector.
Definition Vector3.h:35