Project Chrono: chrono::curiosity::CuriosityDriver Class Reference

Public Types | Public Member Functions | Protected Member Functions | Protected Attributes | Friends | List of all members
chrono::curiosity::CuriosityDriver Class Referenceabstract
Models » Robot models » Curiosity Mars rover model

## Description

Base class definition for a Curiosity driver.

A derived class must implement the Update function to set the various motor controls at the current time. Alternatively, a derived class may directly access the associate Curiosity rover and control it through different means (such as applying torques to the wheel driveshafts).

`#include <Curiosity.h>`

Inheritance diagram for chrono::curiosity::CuriosityDriver:
[legend]
Collaboration diagram for chrono::curiosity::CuriosityDriver:
[legend]

## Public Types
enum class | DriveMotorType { SPEED , TORQUE }
| Type of drive motor control. More...

## Public Member Functions
void | SetSteering (double angle)
| Set current steering input (angle: negative for left turn, positive for right turn).
void | SetSteering (double angle, CuriosityWheelID id)
| Set current steering input (angle: negative for left turn, positive for right turn).
virtual DriveMotorType | GetDriveMotorType () const =0
| Indicate the control type for the drive motors.

## Protected Member Functions
virtual void | Update (double time)=0
| Set the current rover driver inputs.

## Protected Attributes
Curiosity * | curiosity
| associated Curiosity rover
std::array< double, 6 > | drive_speeds
| angular speeds for drive motors (positive for forward motion)
std::array< double, 4 > | steer_angles
| angles for steer motors (negative for left turn, positive for right turn)

## Friends
class | Curiosity

## Member Enumeration Documentation

## ◆ DriveMotorType

enum class chrono::curiosity::CuriosityDriver::DriveMotorType
| strong

Type of drive motor control.

Enumerator
SPEED | angular speed
TORQUE | torque

## Member Function Documentation

## ◆ SetSteering() [1/2]

void chrono::curiosity::CuriosityDriver::SetSteering | ( | double | angle | ) |

Set current steering input (angle: negative for left turn, positive for right turn).

This function sets the same steering angle for all steerable wheels.

## ◆ SetSteering() [2/2]

void chrono::curiosity::CuriosityDriver::SetSteering | ( | double | angle,
|  | CuriosityWheelID | id )

Set current steering input (angle: negative for left turn, positive for right turn).

This function sets the steering angle for the specified wheel.

## ◆ Update()

virtual void chrono::curiosity::CuriosityDriver::Update | ( | double | time | ) |
| protectedpure virtual

Set the current rover driver inputs.

This function is called by the associated Curiosity at each rover Update. A derived class must update the values for the angular speeds for the drive motors, as well as the angles for the steering motors and the lift motors at the specified time. A positive steering input corresponds to a left turn and a negative value to a right turn.

The documentation for this class was generated from the following files:

- D:/W/B/src/chrono-9.0.1/src/chrono_models/robot/curiosity/Curiosity.h
- D:/W/B/src/chrono-9.0.1/src/chrono_models/robot/curiosity/Curiosity.cpp