RoboidControl
Loading...
Searching...
No Matches
d:/PlatformIO/RoboidControl/DifferentialDrive.h
Go to the documentation of this file.
1#pragma once
2
3#include "Propulsion.h"
4
5namespace Passer {
6namespace RoboidControl {
7
18public:
28 // DifferentialDrive(Placement leftMotorPlacement,
29 // Placement rightMotorPlacement);
30
31 DifferentialDrive(Motor *leftMotor, Motor *rightMotor);
32
34
38 void SetMotorTargetSpeeds(float leftSpeed, float rightSpeed);
39
43 virtual void SetTwistSpeed(float forward, float yaw) override;
50 virtual void SetTwistSpeed(Vector2 linear, float yaw = 0.0F);
59 virtual void SetTwistSpeed(Vector3 linear, float yaw = 0.0F,
60 float pitch = 0.0F, float roll = 0.0F);
61
62 virtual void SetVelocity(Polar velocity);
63
71 virtual Polar GetVelocity() override;
79 virtual float GetAngularVelocity() override;
80
81protected:
82 float wheelDiameter = 1.0F; // in meters
83 float wheelSeparation = 1.0F; // in meters;
84
85 float rpsToMs = 1.0F; // convert revolutions per second to meters per second
86};
87
88} // namespace RoboidControl
89} // namespace Passer
90using namespace Passer::RoboidControl;
A two-wheeled Propulsion method.
Definition DifferentialDrive.h:17
virtual float GetAngularVelocity() override
Calculate the angular velocity of the roboid based on the wheel velocities.
Definition DifferentialDrive.cpp:91
float wheelDiameter
Definition DifferentialDrive.h:82
float wheelSeparation
Definition DifferentialDrive.h:83
virtual Polar GetVelocity() override
Calculate the linear velocity of the roboid based on the wheel velocities.
Definition DifferentialDrive.cpp:75
virtual void SetTwistSpeed(float forward, float yaw) override
Controls the motors through forward and rotation speeds.
Definition DifferentialDrive.cpp:50
DifferentialDrive()
Default constructor.
Definition DifferentialDrive.cpp:7
float rpsToMs
Definition DifferentialDrive.h:85
void SetDimensions(float wheelDiameter, float wheelSeparation)
Definition DifferentialDrive.cpp:24
void SetMotorTargetSpeeds(float leftSpeed, float rightSpeed)
Set the target speeds of the motors directly.
Definition DifferentialDrive.cpp:35
virtual void SetVelocity(Polar velocity)
Definition DifferentialDrive.cpp:71
A Motor is a Thing which can move parts of the Roboid.
Definition Motor.h:12
The Propulsion module for a Roboid is used to move the Roboid in space.
Definition Propulsion.h:18
Definition Accelerometer.h:7
Definition AbsoluteEncoder.h:5