tmcl_ros.cpp
Go to the documentation of this file.
1 
6 #include "tmcl_ros.h"
7 
9 
10 /* Constructor */
12 p_nh_ (p_nh),
13 p_motor_(1),
14 p_tmcl_interpreter_(nullptr)
15 {
16  ROS_DEBUG_STREAM("[TmclROS::" << __func__ << "] called");
17 }
18 
19 /* Destructor */
21 {
22  ROS_DEBUG_STREAM("[TmclROS::" << __func__ << "] called");
23 
24  for(uint8_t index = 0; index < p_motor_.size(); index++)
25  {
26  delete p_motor_[index];
27  p_motor_[index] = nullptr;
28  }
29 
30  if(p_tmcl_interpreter_ != nullptr)
31  {
32  delete p_tmcl_interpreter_;
33  p_tmcl_interpreter_ = nullptr;
34  p_nh_ = nullptr;
35  }
36 }
37 
38 /* Initialization */
40 {
41  bool b_result = false;
42  bool b_autostart_mode = false;
43  int32_t val = 0;
44  uint8_t instruction = 0;
45  uint8_t firmware_value[TMCL_MSG_VALUE_SZ];
46 
47  total_motors_ = 0;
48 
49  ROS_INFO_STREAM("[TmclROS::" << __func__ << "] called");
50 
53  ROS_INFO_STREAM("[" << __func__ << "] Namespace: " << s_namespace_);
54  ROS_INFO_STREAM("[" << __func__ << "] Node name: " << s_node_name_);
55  if(validateParams())
56  {
57  /* Initialize TMCL Interpreter */
64 
65  /* Reset the interface to be used */
67  {
68  ROS_INFO_STREAM("[" << __func__ << "] resetInterface() success");
69 
70  /* Try to get FW version first before proceeding */
71  if(p_tmcl_interpreter_->executeCmd(TMCL_CMD_APPGFWV, 0x01, 0x00, &val))
72  {
73  /* Parse value for total motors, motor type and firmware version */
74  firmware_value[0] = (val & 0xFF000000) >> 24;
75  firmware_value[1] = (val & 0x00FF0000) >> 16;
76  firmware_value[2] = (val & 0x0000FF00) >> 8;
77  firmware_value[3] = (val & 0x000000FF);
78  module_number_ = (firmware_value[0] << 8) + (firmware_value[1]);
80  motor_type_ = (module_number_ - (total_motors_*1000)) / 100;
81 
82  ROS_INFO("[%s] Module number : %d", __func__, module_number_);
83  ROS_INFO("[%s] Firmware version : %d.%d", __func__, firmware_value[2], firmware_value[3]);
84 
85  /* Try to get Autostart mode value */
86  auto iterator = std::find(param_gp_name_.begin(), param_gp_name_.end(), "auto start mode");
87  if(iterator != param_gp_name_.end())
88  {
89  instruction = param_gp_type_[std::distance(param_gp_name_.begin(), iterator)];
90  (void) p_tmcl_interpreter_->executeCmd(TMCL_CMD_GGP, instruction, 0x00, &val);
91  b_autostart_mode = val;
92  }
93  else
94  {
95  ROS_WARN_STREAM("[" << __func__ << "] Auto start mode not available");
96  }
97 
98  if(b_autostart_mode)
99  {
100  ROS_INFO_STREAM("[" << __func__ << "] Auto start mode is enabled");
101  ROS_INFO_STREAM("[" << __func__ << "] Wait " << 2.0 + param_auto_start_additional_delay_
102  << "secs to autostart TMCL program");
104  }
105  else
106  {
107  ROS_INFO_STREAM("[" << __func__ << "] Auto start mode is disabled");
108  }
109 
110  createMotor();
111  initService();
112  b_result = true;
113  }
114  }
115  else
116  {
117  ROS_ERROR_STREAM("[" << __func__ << "] resetInterface failed");
118  }
119  }
120  else
121  {
122  ROS_ERROR_STREAM("[" << __func__ << "] validateParams failed");
123  }
124 
125  return b_result;
126 }
127 
129 {
130  bool b_result = true;
131 
132  ROS_INFO_STREAM("[TmclROS::" << __func__ << "] called");
133 
134  /* Get all configuration values from ROS parameters */
135  /*================================================================================================================*/
136  /* Parameters from Autogenerated YAML. Node will exit if any of the parameters is/are missing/broken */
137  /*================================================================================================================*/
138  const std::string s_ap_name = s_node_name_ + "/AP_name";
139  if(!p_nh_->getParam(s_ap_name, param_ap_name_))
140  {
141  ROS_ERROR_STREAM("[" << __func__ << "] Failed to get AP_name. "
142  "Check autogenerated YAML if broken or missing. Exiting!");
143  b_result = false;
144  }
145  const std::string s_ap_type = s_node_name_ + "/AP_type";
146  if(b_result && !p_nh_->getParam(s_ap_type, param_ap_type_))
147  {
148  ROS_ERROR_STREAM("[" << __func__ << "] Failed to get AP_type. "
149  "Check autogenerated YAML if broken or missing. Exiting!");
150  b_result = false;
151  }
152 
153  /* Check if AP_name and AP_type vectors have the same length/size */
154  if(b_result && (param_ap_name_.size() != param_ap_type_.size()))
155  {
156  ROS_ERROR_STREAM("[" << __func__ << "] Vector size mismatch between AP_name and AP_type. "
157  "Check autogenerated YAML. Exiting!");
158  b_result = false;
159  }
160 
161  const std::string s_gp_name = s_node_name_ + "/GP_name";
162  if(b_result && !p_nh_->getParam(s_gp_name, param_gp_name_))
163  {
164  ROS_ERROR_STREAM("[" << __func__ << "] Failed to get GP_name. "
165  "Check autogenerated YAML if broken or missing. Exiting!");
166  b_result = false;
167  }
168  const std::string s_gp_type = s_node_name_ + "/GP_type";
169  if(b_result && !p_nh_->getParam(s_gp_type, param_gp_type_))
170  {
171  ROS_ERROR_STREAM("[" << __func__ << "] Failed to get GP_type. "
172  "Check autogenerated YAML if broken or missing. Exiting!");
173  b_result = false;
174  }
175 
176  /* Check if GP_name and GP_type vectors have the same length/size */
177  if(b_result && (param_gp_name_.size() != param_gp_type_.size()))
178  {
179  ROS_ERROR_STREAM("[" << __func__ << "] Vector size mismatch between GP_name and GP_type. "
180  "Check autogenerated YAML. Exiting!");
181  b_result = false;
182  }
183 
184  if(b_result)
185  {
186 
187  /*==============================================================================================================*/
188  /*Parameters with no limits */
189  /*==============================================================================================================*/
190  const std::string s_comm_interface = s_node_name_ + "/comm_interface";
191  if(!p_nh_->getParam(s_comm_interface, param_comm_interface_))
192  {
194  p_nh_->setParam(s_comm_interface, param_comm_interface_);
195  ROS_WARN_STREAM("[" << __func__ << "] Failed to get comm_interface, setting to default value: "
197  }
198  const std::string s_comm_interface_name = s_node_name_ + "/comm_interface_name";
199  if(!p_nh_->getParam(s_comm_interface_name, param_comm_interface_name_))
200  {
202  p_nh_->setParam(s_comm_interface_name, param_comm_interface_name_);
203  ROS_WARN_STREAM("[" << __func__ << "] Failed to get comm_interface_name, setting to default value: "
205  }
206  const std::string s_adhoc_mode= s_node_name_ + "/adhoc_mode";
207  if(!p_nh_->getParam(s_adhoc_mode, param_adhoc_mode_))
208  {
209  param_adhoc_mode_ = false;
210  p_nh_->setParam(s_adhoc_mode, param_adhoc_mode_);
211  ROS_WARN_STREAM("[" << __func__ << "] Failed to get adhoc_mode, setting to default value: "
212  << param_adhoc_mode_);
213  }
214 
215  /*==============================================================================================================*/
216  /*Parameters with limits. Will turn values to default if limit exceeds*/
217  /*==============================================================================================================*/
218  const std::string s_comm_tx_id = s_node_name_ + "/comm_tx_id";
219  if(!p_nh_->getParam(s_comm_tx_id, param_comm_tx_id_))
220  {
222  p_nh_->setParam(s_comm_tx_id, param_comm_tx_id_);
223  ROS_WARN_STREAM("[" << __func__ << "] Failed to get comm_tx_id, setting to default value: "
224  << param_comm_tx_id_);
225  }
226  else
227  {
228  if(param_comm_tx_id_ < 0 || param_comm_tx_id_ > TXRX_ID_MAX)
229  {
231  p_nh_->setParam(s_comm_tx_id, param_comm_tx_id_);
232  ROS_WARN_STREAM("[" << __func__ << "] Set value to comm_tx_id is out of range, "
233  "setting comm_tx_id value to default: " << param_comm_tx_id_);
234  }
235  }
236  const std::string s_comm_rx_id = s_node_name_ + "/comm_rx_id";
237  if(!p_nh_->getParam(s_comm_rx_id, param_comm_rx_id_))
238  {
240  p_nh_->setParam(s_comm_rx_id, param_comm_rx_id_);
241  ROS_WARN_STREAM("[" << __func__ << "] Failed to get comm_rx_id, setting to default value: "
242  << param_comm_rx_id_);
243  }
244  else
245  {
246  if(param_comm_rx_id_ < 0 || param_comm_rx_id_ > TXRX_ID_MAX)
247  {
249  p_nh_->setParam(s_comm_rx_id, param_comm_rx_id_);
250  ROS_WARN_STREAM("[" << __func__ << "] Set value to comm_rx_id is out of range, "
251  "setting comm_rx_id value to default: " << param_comm_rx_id_);
252  }
253  }
254  const std::string s_comm_timeout_ms = s_node_name_ + "/comm_timeout_ms";
255  if(!p_nh_->getParam(s_comm_timeout_ms, param_comm_timeout_ms_))
256  {
258  p_nh_->setParam(s_comm_timeout_ms, param_comm_timeout_ms_);
259  ROS_WARN_STREAM("[" << __func__ << "] Failed to get comm_timeout_ms, setting to default value: "
261  }
262  else
263  {
264  if(param_comm_timeout_ms_ < 0 || param_comm_timeout_ms_ > TIMEOUT_MS_MAX)
265  {
267  p_nh_->setParam(s_comm_timeout_ms, param_comm_timeout_ms_);
268  ROS_WARN_STREAM("[" << __func__ << "] Set value to comm_timeout_ms is out of range, "
269  "setting comm_timeout_ms value to default: " << param_comm_timeout_ms_);
270  }
271  }
272  const std::string s_comm_exec_cmd_retries = s_node_name_ + "/comm_exec_cmd_retries";
273  if(!p_nh_->getParam(s_comm_exec_cmd_retries, param_comm_exec_cmd_retries_))
274  {
276  p_nh_->setParam(s_comm_exec_cmd_retries, param_comm_exec_cmd_retries_);
277  ROS_WARN_STREAM("[" << __func__ << "] Failed to get comm_exec_cmd_retries, setting to default value: "
279  }
280  else
281  {
282  if(param_comm_exec_cmd_retries_ < 0 || param_comm_exec_cmd_retries_ > EXEC_CMD_RETRIES_MAX)
283  {
285  p_nh_->setParam(s_comm_exec_cmd_retries, param_comm_exec_cmd_retries_);
286  ROS_WARN_STREAM("[" << __func__ << "] Set value to comm_exec_cmd_retries is out of range, "
287  "setting comm_timeout_retry value to default: " << param_comm_exec_cmd_retries_);
288  }
289  }
290  const std::string s_pub_rate_tmc_info = s_node_name_ + "/pub_rate_tmc_info";
291  if(!p_nh_->getParam(s_pub_rate_tmc_info, param_pub_rate_tmc_info_))
292  {
294  p_nh_->setParam(s_pub_rate_tmc_info, param_pub_rate_tmc_info_);
295  ROS_WARN_STREAM("[" << __func__ << "] Failed to get pub_rate_tmc_info, setting to default value: "
297  }
298  else
299  {
300  if(param_pub_rate_tmc_info_ < PUB_RATE_MIN || param_pub_rate_tmc_info_ > PUB_RATE_MAX)
301  {
303  p_nh_->setParam(s_pub_rate_tmc_info, param_pub_rate_tmc_info_);
304  ROS_WARN_STREAM("[" << __func__ << "] Set value to pub_rate_tmc_info is out of range, "
305  "setting pub_rate_tmc_info value to default: " << param_pub_rate_tmc_info_);
306  }
307  }
308  const std::string s_auto_start_additional_delay = s_node_name_ + "/auto_start_additional_delay";
309  if(!p_nh_->getParam(s_auto_start_additional_delay, param_auto_start_additional_delay_))
310  {
312  p_nh_->setParam(s_auto_start_additional_delay, param_auto_start_additional_delay_);
313  ROS_WARN_STREAM("[" << __func__ << "] Failed to get auto_start_additional_delay, setting to default value: "
315  }
316  else
317  {
320  {
322  p_nh_->setParam(s_auto_start_additional_delay, param_auto_start_additional_delay_);
323  ROS_WARN_STREAM("[" << __func__ << "] Set value to auto_start_additional_delay is out of range, "
324  "setting pub_rate_tmc_info value to default: " << param_auto_start_additional_delay_);
325  }
326  }
327  }
328 
329  return b_result;
330 }
331 
332 /* Creation of motor */
334 {
335  int32_t val = 0;
336  uint8_t index = 0;
337 
338  ROS_INFO_STREAM("[TmclROS::" << __func__ << "] called");
339 
340  /* Resize p_motor_ depending on total_motors_ value */
341  p_motor_.resize(total_motors_, nullptr);
342 
343  /* Special handling for en_motors*/
344  const std::string s_en_motors = s_node_name_ + "/en_motors";
345  if(!p_nh_->getParam(s_en_motors, param_en_motors_))
346  {
347  for(index = 0; index < total_motors_; index++)
348  {
349  param_en_motors_.push_back(0);
350  }
351  p_nh_->setParam(s_en_motors, param_en_motors_);
352  ROS_WARN("[%s] Failed to get en_motors, setting to default value: 0", __func__);
353  }
354  else
355  {
356  /* Check if en_motors size is equal to total_motors_ */
357  if((param_en_motors_.size()) < total_motors_)
358  {
359  for(index = param_en_motors_.size(); index < total_motors_; index++)
360  {
361  param_en_motors_.push_back(0);
362  }
363  ROS_WARN("[%s] Missing indeces for en_motors, setting missing en_motors value to default: 0", __func__);
364  }
365  else if((param_en_motors_.size()) > total_motors_)
366  {
367  for(index = total_motors_; index <= param_en_motors_.size(); index++)
368  {
370  }
371  ROS_WARN("[%s] Indeces exceeded total motors available, deleting unused indeces", __func__);
372  }
373  /* Check each indeces of en_motors if valid */
374  for(index = 0; index < param_en_motors_.size(); index++)
375  {
376  if(param_en_motors_[index] != 0 && param_en_motors_[index] != 1)
377  {
378  param_en_motors_[index] = 0;
379  ROS_WARN("[%s] Set value to en_motors for motor %d is out of range, setting en_motors value to default: %d "
380  , __func__, index, param_en_motors_[index]);
381  }
382  }
383  p_nh_->setParam(s_en_motors, param_en_motors_);
384  }
385 
386  /* Check for motor type */
388  {
389  ROS_INFO_STREAM("[" << __func__ << "] Adhoc Mode is enabled\n");
390 
391  //Generic
392  for(index = 0; index < total_motors_; index++)
393  {
394  if(param_en_motors_[index])
395  {
396  p_motor_[index] = new Motor(p_nh_, p_tmcl_interpreter_, module_number_, index);
397  p_motor_[index]->init();
398  }
399  else
400  {
401  p_motor_[index] = nullptr;
402  ROS_WARN("[%s] Motor %d is disabled\n", __func__, index);
403  }
404  }
405  }
406  else
407  {
408  //BLDC
410  {
411  ROS_INFO_STREAM("[" << __func__ << "] Detected module for BLDC Motors\n");
412 
413  for(index = 0; index < total_motors_; index++)
414  {
415  if(param_en_motors_[index])
416  {
418  p_motor_[index]->init();
419  }
420  else
421  {
422  p_motor_[index] = nullptr;
423  ROS_WARN("[%s] motor %d is disabled\n", __func__, index);
424  }
425  }
426  }
427 
428  //Stepper
429  else
430  {
431  ROS_INFO_STREAM("[" << __func__ << "] Detected module for Stepper Motors\n");
432  for(index = 0; index < total_motors_; index++)
433  {
434  if(param_en_motors_[index])
435  {
437  p_motor_[index]->init();
438  }
439  else
440  {
441  p_motor_[index] = nullptr;
442  ROS_WARN("[%s] motor %d is disabled\n", __func__, index);
443  }
444  }
445  }
446  }
447 }
448 
449 /* Initialize ROS Service */
451 {
452  ROS_INFO_STREAM("[TmclROS::" << __func__ << "] called");
453 
454  /* Make s_namespace_ empty if namespace is empty */
455  if(s_namespace_.compare("/") == 0)
456  {
457  s_namespace_ = "";
458  }
459 
460  std::string s_custom_cmd_srvname = s_namespace_ + "/tmcl_custom_cmd";
461  std::string s_gap_all_srvname = s_namespace_ + "/tmcl_gap_all";
462  std::string s_ggp_all_srvname = s_namespace_ + "/tmcl_ggp_all";
463 
465  if(ros::service::exists(s_custom_cmd_srvname, true))
466  {
467  ROS_INFO_STREAM("[" << __func__ << "] tmcl_custom_cmd server advertised. Service name: " << s_custom_cmd_srvname);
468  }
469  else
470  {
471  ROS_WARN_STREAM("[" << __func__ << "] tmcl_custom_cmd server failed to advertise.");
472  }
473 
475  if(ros::service::exists(s_gap_all_srvname, true))
476  {
477  ROS_INFO_STREAM("[" << __func__ << "] tmcl_gap_all server advertised. Service name: " << s_gap_all_srvname);
478  }
479  else
480  {
481  ROS_WARN_STREAM("[" << __func__ << "] tmcl_gap_all server failed to advertise.");
482  }
483 
485  if(ros::service::exists(s_ggp_all_srvname, true))
486  {
487  ROS_INFO_STREAM("[" << __func__ << "] tmcl_ggp_all server advertised. Service name: " << s_ggp_all_srvname);
488  }
489  else
490  {
491  ROS_WARN_STREAM("[" << __func__ << "] tmcl_ggp_all server failed to advertise.");
492  }
493 }
494 
495 /* ROS Service Callbacks */
496 bool TmclROS::tmclCustomCMDCallBack(adi_tmcl::TmcCustomCmd::Request& req, adi_tmcl::TmcCustomCmd::Response& res)
497 {
498  bool b_result = false;
499  int32_t val = 0;
500 
501  if(req.instruction == "SAP")
502  {
503  val = req.value;
504  if(req.motor_number < total_motors_ &&
505  p_tmcl_interpreter_->executeCmd(TMCL_CMD_SAP, req.instruction_type, req.motor_number, &val))
506  {
507  b_result = true;
508  ROS_DEBUG_STREAM("[" << __func__ << "] Service Done. Set value: " << res.output);
509  }
510  else
511  {
512  ROS_ERROR_STREAM("[" << __func__ << "] Service Failed!");
513  }
514  }
515  else if(req.instruction == "GAP")
516  {
517  if(req.motor_number < total_motors_ &&
518  p_tmcl_interpreter_->executeCmd(TMCL_CMD_GAP, req.instruction_type, req.motor_number, &val))
519  {
520  b_result = true;
521  ROS_DEBUG_STREAM("[" << __func__ << "] Service Done. Get value: " << res.output);
522  }
523  else
524  {
525  ROS_ERROR_STREAM("[" << __func__ << "] Service Failed!");
526  }
527  }
528  else if(req.instruction == "SGP")
529  {
530  val = req.value;
531  if(req.motor_number < total_motors_ &&
532  p_tmcl_interpreter_->executeCmd(TMCL_CMD_SGP, req.instruction_type, req.motor_number, &val))
533  {
534  b_result = true;
535  ROS_DEBUG_STREAM("[" << __func__ << "] Service Done. Set value: " << res.output);
536  }
537  else
538  {
539  ROS_ERROR_STREAM("[" << __func__ << "] Service Failed!");
540  }
541  }
542  else if(req.instruction == "GGP")
543  {
544  if(req.motor_number < total_motors_ &&
545  p_tmcl_interpreter_->executeCmd(TMCL_CMD_GGP, req.instruction_type, req.motor_number, &val))
546  {
547  b_result = true;
548  ROS_DEBUG_STREAM("[" << __func__ << "] Service Done. Get value: " << res.output);
549  }
550  else
551  {
552  ROS_ERROR_STREAM("[" << __func__ << "] Service Failed!");
553  }
554  }
555  else
556  {
557  ROS_ERROR_STREAM("[" << __func__ << "] Unkown instruction.");
558  }
559 
560  res.output = val;
561  res.result = b_result;
562 
563  return b_result;
564 }
565 bool TmclROS::tmclGAPAllCallBack(adi_tmcl::TmcGapGgpAll::Request& req, adi_tmcl::TmcGapGgpAll::Response& res)
566 {
567  bool b_result = true;
568  int32_t val = 0;
569  uint8_t index = 0;
570 
571  if(req.motor_number < total_motors_)
572  {
573  for(index = 0; index < param_ap_name_.size(); index++)
574  {
575  if(p_tmcl_interpreter_->executeCmd(TMCL_CMD_GAP, param_ap_type_[index], req.motor_number, &val))
576  {
577  tmc_param_msg_.name = param_ap_name_[index];
578  tmc_param_msg_.value = val;
579  res.output.push_back(tmc_param_msg_);
580  }
581  else
582  {
583  tmc_param_msg_.name = param_ap_name_[index] + ">>> ERROR";
584  tmc_param_msg_.value = 0;
585  res.output.push_back(tmc_param_msg_);
586  b_result = false;
587  }
588  }
589  }
590  else
591  {
592  b_result = false;
593  ROS_ERROR_STREAM("[" << __func__ << "] Required motor number exceeds to axis available");
594  }
595  res.result = b_result;
596 
597  return b_result;
598 }
599 bool TmclROS::tmclGGPAllCallBack(adi_tmcl::TmcGapGgpAll::Request& req, adi_tmcl::TmcGapGgpAll::Response& res)
600 {
601  bool b_result = true;
602  int32_t val = 0;
603  uint8_t index = 0;
604 
605  if(req.motor_number == 0)
606  {
607  for(index = 0; index < param_gp_name_.size(); index++)
608  {
609  if(p_tmcl_interpreter_->executeCmd(TMCL_CMD_GGP, param_gp_type_[index], req.motor_number, &val))
610  {
611  tmc_param_msg_.name = param_gp_name_[index];
612  tmc_param_msg_.value = val;
613  res.output.push_back(tmc_param_msg_);
614  }
615  else
616  {
617  tmc_param_msg_.name = param_gp_name_[index] + ">>> ERROR";
618  tmc_param_msg_.value = 0;
619  res.output.push_back(tmc_param_msg_);
620  b_result = false;
621  }
622  }
623  }
624  else
625  {
626  b_result = false;
627  ROS_ERROR_STREAM("[" << __func__ << "] GGP All Service only accepts value \"0\" as motor number");
628  }
629  res.result = b_result;
630 
631 
632  return b_result;
633 }
634 
635 /* Deinitialization */
637 {
638  bool b_result = false;
639  int32_t val = 0;
640 
641  ROS_INFO_STREAM("[TmclROS::" << __func__ << "] called");
642 
643  if(!this->getRetriesExceededStatus())
644  {
645  for(uint8_t index = 0; index < total_motors_; index++)
646  {
647  if(p_tmcl_interpreter_->executeCmd(TMCL_CMD_MST, 0, index , &val))
648  {
649  ROS_INFO("[%s] Stopped motor %d before shutting down...",__func__, index);
650  }
651  else
652  {
653  ROS_WARN("[%s] Timeout reached. Stopping of motor %d failed",__func__, index);
654  }
655  }
656  }
657  else
658  {
659  ROS_ERROR_STREAM("[" << __func__ << "] Timeout reached (board unresponsive), skipping motor stop commands");
660  }
661 
662  /* Shut down the interface */
664  {
665  b_result = true;
666  ROS_INFO_STREAM("[" << __func__ << "] shutdownInterface() success");
667  }
668  else
669  {
670  ROS_ERROR_STREAM("[" << __func__ << "] shutdownInterface() failed");
671  }
672 
673  return b_result;
674 }
675 
676 /* Getter b_retries_exceeded_ variable */
678 {
679  bool b_result = true;
680 
681  if(p_tmcl_interpreter_ != nullptr)
682  {
684  }
685 
686  return b_result;
687 }
TmclROS::gap_all_server_
ros::ServiceServer gap_all_server_
Definition: tmcl_ros.h:68
TmclInterpreter::tmcl_interface_
tmcl_interface_t tmcl_interface_
Definition: tmcl_interpreter.h:123
EXEC_CMD_RETRIES_DEFAULT
const uint8_t EXEC_CMD_RETRIES_DEFAULT
Definition: tmcl_ros.h:28
ros::NodeHandle::setParam
void setParam(const std::string &key, bool b) const
PUB_RATE_DEFAULT
const uint8_t PUB_RATE_DEFAULT
Definition: tmcl_ros.h:31
ros::this_node::getNamespace
const ROSCPP_DECL std::string & getNamespace()
TmclROS::tmclCustomCMDCallBack
bool tmclCustomCMDCallBack(adi_tmcl::TmcCustomCmd::Request &req, adi_tmcl::TmcCustomCmd::Response &res)
Definition: tmcl_ros.cpp:496
ros::service::exists
ROSCPP_DECL bool exists(const std::string &service_name, bool print_failure_reason)
TmclROS::p_tmcl_interpreter_
TmclInterpreter * p_tmcl_interpreter_
Definition: tmcl_ros.h:73
TmclInterpreter::tmcl_cfg_
tmcl_cfg_t tmcl_cfg_
Definition: tmcl_interpreter.h:124
ROS_ERROR_STREAM
#define ROS_ERROR_STREAM(args)
TmclROS::deInit
bool deInit()
Definition: tmcl_ros.cpp:636
TmclROS::tmclGAPAllCallBack
bool tmclGAPAllCallBack(adi_tmcl::TmcGapGgpAll::Request &req, adi_tmcl::TmcGapGgpAll::Response &res)
Definition: tmcl_ros.cpp:565
TMCL_CMD_GAP
@ TMCL_CMD_GAP
Definition: tmcl_interpreter.h:64
AUTO_START_ADDITIONAL_DELAY_DEFAULT
const uint8_t AUTO_START_ADDITIONAL_DELAY_DEFAULT
Definition: tmcl_ros.h:33
ros::NodeHandle::getParam
bool getParam(const std::string &key, bool &b) const
TmclROS::param_comm_interface_name_
std::string param_comm_interface_name_
Definition: tmcl_ros.h:92
tmcl_ros.h
TmclInterpreter::executeCmd
bool executeCmd(tmcl_cmd_t cmd, uint8_t type, uint8_t motor, int32_t *val)
Definition: tmcl_interpreter.cpp:75
TmclROS::s_namespace_
std::string s_namespace_
Definition: tmcl_ros.h:82
TmclROS::initService
void initService()
Definition: tmcl_ros.cpp:450
TMCL_MSG_VALUE_SZ
const uint8_t TMCL_MSG_VALUE_SZ
Definition: tmcl_interpreter.h:28
TIMEOUT_MS_DEFAULT
const uint8_t TIMEOUT_MS_DEFAULT
Definition: tmcl_ros.h:26
TmclROS::TmclROS
TmclROS(ros::NodeHandle *p_nh)
Definition: tmcl_ros.cpp:11
TmclROS::tmclGGPAllCallBack
bool tmclGGPAllCallBack(adi_tmcl::TmcGapGgpAll::Request &req, adi_tmcl::TmcGapGgpAll::Response &res)
Definition: tmcl_ros.cpp:599
TmclROS::param_comm_exec_cmd_retries_
int param_comm_exec_cmd_retries_
Definition: tmcl_ros.h:96
TX_ID_DEFAULT
const uint8_t TX_ID_DEFAULT
Definition: tmcl_ros.h:23
TmclROS::param_en_motors_
std::vector< int > param_en_motors_
Definition: tmcl_ros.h:100
ros::NodeHandle::advertiseService
ServiceServer advertiseService(AdvertiseServiceOptions &ops)
TmclInterpreter::getRetriesExceededStatus
bool getRetriesExceededStatus()
Definition: tmcl_interpreter.cpp:215
TmclROS::param_auto_start_additional_delay_
int param_auto_start_additional_delay_
Definition: tmcl_ros.h:97
TmclROS::ggp_all_server_
ros::ServiceServer ggp_all_server_
Definition: tmcl_ros.h:69
TmclROS::param_comm_interface_
int param_comm_interface_
Definition: tmcl_ros.h:91
TmclROS::param_gp_name_
std::vector< std::string > param_gp_name_
Definition: tmcl_ros.h:87
ROS_DEBUG_STREAM
#define ROS_DEBUG_STREAM(args)
TmclROS::param_comm_tx_id_
int param_comm_tx_id_
Definition: tmcl_ros.h:93
TmclROS::module_number_
uint16_t module_number_
Definition: tmcl_ros.h:76
TmclROS::param_gp_type_
std::vector< int > param_gp_type_
Definition: tmcl_ros.h:88
tmcl_cfg_t::interface_name
std::string interface_name
Definition: tmcl_interpreter.h:47
ROS_WARN_STREAM
#define ROS_WARN_STREAM(args)
MOTOR_TYPE_BLDC
const uint8_t MOTOR_TYPE_BLDC
Definition: tmcl_ros.h:19
TmclInterpreter::resetInterface
bool resetInterface()
Definition: tmcl_interpreter.cpp:49
TmclROS::p_motor_
std::vector< Motor * > p_motor_
Definition: tmcl_ros.h:74
TmclROS::getRetriesExceededStatus
bool getRetriesExceededStatus()
Definition: tmcl_ros.cpp:677
TmclROS::param_ap_name_
std::vector< std::string > param_ap_name_
Definition: tmcl_ros.h:85
tmcl_interface_t
tmcl_interface_t
Definition: tmcl_interpreter.h:35
TIMEOUT_MS_MAX
const uint16_t TIMEOUT_MS_MAX
Definition: tmcl_ros.h:25
EXEC_CMD_RETRIES_MAX
const uint8_t EXEC_CMD_RETRIES_MAX
Definition: tmcl_ros.h:27
TmclROS::param_ap_type_
std::vector< int > param_ap_type_
Definition: tmcl_ros.h:86
RX_ID_DEFAULT
const uint8_t RX_ID_DEFAULT
Definition: tmcl_ros.h:24
TXRX_ID_MAX
const uint8_t TXRX_ID_MAX
Definition: tmcl_ros.h:22
tmcl_cfg_t::tx_id
uint16_t tx_id
Definition: tmcl_interpreter.h:48
TmclROS::param_pub_rate_tmc_info_
float param_pub_rate_tmc_info_
Definition: tmcl_ros.h:98
AUTO_START_ADDITIONAL_DELAY_MAX
const uint8_t AUTO_START_ADDITIONAL_DELAY_MAX
Definition: tmcl_ros.h:32
TmclROS::createMotor
void createMotor()
Definition: tmcl_ros.cpp:333
TMCL_CMD_GGP
@ TMCL_CMD_GGP
Definition: tmcl_interpreter.h:66
ROS_WARN
#define ROS_WARN(...)
TmclInterpreter
Definition: tmcl_interpreter.h:98
TmclROS::~TmclROS
~TmclROS()
Definition: tmcl_ros.cpp:20
TmclROS::motor_type_
uint8_t motor_type_
Definition: tmcl_ros.h:78
TMCL_CMD_SGP
@ TMCL_CMD_SGP
Definition: tmcl_interpreter.h:65
ROS_INFO_STREAM
#define ROS_INFO_STREAM(args)
TmclROS::validateParams
bool validateParams()
Definition: tmcl_ros.cpp:128
ros::this_node::getName
const ROSCPP_DECL std::string & getName()
tmcl_cfg_t::rx_id
uint16_t rx_id
Definition: tmcl_interpreter.h:49
StepperMotor
Definition: tmcl_stepper_motor.h:19
TmclROS::total_motors_
uint8_t total_motors_
Definition: tmcl_ros.h:77
TmclROS::init
bool init()
Definition: tmcl_ros.cpp:39
PUB_RATE_MAX
const uint8_t PUB_RATE_MAX
Definition: tmcl_ros.h:29
TmclROS::tmc_param_msg_
adi_tmcl::TmcParam tmc_param_msg_
Definition: tmcl_ros.h:102
Motor
Definition: tmcl_motor.h:26
TmclROS::p_nh_
ros::NodeHandle * p_nh_
Definition: tmcl_ros.h:72
TmclROS::custom_cmd_server_
ros::ServiceServer custom_cmd_server_
Definition: tmcl_ros.h:67
TMCL_CMD_SAP
@ TMCL_CMD_SAP
Definition: tmcl_interpreter.h:63
TmclInterpreter::shutdownInterface
bool shutdownInterface()
Definition: tmcl_interpreter.cpp:196
ros::Duration::sleep
bool sleep() const
TmclROS::param_comm_rx_id_
int param_comm_rx_id_
Definition: tmcl_ros.h:94
TmclROS::s_node_name_
std::string s_node_name_
Definition: tmcl_ros.h:81
ROS_INFO
#define ROS_INFO(...)
ros::Duration
TmclROS::param_adhoc_mode_
bool param_adhoc_mode_
Definition: tmcl_ros.h:99
BLDCMotor
Definition: tmcl_bldc_motor.h:20
TmclROS::param_comm_timeout_ms_
int param_comm_timeout_ms_
Definition: tmcl_ros.h:95
ros::NodeHandle
TMCL_CMD_APPGFWV
@ TMCL_CMD_APPGFWV
Definition: tmcl_interpreter.h:67
TMCL_CMD_MST
@ TMCL_CMD_MST
Definition: tmcl_interpreter.h:61


adi_tmcl
Author(s):
autogenerated on Wed Apr 2 2025 02:43:01