sbgisen / vesc

VESC Interface for ROS
Apache License 2.0
41 stars 33 forks source link

Print WARNING if PID control is called before updating sensor values #64

Closed nyxrobotics closed 1 year ago

nyxrobotics commented 1 year ago

Abstract

If the PID loop is called multiple times with no sensor values updated, feedback control will not function. At the beginning of the PID control function, it is necessary to check if the sensor value has been updated or not. If not updated, WARNING should be displayed.

Purpose

Implementation Details

nyxrobotics commented 1 year ago

When a sensor value is updated, it enters the following function https://github.com/sbgisen/vesc/blob/d96dcc2d81419f33647b37b249769c0101b7b7f5/vesc_driver/src/vesc_interface.cpp#L80-L83

nyxrobotics commented 1 year ago

When running vesc alone, it responds fine even at 100Hz.

nyxrobotics commented 1 year ago

No error or warning is generated when control_rate is set to a value greater than the communication cycle available. (ex. 10000Hz)

nyxrobotics commented 1 year ago

The flow of communication between PC and vesc is

It is the timing of the transmission that needs to be checked to see if the communication is working in time.