AgIsoStack++
A control-function-focused implementation of the major ISOBUS and J1939 protocols
Loading...
Searching...
No Matches
Public Member Functions | Private Attributes | List of all members
isobus::SpeedMessagesInterface::GroundBasedSpeedData Class Reference

Message normally sent by the Tractor ECU on the implement bus on construction and agricultural implements providing to connected systems the current measured ground speed (also includes a free-running distance counter and an indication of the direction of travel). More...

#include <isobus_speed_distance_messages.hpp>

Public Member Functions

 GroundBasedSpeedData (std::shared_ptr< ControlFunction > sender)
 Constructor for a GroundBasedSpeedData.
 
std::uint32_t get_machine_distance () const
 Actual distance traveled by a machine, based on measurements from a sensor such as that is not susceptible to wheel slip (e.g. radar, GPS, LIDAR, or stationary object tracking)
 
bool set_machine_distance (std::uint32_t distance)
 Sets the actual distance traveled by a machine, based on measurements from a sensor such as that is not susceptible to wheel slip.
 
std::uint16_t get_machine_speed () const
 Returns the actual ground speed of a machine, measured by a sensor such as that is not susceptible to wheel slip in mm/s.
 
bool set_machine_speed (std::uint16_t speed)
 Sets the actual ground speed of a machine, measured by a sensor such as that is not susceptible to wheel slip in mm/s.
 
MachineDirection get_machine_direction_of_travel () const
 Returns A measured signal indicating either forward or reverse as the direction of travel.
 
bool set_machine_direction_of_travel (MachineDirection directionOfTravel)
 Sets a measured signal indicating either forward or reverse as the direction of travel.
 
std::shared_ptr< ControlFunctionget_sender_control_function () const
 Returns a pointer to the sender of the message. If an ICF is the sender, returns the ICF being used to transmit from.
 
void set_timestamp_ms (std::uint32_t timestamp)
 Sets the timestamp for when the message was received or sent.
 
std::uint32_t get_timestamp_ms () const
 Returns the timestamp for when the message was received, in milliseconds.
 

Private Attributes

std::shared_ptr< ControlFunction > const controlFunction
 The CF that is sending the message.
 
std::uint32_t timestamp_ms = 0
 A timestamp for when the message was released in milliseconds.
 
std::uint32_t groundBasedMachineDistance_mm = 0
 Stores the ground-based speed's distance in millimeters.
 
std::uint16_t groundBasedMachineSpeed_mm_per_sec = 0
 Stores the ground-based speed in mm/s.
 
MachineDirection machineDirectionState = MachineDirection::NotAvailable
 Stores direction of travel.
 

Detailed Description

Message normally sent by the Tractor ECU on the implement bus on construction and agricultural implements providing to connected systems the current measured ground speed (also includes a free-running distance counter and an indication of the direction of travel).

Note
Accuracies of both wheel-based and ground-based sources can be speed-dependent and degrade at low speeds. Wheel-based information might not be updated at the 100ms rate at low speeds.

Definition at line 349 of file isobus_speed_distance_messages.hpp.

Constructor & Destructor Documentation

◆ GroundBasedSpeedData()

isobus::SpeedMessagesInterface::GroundBasedSpeedData::GroundBasedSpeedData ( std::shared_ptr< ControlFunction > sender)
explicit

Constructor for a GroundBasedSpeedData.

Parameters
[in]senderThe control function that is sending this message

Definition at line 277 of file isobus_speed_distance_messages.cpp.

Member Function Documentation

◆ get_machine_direction_of_travel()

SpeedMessagesInterface::MachineDirection isobus::SpeedMessagesInterface::GroundBasedSpeedData::get_machine_direction_of_travel ( ) const

Returns A measured signal indicating either forward or reverse as the direction of travel.

Note
When the speed is zero, this indicates the last travel direction until a different direction is detected or selected and engaged.
Returns
The measured direction of travel for the machine

Definition at line 319 of file isobus_speed_distance_messages.cpp.

Here is the caller graph for this function:

◆ get_machine_distance()

std::uint32_t isobus::SpeedMessagesInterface::GroundBasedSpeedData::get_machine_distance ( ) const

Actual distance traveled by a machine, based on measurements from a sensor such as that is not susceptible to wheel slip (e.g. radar, GPS, LIDAR, or stationary object tracking)

Note
This distance is usually provided by radar.
Returns
Actual distance traveled by a machine, based on measurements from a sensor such as that is not susceptible to wheel slip (millimeters)

Definition at line 282 of file isobus_speed_distance_messages.cpp.

Here is the caller graph for this function:

◆ get_machine_speed()

std::uint16_t isobus::SpeedMessagesInterface::GroundBasedSpeedData::get_machine_speed ( ) const

Returns the actual ground speed of a machine, measured by a sensor such as that is not susceptible to wheel slip in mm/s.

Note
This speed is usually provided by radar.
Returns
The actual ground speed of a machine, measured by a sensor such as that is not susceptible to wheel slip in mm/s

Definition at line 301 of file isobus_speed_distance_messages.cpp.

Here is the caller graph for this function:

◆ get_sender_control_function()

std::shared_ptr< ControlFunction > isobus::SpeedMessagesInterface::GroundBasedSpeedData::get_sender_control_function ( ) const

Returns a pointer to the sender of the message. If an ICF is the sender, returns the ICF being used to transmit from.

Attention
The only way you could get an invalid pointer here is if you register a partner, it sends this message, then you delete the partner and call this function, as that is the only time the stack deletes a control function. That would be abnormal program flow, but at some point the stack will be updated to return a shared or weak pointer instead, but for now please be aware of that limitation. Eventually though the message will time-out normally and you can get a new pointer for the external CF that replaces the deleted partner.
Returns
The control function sending this instance of the guidance system command message

Definition at line 331 of file isobus_speed_distance_messages.cpp.

Here is the caller graph for this function:

◆ get_timestamp_ms()

std::uint32_t isobus::SpeedMessagesInterface::GroundBasedSpeedData::get_timestamp_ms ( ) const

Returns the timestamp for when the message was received, in milliseconds.

Returns
The timestamp for when the message was received, in milliseconds

Definition at line 341 of file isobus_speed_distance_messages.cpp.

◆ set_machine_direction_of_travel()

bool isobus::SpeedMessagesInterface::GroundBasedSpeedData::set_machine_direction_of_travel ( MachineDirection directionOfTravel)

Sets a measured signal indicating either forward or reverse as the direction of travel.

Note
The "Not Off" key switch state does not always mean "On" so use care when using it.
Parameters
directionOfTravelThe measured direction of travel for the machine
Returns
True if the set value was different from the stored value otherwise false

Definition at line 324 of file isobus_speed_distance_messages.cpp.

◆ set_machine_distance()

bool isobus::SpeedMessagesInterface::GroundBasedSpeedData::set_machine_distance ( std::uint32_t distance)

Sets the actual distance traveled by a machine, based on measurements from a sensor such as that is not susceptible to wheel slip.

Note
This distance is usually provided by radar.
Parameters
distanceThe actual distance traveled by a machine (millimeters)
Returns
True if the set value was different from the stored value otherwise false

Definition at line 294 of file isobus_speed_distance_messages.cpp.

◆ set_machine_speed()

bool isobus::SpeedMessagesInterface::GroundBasedSpeedData::set_machine_speed ( std::uint16_t speed)

Sets the actual ground speed of a machine, measured by a sensor such as that is not susceptible to wheel slip in mm/s.

Note
This speed is usually provided by radar.
Parameters
speedThe actual ground speed of a machine, measured by a sensor such as that is not susceptible to wheel slip in mm/s
Returns
True if the set value was different from the stored value otherwise false

Definition at line 312 of file isobus_speed_distance_messages.cpp.

◆ set_timestamp_ms()

void isobus::SpeedMessagesInterface::GroundBasedSpeedData::set_timestamp_ms ( std::uint32_t timestamp)

Sets the timestamp for when the message was received or sent.

Parameters
[in]timestampThe timestamp, in milliseconds, when the message was sent or received

Definition at line 336 of file isobus_speed_distance_messages.cpp.

Member Data Documentation

◆ controlFunction

std::shared_ptr<ControlFunction> const isobus::SpeedMessagesInterface::GroundBasedSpeedData::controlFunction
private

The CF that is sending the message.

Definition at line 409 of file isobus_speed_distance_messages.hpp.

◆ groundBasedMachineDistance_mm

std::uint32_t isobus::SpeedMessagesInterface::GroundBasedSpeedData::groundBasedMachineDistance_mm = 0
private

Stores the ground-based speed's distance in millimeters.

Definition at line 411 of file isobus_speed_distance_messages.hpp.

◆ groundBasedMachineSpeed_mm_per_sec

std::uint16_t isobus::SpeedMessagesInterface::GroundBasedSpeedData::groundBasedMachineSpeed_mm_per_sec = 0
private

Stores the ground-based speed in mm/s.

Definition at line 412 of file isobus_speed_distance_messages.hpp.

◆ machineDirectionState

MachineDirection isobus::SpeedMessagesInterface::GroundBasedSpeedData::machineDirectionState = MachineDirection::NotAvailable
private

Stores direction of travel.

Definition at line 413 of file isobus_speed_distance_messages.hpp.

◆ timestamp_ms

std::uint32_t isobus::SpeedMessagesInterface::GroundBasedSpeedData::timestamp_ms = 0
private

A timestamp for when the message was released in milliseconds.

Definition at line 410 of file isobus_speed_distance_messages.hpp.


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