Go to the documentation of this file.
12 uint16_t module_number, uint8_t motor_number) :
13 Motor(p_nh, p_tmcl_interpreter, module_number, motor_number)
20 const std::string s_statusflags_reg_name =
s_node_name_ +
"/StatusFlags_Reg_name";
24 ROS_WARN_STREAM(
"[" << __func__ <<
"] StatusFlags Register Names are not available.");
26 const std::string s_statusflags_reg_shift =
s_node_name_ +
"/StatusFlags_Reg_shift";
30 ROS_WARN_STREAM(
"[" << __func__ <<
"] StatusFlags Register Shift are not available.");
37 ROS_WARN_STREAM(
"[" << __func__ <<
"] Missing index for StatusFlagsRegisterName / StatusFlagsRegisterShift."
38 "Check autogenerated YAML. StatusFlags wont be used!");
61 ROS_WARN_STREAM(
"[" << __func__ <<
"] \"CommutationMode\" is not available. Setting CommutationMode to Disable");
71 ROS_WARN_STREAM(
"[" << __func__ <<
"] \"PositionScalerM\" is not available");
81 ROS_WARN_STREAM(
"[" << __func__ <<
"] \"EncoderSteps\" is not available.");
100 ROS_INFO_STREAM(
"[" << __func__ <<
"] Position unit: angular degrees");
114 int32_t status_flag = 0;
115 uint8_t bin_index = 0;
116 uint8_t array_index = 0;
117 std::string binary =
" ";
118 std::string status =
" ";
168 for(bin_index = 0; bin_index < binary.length(); bin_index++)
170 if(binary[bin_index] ==
'1')
188 tmc_info_msg_.status =
"StatusFlags Registers Not Available";
275 float val = msg.linear.x;
276 int32_t board_val = 0;
289 ROS_DEBUG_STREAM(
"[" << __func__ <<
"] Subscriber callback entered, received: " << val
290 <<
" board value: " << board_val);
296 ROS_DEBUG_STREAM(
"\n[" << __func__ <<
"] Subscriber callback exited successfully");
305 board_val = abs(board_val);
308 ROS_DEBUG_STREAM(
"\n[" << __func__ <<
"] Subscriber callback exited successfully");
318 float convert_const_deg = 0.00;
319 int32_t unit_val = 0;
320 int32_t val = msg.data;
337 unit_val = val * convert_const_deg;
339 ROS_DEBUG_STREAM(
"[" << __func__ <<
"] Subscriber callback entered, received: " << val <<
" board value: "
344 ROS_DEBUG_STREAM(
"\n[" << __func__ <<
"] Subscriber callback exited successfully");
353 float convert_const_deg = 0;
354 int32_t unit_val = 0;
355 int32_t val = msg.data;
372 unit_val = val * convert_const_deg;
374 ROS_DEBUG_STREAM(
"[" << __func__ <<
"] Subscriber callback entered, received: " << val <<
" board value: "
379 ROS_DEBUG_STREAM(
"\n[" << __func__ <<
"] Subscriber callback exited successfully");
float param_wheel_diameter_
#define ROS_ERROR_STREAM(args)
ros::Subscriber tmc_cmd_relpos_sub_
BLDCMotor(ros::NodeHandle *p_nh, TmclInterpreter *p_tmcl_interpreter, uint16_t module_number, uint8_t motor_number)
bool getParam(const std::string &key, bool &b) const
float param_add_ratio_vel_
bool executeCmd(tmcl_cmd_t cmd, uint8_t type, uint8_t motor, int32_t *val)
std::vector< std::string > param_statusflags_reg_name_
void cmdAbsPosCallback(const std_msgs::Int32 msg) override
const uint16_t ANGULAR_FULL_ROTATION
std::string param_tmc_cmd_vel_topic_
#define ROS_DEBUG_STREAM(args)
void publish(const boost::shared_ptr< M > &message) const
ros::Subscriber tmc_cmd_abspos_sub_
bldc_comm_mode_t comm_mode_
ros::Subscriber tmc_cmd_vel_sub_
#define ROS_WARN_STREAM(args)
std::string param_tmc_cmd_abspos_topic_
ros::Publisher tmc_info_pub_
void rosPublishTmcInfo(const ros::TimerEvent &event) override
TmclInterpreter * p_tmcl_interpreter_
void cmdRelPosCallback(const std_msgs::Int32 msg) override
Subscriber subscribe(const std::string &topic, uint32_t queue_size, const boost::function< void(C)> &callback, const VoidConstPtr &tracked_object=VoidConstPtr(), const TransportHints &transport_hints=TransportHints())
#define ROS_INFO_STREAM(args)
bool param_pub_actual_pos_
bool param_pub_actual_trq_
void cmdVelCallback(const geometry_msgs::Twist &msg) override
adi_tmcl::TmcInfo tmc_info_msg_
float param_add_ratio_pos_
const uint8_t SECS_TO_MIN
std::string param_tmc_cmd_relpos_topic_
virtual void initSubscriber()
float param_add_ratio_trq_
bool param_pub_actual_vel_
std::vector< int > param_statusflags_reg_shift_
bool b_statusflags_register_available_
void initSubscriber() override
std::string param_comm_interface_name_
adi_tmcl
Author(s):
autogenerated on Wed Apr 2 2025 02:43:01