motor_hardware.h
Go to the documentation of this file.
1 
31 #ifndef MOTORHARDWARE_H
32 #define MOTORHARDWARE_H
33 
37 #include "ros/ros.h"
38 #include "sensor_msgs/JointState.h"
39 
40 #include "std_msgs/Int32.h"
41 #include "std_msgs/UInt32.h"
42 
45 
46 #include <gtest/gtest_prod.h>
47 
49 public:
52  virtual ~MotorHardware();
53  void readInputs();
54  void writeSpeeds();
55  void requestVersion();
56  void setParams(FirmwareParams firmware_params);
57  void sendParams();
58  void setDeadmanTimer(int32_t deadman);
59  void setDebugLeds(bool led1, bool led2);
60 
62 
63 private:
64  void _addOdometryRequest(std::vector<MotorMessage>& commands) const;
65  void _addVelocityRequest(std::vector<MotorMessage>& commands) const;
66 
67  int16_t calculateTicsFromRadians(double radians) const;
68  double calculateRadiansFromTics(int16_t tics) const;
69 
72 
75 
76  int32_t deadman_timer;
77 
78  int32_t sendPid_count;
79 
80  struct Joint {
81  double position;
82  double velocity;
83  double effort;
85 
86  Joint() : position(0), velocity(0), effort(0), velocity_command(0) {}
87  } joints_[2];
88 
91 
112 
114 
115  FRIEND_TEST(MotorHardwareTests, nonZeroWriteSpeedsOutputs);
116  FRIEND_TEST(MotorHardwareTests, odomUpdatesPosition);
117  FRIEND_TEST(MotorHardwareTests, odomUpdatesPositionMax);
118 };
119 
120 #endif
void _addOdometryRequest(std::vector< MotorMessage > &commands) const
ros::Publisher pubU59
FirmwareParams prev_pid_params
ros::Publisher pubS53
virtual ~MotorHardware()
int16_t calculateTicsFromRadians(double radians) const
ros::Publisher pubU56
ros::Publisher pubU50
hardware_interface::JointStateInterface joint_state_interface_
void _addVelocityRequest(std::vector< MotorMessage > &commands) const
ros::Publisher pubU53
ros::Publisher pubU58
ros::Publisher rightError
ros::Publisher pubS55
ros::Publisher pubS52
static FirmwareParams firmware_params
Definition: motor_node.cc:44
struct MotorHardware::Joint joints_[2]
void setDeadmanTimer(int32_t deadman)
void setDebugLeds(bool led1, bool led2)
void setParams(FirmwareParams firmware_params)
FirmwareParams pid_params
ros::Publisher pubU52
ros::Publisher leftError
ros::Publisher pubS57
int32_t sendPid_count
ros::Publisher pubU57
ros::Publisher pubU55
ros::Publisher pubS58
static CommsParams serial_params
Definition: motor_node.cc:45
FRIEND_TEST(MotorHardwareTests, nonZeroWriteSpeedsOutputs)
double calculateRadiansFromTics(int16_t tics) const
ros::Publisher pubS54
hardware_interface::VelocityJointInterface velocity_joint_interface_
ros::Publisher pubU54
ros::Publisher pubS51
ros::Publisher pubS50
int32_t deadman_timer
MotorSerial * motor_serial_
ros::Publisher pubS59
ros::Publisher pubS56
ros::Publisher pubU51
MotorHardware(ros::NodeHandle nh, CommsParams serial_params, FirmwareParams firmware_params)


ubiquity_motor
Author(s):
autogenerated on Mon Jun 10 2019 15:37:24