Skip to content

# Class evam::KickDecor

template <class TMotor, unsigned short tDefaultKickDurationMs, signed short tDefaultKickPower>

ClassList > evam > KickDecor

Decorator that applies a momentary kick to overcome static friction. More...

- `#include <evamKickDecor.h>`

Inherits the following classes: Tickable, TMotor

## Public Functions

Type | Name
--- | ---
unsigned short | GetKickDuration () const Get kick pulse duration.
signed short | GetKickPower () const Get kick power.
void | Go (signed short aValue) Apply the control value with kick-start pulse.
| KickDecor ()
| KickDecor (KickConfig config, Args... args)
void | SetKickDuration (unsigned short aValue) Set kick pulse duration.
void | SetKickPower (signed short aValue) Set kick power.
void | SetupKickstart (unsigned short duration, signed short power) Configure kickstart parameters at once.

## Detailed Description

When starting from stop or changing direction, a power pulse is applied for a short duration to overcome inertia and static friction.

Template parameters:

- `Motor` Base motor class (must implement Go(signed short))
- `kDefaultKickDuration` Default kick pulse duration in milliseconds. Default: 20ms.
- `kDefaultKickPower` Default kick power. Range: -1000..1000. Default: 1000 (full power).

## Public Functions Documentation

### function GetKickDuration

Get kick pulse duration.

    inline unsigned short evam::KickDecor::GetKickDuration () const

Returns:

Kick duration in milliseconds.

### function GetKickPower

Get kick power.

    inline signed short evam::KickDecor::GetKickPower () const

Returns:

Kick power value in range 0..1000.

### function Go

Apply the control value with kick-start pulse.

    inline void evam::KickDecor::Go (
        signed short aValue
    )

Parameters:

- `aValue` Desired control value, range -1000..1000.

### function KickDecor [1/2]

    inline evam::KickDecor::KickDecor ()

### function KickDecor [2/2]

    template<typename... Args>
    inline evam::KickDecor::KickDecor (
        KickConfig config,
        Args... args
    )

### function SetKickDuration

Set kick pulse duration.

    inline void evam::KickDecor::SetKickDuration (
        unsigned short aValue
    )

Parameters:

- `aDuration` Duration in milliseconds, must be > 0.

### function SetKickPower

Set kick power.

    inline void evam::KickDecor::SetKickPower (
        signed short aValue
    )

Parameters:

- `aPower` Power value, clamped to 0..1000.

### function SetupKickstart

Configure kickstart parameters at once.

    inline void evam::KickDecor::SetupKickstart (
        unsigned short duration,
        signed short power
    )

Parameters:

- `aKickDuration` Kick pulse duration in milliseconds
- `aKickPower` Kick power, range -1000..1000

The documentation for this class was generated from the following file `src/evamKickDecor.h`