Classes | Public Member Functions | Private Member Functions | Private Attributes | List of all members
husky_base::HuskyHardware Class Reference

#include <husky_hardware.h>

Inheritance diagram for husky_base::HuskyHardware:
Inheritance graph
[legend]

Classes

struct  Joint
 

Public Member Functions

 HuskyHardware (ros::NodeHandle nh, ros::NodeHandle private_nh, double target_control_freq)
 
void reportLoopDuration (const ros::Duration &duration)
 
void updateDiagnostics ()
 
void updateJointsFromHardware ()
 
void writeCommandsToHardware ()
 
- Public Member Functions inherited from hardware_interface::RobotHW
virtual bool checkForConflict (const std::list< ControllerInfo > &info) const
 
virtual bool checkForConflict (const std::list< ControllerInfo > &info) const
 
virtual void doSwitch (const std::list< ControllerInfo > &, const std::list< ControllerInfo > &)
 
virtual void doSwitch (const std::list< ControllerInfo > &, const std::list< ControllerInfo > &)
 
virtual bool init (ros::NodeHandle &root_nh, ros::NodeHandle &robot_hw_nh)
 
virtual bool prepareSwitch (const std::list< ControllerInfo > &start_list, const std::list< ControllerInfo > &stop_list)
 
virtual bool prepareSwitch (const std::list< ControllerInfo > &start_list, const std::list< ControllerInfo > &stop_list)
 
virtual void read (const ros::Time &time, const ros::Duration &period)
 
virtual void read (const ros::Time &time, const ros::Duration &period)
 
 RobotHW ()
 
virtual void write (const ros::Time &time, const ros::Duration &period)
 
virtual void write (const ros::Time &time, const ros::Duration &period)
 
virtual ~RobotHW ()
 
- Public Member Functions inherited from hardware_interface::InterfaceManager
T * get ()
 
std::vector< std::stringgetInterfaceResources (std::string iface_type) const
 
std::vector< std::stringgetNames () const
 
void registerInterface (T *iface)
 
void registerInterfaceManager (InterfaceManager *iface_man)
 

Private Member Functions

double angularToLinear (const double &angle) const
 
void initializeDiagnostics ()
 
void limitDifferentialSpeed (double &travel_speed_left, double &travel_speed_right)
 
double linearToAngular (const double &travel) const
 
void registerControlInterfaces ()
 
void resetTravelOffset ()
 

Private Attributes

ros::Publisher diagnostic_publisher_
 
diagnostic_updater::Updater diagnostic_updater_
 
husky_msgs::HuskyStatus husky_status_msg_
 
hardware_interface::JointStateInterface joint_state_interface_
 
struct husky_base::HuskyHardware::Joint joints_ [4]
 
double max_accel_
 
double max_speed_
 
ros::NodeHandle nh_
 
double polling_timeout_
 
HuskyHardwareDiagnosticTask< clearpath::DataPowerSystempower_status_task_
 
ros::NodeHandle private_nh_
 
HuskyHardwareDiagnosticTask< clearpath::DataSafetySystemStatussafety_status_task_
 
HuskySoftwareDiagnosticTask software_status_task_
 
HuskyHardwareDiagnosticTask< clearpath::DataSystemStatussystem_status_task_
 
hardware_interface::VelocityJointInterface velocity_joint_interface_
 
double wheel_diameter_
 

Additional Inherited Members

- Protected Types inherited from hardware_interface::InterfaceManager
typedef std::vector< InterfaceManager * > InterfaceManagerVector
 
typedef std::map< std::string, void * > InterfaceMap
 
typedef std::map< std::string, std::vector< std::string > > ResourceMap
 
typedef std::map< std::string, size_t > SizeMap
 
- Protected Attributes inherited from hardware_interface::InterfaceManager
boost::ptr_vector< ResourceManagerBaseinterface_destruction_list_
 
InterfaceManagerVector interface_managers_
 
InterfaceMap interfaces_
 
InterfaceMap interfaces_combo_
 
SizeMap num_ifaces_registered_
 
ResourceMap resources_
 

Detailed Description

Class representing Husky hardware, allows for ros_control to modify internal state via joint interfaces

Definition at line 51 of file husky_hardware.h.

Constructor & Destructor Documentation

husky_base::HuskyHardware::HuskyHardware ( ros::NodeHandle  nh,
ros::NodeHandle  private_nh,
double  target_control_freq 
)

Initialize Husky hardware

Definition at line 46 of file husky_hardware.cpp.

Member Function Documentation

double husky_base::HuskyHardware::angularToLinear ( const double &  angle) const
private

RobotHW provides velocity command in rad/s, Husky needs m/s,

Definition at line 235 of file husky_hardware.cpp.

void husky_base::HuskyHardware::initializeDiagnostics ( )
private

Register diagnostic tasks with updater class

Definition at line 93 of file husky_hardware.cpp.

void husky_base::HuskyHardware::limitDifferentialSpeed ( double &  diff_speed_left,
double &  diff_speed_right 
)
private

Scale left and right speed outputs to maintain ros_control's desired trajectory without saturating the outputs

Definition at line 213 of file husky_hardware.cpp.

double husky_base::HuskyHardware::linearToAngular ( const double &  travel) const
private

Husky reports travel in metres, need radians for ros_control RobotHW

Definition at line 227 of file husky_hardware.cpp.

void husky_base::HuskyHardware::registerControlInterfaces ( )
private

Register interfaces with the RobotHW interface manager, allowing ros_control operation

Definition at line 112 of file husky_hardware.cpp.

void husky_base::HuskyHardware::reportLoopDuration ( const ros::Duration duration)

Update diagnostics with control loop timing information

Definition at line 205 of file husky_hardware.cpp.

void husky_base::HuskyHardware::resetTravelOffset ( )
private

Get current encoder travel offsets from MCU and bias future encoder readings against them

Definition at line 73 of file husky_hardware.cpp.

void husky_base::HuskyHardware::updateDiagnostics ( )

External hook to trigger diagnostic update

Definition at line 134 of file husky_hardware.cpp.

void husky_base::HuskyHardware::updateJointsFromHardware ( )

Pull latest speed and travel measurements from MCU, and store in joint structure for ros_control

Definition at line 144 of file husky_hardware.cpp.

void husky_base::HuskyHardware::writeCommandsToHardware ( )

Get latest velocity commands from ros_control via joint structure, and send to MCU

Definition at line 192 of file husky_hardware.cpp.

Member Data Documentation

ros::Publisher husky_base::HuskyHardware::diagnostic_publisher_
private

Definition at line 86 of file husky_hardware.h.

diagnostic_updater::Updater husky_base::HuskyHardware::diagnostic_updater_
private

Definition at line 88 of file husky_hardware.h.

husky_msgs::HuskyStatus husky_base::HuskyHardware::husky_status_msg_
private

Definition at line 87 of file husky_hardware.h.

hardware_interface::JointStateInterface husky_base::HuskyHardware::joint_state_interface_
private

Definition at line 82 of file husky_hardware.h.

struct husky_base::HuskyHardware::Joint husky_base::HuskyHardware::joints_[4]
private
double husky_base::HuskyHardware::max_accel_
private

Definition at line 95 of file husky_hardware.h.

double husky_base::HuskyHardware::max_speed_
private

Definition at line 95 of file husky_hardware.h.

ros::NodeHandle husky_base::HuskyHardware::nh_
private

Definition at line 79 of file husky_hardware.h.

double husky_base::HuskyHardware::polling_timeout_
private

Definition at line 97 of file husky_hardware.h.

HuskyHardwareDiagnosticTask<clearpath::DataPowerSystem> husky_base::HuskyHardware::power_status_task_
private

Definition at line 90 of file husky_hardware.h.

ros::NodeHandle husky_base::HuskyHardware::private_nh_
private

Definition at line 79 of file husky_hardware.h.

HuskyHardwareDiagnosticTask<clearpath::DataSafetySystemStatus> husky_base::HuskyHardware::safety_status_task_
private

Definition at line 91 of file husky_hardware.h.

HuskySoftwareDiagnosticTask husky_base::HuskyHardware::software_status_task_
private

Definition at line 92 of file husky_hardware.h.

HuskyHardwareDiagnosticTask<clearpath::DataSystemStatus> husky_base::HuskyHardware::system_status_task_
private

Definition at line 89 of file husky_hardware.h.

hardware_interface::VelocityJointInterface husky_base::HuskyHardware::velocity_joint_interface_
private

Definition at line 83 of file husky_hardware.h.

double husky_base::HuskyHardware::wheel_diameter_
private

Definition at line 95 of file husky_hardware.h.


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


husky_base
Author(s): Mike Purvis , Paul Bovbel
autogenerated on Fri Oct 2 2020 03:40:07