1 #ifndef CASTER_HARDWARE_SOCKETCAN_H_ 2 #define CASTER_HARDWARE_SOCKETCAN_H_ 12 #include <can_msgs/Frame.h> 13 #include <sensor_msgs/JointState.h> 16 #include <diagnostic_updater/diagnostic_updater.h> 22 #include <caster_base/SetDigitalOutput.h> 24 #define REDUCTION_RATIO 15.0 26 #define CANBUS_BASE_FRAME_FORMAT 0b00000000 27 #define CANBUS_EXTENDED_FRAME_FORMAT 0b10000000 28 #define CANBUS_REMOTE_FRAME 0b00000000 29 #define CANBUS_DATA_FRAME 0b01000000 84 rpm(0), counter(0), status(0), counter_reset(false)
103 void RightMotorCheck(diagnostic_updater::DiagnosticStatusWrapper& status);
104 void StatusCheck(diagnostic_updater::DiagnosticStatusWrapper& status);
105 void ControllerCheck(diagnostic_updater::DiagnosticStatusWrapper& status);
107 bool SetDigitalOutputCB(caster_base::SetDigitalOutput::Request &req, caster_base::SetDigitalOutput::Response &res);
154 position(0), velocity(0), effort(0), velocity_command(0)
159 #endif // CASTER_HARDWARE_SOCKETCAN_H_ bool Query(RoboteqCanOpenObjectDictionary query, uint8_t sub_index, uint8_t data_length)
void ControllerCheck(diagnostic_updater::DiagnosticStatusWrapper &status)
ros::NodeHandle private_nh_
std::string ToBinary(size_t data, uint8_t length)
MotorStatus motor_status_[2]
void Initialize(std::string node_name, ros::NodeHandle &nh, ros::NodeHandle &private_nh)
ros::ServiceServer set_io_service_
diagnostic_updater::Updater diagnostic_updater_
void CanReceiveCallback(const can_msgs::Frame::ConstPtr &msg)
void UpdateHardwareStatus()
std::string receive_topic_
void StatusCheck(diagnostic_updater::DiagnosticStatusWrapper &status)
void ControllerTimerCallback(const ros::TimerEvent &)
void RegisterControlInterfaces()
void RightMotorCheck(diagnostic_updater::DiagnosticStatusWrapper &status)
bool SetDigitalOutputCB(caster_base::SetDigitalOutput::Request &req, caster_base::SetDigitalOutput::Response &res)
hardware_interface::JointStateInterface joint_state_interface_
bool Command(RoboteqCanOpenObjectDictionary query, uint8_t sub_index, uint32_t data, uint8_t data_length)
std::string right_wheel_joint_
RoboteqCanOpenObjectDictionary
struct iqr::CasterHardware::Joint joints_[2]
TFSIMD_FORCE_INLINE tfScalar length(const Quaternion &q)
std::string left_wheel_joint_
hardware_interface::VelocityJointInterface velocity_joint_interface_
void LeftMotorCheck(diagnostic_updater::DiagnosticStatusWrapper &status)
void WriteCommandsToHardware()
void SendCanOpenData(uint32_t node_id, RoboteqClientCommandType type, RoboteqCanOpenObjectDictionary index, uint8_t sub_index, uint32_t data, uint8_t data_length)
controller_manager::ControllerManager * controller_manager_