Go to the documentation of this file. 1 #ifndef DIFFBOT_HW_INTERFACE_H
2 #define DIFFBOT_HW_INTERFACE_H
11 #include <sensor_msgs/JointState.h>
234 #endif // DIFFBOT_HW_INTERFACE_H
hardware_interface::VelocityJointInterface velocity_joint_interface_
ros::Publisher pub_left_motor_value_
virtual void read(const ros::Time &time, const ros::Duration &period) override
Read data from the robot hardware.
virtual void write(const ros::Time &time, const ros::Duration &period)
Write commands to the robot hardware.
virtual void printState()
Helper for debugging a joint's state.
void encoderTicksCallback(const diffbot_msgs::EncodersStamped::ConstPtr &msg_encoders)
Callback to receive the encoder ticks from Teensy MCU.
hardware_interface::JointStateInterface joint_state_interface_
ros::Subscriber sub_measured_joint_states_
double linearToAngular(const double &distance) const
DiffBot reports travel distance in metres, need radians for ros_control RobotHW.
std::string printStateHelper()
virtual void loadURDF(const ros::NodeHandle &nh, std::string param_name)
Get the URDF XML from the parameter server.
std::string printCommandHelper()
Helper for debugging a joint's command.
ros::Subscriber sub_encoder_ticks_
ros::Publisher pub_right_motor_value_
double joint_velocity_commands_[NUM_JOINTS]
JointState measured_joint_states_[NUM_JOINTS]
double angularToLinear(const double &angle) const
RobotHW provides velocity command in rad/s, DiffBot needs m/s.
ros::ServiceServer srv_stop_
double encoder_resolution_
virtual bool init(ros::NodeHandle &root_nh, ros::NodeHandle &robot_hw_nh)
The init function is called to initialize the RobotHW from a non-realtime thread.
DiffBotHWInterface(ros::NodeHandle &nh, urdf::Model *urdf_model=NULL)
Constructor.
double normalizeAngle(double &angle) const
Normalize angle in the range of [0, 360)
virtual ~DiffBotHWInterface()
Destructor.
ros::ServiceServer srv_start_
double joint_velocities_[NUM_JOINTS]
ros::Publisher pub_reset_encoders_
std::vector< std::string > joint_names_
int encoder_ticks_[NUM_JOINTS]
double joint_efforts_[NUM_JOINTS]
urdf::Model * urdf_model_
const unsigned int NUM_JOINTS
ros::Publisher pub_wheel_cmd_velocities_
void measuredJointStatesCallback(const sensor_msgs::JointState::ConstPtr &msg_joint_states)
Callback to receive the measured joint states from Teensy MCU.
Hardware interface for a robot.
double joint_positions_[NUM_JOINTS]
double ticksToAngle(const int &ticks) const
Convert number of encoder ticks to angle in radians.
bool isReceivingMeasuredJointStates(const ros::Duration &timeout=ros::Duration(1))
Check if measured joint states (position and velocity) are received.
diffbot_base
Author(s):
autogenerated on Thu Sep 7 2023 02:35:23