tmc_coe_motor.cpp
Go to the documentation of this file.
1 
6 #include "tmc_coe_motor.h"
7 
9 
10 /* Constructor */
12  uint8_t slave_number, uint8_t motor_number) :
13 p_nh_ (p_nh),
14 p_tmc_coe_interpreter_ (p_tmc_coe_interpreter),
15 slave_number_ (slave_number),
16 motor_number_ (motor_number)
17 {
18  ROS_DEBUG_STREAM("[TmcCoeMotor::" << __func__ << "] called");
19 
20  this->initParams();
21 }
22 
23 /* Destructor */
25 {
26  ROS_DEBUG_STREAM("[TmcCoeMotor::" << __func__ << "] called");
27  p_tmc_coe_interpreter_ = nullptr;
28  p_nh_ = nullptr;
29 }
30 
32 
34 {
35  ROS_INFO_STREAM("[TmcCoeMotor::" << __func__ << "] called");
36 
37  this->initPublisher();
38  this->initSubscriber();
39  ROS_INFO_STREAM("[" << __func__ << "] Velocity unit: rpm");
40  ROS_INFO_STREAM("[" << __func__ << "] Position unit: pulses");
41  ROS_INFO_STREAM("[" << __func__ << "] Torque unit: mA");
42 
43  ROS_INFO_STREAM("[" << __func__ << "] Motor" << static_cast<int>(motor_number_) << " Initialized!\n");
44 }
45 
46 /* Initialize Parameters */
48 {
50 
51  ROS_INFO_STREAM("[TmcCoeMotor::" << __func__ << "] called");
52 
53  const std::string s_pub_rate_tmc_coe_info = s_node_name_ + "/slv" + std::to_string(slave_number_) + "/motor" +
54  std::to_string(motor_number_) + "/pub_rate_tmc_coe_info";
55  if(!p_nh_->getParam(s_pub_rate_tmc_coe_info, param_pub_rate_tmc_coe_info_))
56  {
58  ROS_WARN_STREAM("[" << __func__ << "] Failed to get pub_rate_tmc_coe_info_ for slave" <<
59  static_cast<int>(slave_number_) << " motor" << static_cast<int>(motor_number_) <<
60  ", setting to default value: " << param_pub_rate_tmc_coe_info_);
61  p_nh_->setParam(s_pub_rate_tmc_coe_info, param_pub_rate_tmc_coe_info_);
62  }
63  else
64  {
65  if(param_pub_rate_tmc_coe_info_ < DEFAULT_RATE || param_pub_rate_tmc_coe_info_ > MAX_RATE)
66  {
68  ROS_WARN_STREAM("[" << __func__ << "] Set value to pub_rate_tmc_coe_info_ for slave" <<
69  static_cast<int>(slave_number_) << " motor" << static_cast<int>(motor_number_) <<
70  " is out of range, setting to default value: " << param_pub_rate_tmc_coe_info_);
71  p_nh_->setParam(s_pub_rate_tmc_coe_info, param_pub_rate_tmc_coe_info_);
72  }
73  }
74 
75  const std::string s_en_pub_tmc_coe_info = s_node_name_ + "/slv" + std::to_string(slave_number_) + "/motor" +
76  std::to_string(motor_number_) + "/en_pub_tmc_coe_info";
77  if(!p_nh_->getParam(s_en_pub_tmc_coe_info, param_en_pub_tmc_coe_info_))
78  {
80  p_nh_->setParam(s_en_pub_tmc_coe_info, param_en_pub_tmc_coe_info_);
81  ROS_WARN_STREAM("[" << __func__ << "] Failed to get en_pub_tmc_coe_info for slave" <<
82  static_cast<int>(slave_number_) << " motor" << static_cast<int>(motor_number_) <<
83  ", setting to default value: " << std::boolalpha << param_en_pub_tmc_coe_info_);
84  }
85 
86  const std::string s_pub_actual_vel = s_node_name_ + "/slv" + std::to_string(slave_number_) + "/motor" +
87  std::to_string(motor_number_) + "/pub_actual_vel";
88  if(!p_nh_->getParam(s_pub_actual_vel, param_pub_actual_vel_))
89  {
90  param_pub_actual_vel_ = false;
91  p_nh_->setParam(s_pub_actual_vel, param_pub_actual_vel_);
92  ROS_WARN_STREAM("[" << __func__ << "] Failed to get pub_actual_vel for slave" << static_cast<int>(slave_number_) <<
93  " motor" << static_cast<int>(motor_number_) << ", setting to default value: " << std::boolalpha <<
95  }
96 
97  const std::string s_pub_actual_pos = s_node_name_ + "/slv" + std::to_string(slave_number_) + "/motor" +
98  std::to_string(motor_number_) + "/pub_actual_pos";
99  if(!p_nh_->getParam(s_pub_actual_pos, param_pub_actual_pos_))
100  {
101  param_pub_actual_pos_ = false;
102  p_nh_->setParam(s_pub_actual_pos, param_pub_actual_pos_);
103  ROS_WARN_STREAM("[" << __func__ << "] Failed to get pub_actual_pos for slave" << static_cast<int>(slave_number_) <<
104  " motor" << static_cast<int>(motor_number_) << ", setting to default value: " << std::boolalpha <<
106  }
107 
108  const std::string s_pub_actual_trq = s_node_name_ + "/slv" + std::to_string(slave_number_) + "/motor" +
109  std::to_string(motor_number_) + "/pub_actual_trq";
110  if(!p_nh_->getParam(s_pub_actual_trq, param_pub_actual_trq_))
111  {
112  param_pub_actual_trq_ = false;
113  p_nh_->setParam(s_pub_actual_trq, param_pub_actual_trq_);
114  ROS_WARN_STREAM("[" << __func__ << "] Failed to get pub_actual_trq for slave" << static_cast<int>(slave_number_) <<
115  " motor" << static_cast<int>(motor_number_) << ", setting to default value: " << std::boolalpha <<
117  }
118 
119  const std::string s_tmc_coe_info_topic = s_node_name_ + "/slv" + std::to_string(slave_number_) + "/motor" +
120  std::to_string(motor_number_) + "/tmc_coe_info_topic";
121  if(!p_nh_->getParam(s_tmc_coe_info_topic, param_tmc_coe_info_topic_))
122  {
123  param_tmc_coe_info_topic_ = "/tmc_coe_info_" + std::to_string(slave_number_) + "_" + std::to_string(motor_number_);
124  p_nh_->setParam(s_tmc_coe_info_topic, param_tmc_coe_info_topic_);
125  ROS_WARN_STREAM("[" << __func__ << "] Failed to get tmc_info_topic for slave" << static_cast<int>(slave_number_) <<
126  " motor" << static_cast<int>(motor_number_) << ", setting to default value: " <<
128  }
129 
130  const std::string s_tmc_cmd_vel_topic = s_node_name_ + "/slv" + std::to_string(slave_number_) + "/motor" +
131  std::to_string(motor_number_) + "/tmc_cmd_vel_topic";
132  if(!p_nh_->getParam(s_tmc_cmd_vel_topic, param_tmc_cmd_vel_topic_))
133  {
134  param_tmc_cmd_vel_topic_ = "/cmd_vel_" + std::to_string(slave_number_) + "_" + std::to_string(motor_number_);
135  p_nh_->setParam(s_tmc_cmd_vel_topic, param_tmc_cmd_vel_topic_);
136  ROS_WARN_STREAM("[" << __func__ << "] Failed to get tmc_cmd_vel_topic for slave" << static_cast<int>(slave_number_)
137  << " motor" << static_cast<int>(motor_number_) << ", setting to default value: " <<
139  }
140 
141  const std::string s_tmc_cmd_abspos_topic = s_node_name_ + "/slv" + std::to_string(slave_number_) + "/motor" +
142  std::to_string(motor_number_) + "/tmc_cmd_abspos_topic";
143  if(!p_nh_->getParam(s_tmc_cmd_abspos_topic, param_tmc_cmd_abspos_topic_))
144  {
145  param_tmc_cmd_abspos_topic_ = "/cmd_abspos_" + std::to_string(slave_number_) + "_" + std::to_string(motor_number_);
146  p_nh_->setParam(s_tmc_cmd_abspos_topic, param_tmc_cmd_abspos_topic_);
147  ROS_WARN_STREAM("[" << __func__ << "] Failed to get tmc_cmd_abspos_topic for slave" <<
148  static_cast<int>(slave_number_) << " motor" << static_cast<int>(motor_number_) <<
149  ", setting to default value: " << param_tmc_cmd_abspos_topic_);
150  }
151 
152  const std::string s_tmc_cmd_relpos_topic = s_node_name_ + "/slv" + std::to_string(slave_number_) + "/motor" +
153  std::to_string(motor_number_) + "/tmc_cmd_relpos_topic";
154  if(!p_nh_->getParam(s_tmc_cmd_relpos_topic, param_tmc_cmd_relpos_topic_))
155  {
156  param_tmc_cmd_relpos_topic_ = "/cmd_relpos_" + std::to_string(slave_number_) + "_" + std::to_string(motor_number_);
157  p_nh_->setParam(s_tmc_cmd_relpos_topic, param_tmc_cmd_relpos_topic_);
158  ROS_WARN_STREAM("[" << __func__ << "] Failed to get tmc_cmd_relpos_topic for slave" <<
159  static_cast<int>(slave_number_) << " motor"<< static_cast<int>(motor_number_) <<
160  ", setting to default value: " << param_tmc_cmd_relpos_topic_);
161  }
162 
163  const std::string s_tmc_cmd_trq_topic = s_node_name_ + "/slv" + std::to_string(slave_number_) + "/motor" +
164  std::to_string(motor_number_) + "/tmc_cmd_trq_topic";
165  if(!p_nh_->getParam(s_tmc_cmd_trq_topic, param_tmc_cmd_trq_topic_))
166  {
167  param_tmc_cmd_trq_topic_ = "/cmd_trq_" + std::to_string(slave_number_) + "_" + std::to_string(motor_number_);
168  p_nh_->setParam(s_tmc_cmd_trq_topic, param_tmc_cmd_trq_topic_);
169  ROS_WARN_STREAM("[" << __func__ << "] Failed to get tmc_cmd_trq_topic for slave" << static_cast<int>(slave_number_)
170  << " motor" << static_cast<int>(motor_number_) << ", setting to default value: " <<
172  }
173 
174  const std::string s_wheel_diameter = s_node_name_ + "/slv" + std::to_string(slave_number_) + "/motor" +
175  std::to_string(motor_number_) + "/wheel_diameter";
176  if(!p_nh_->getParam(s_wheel_diameter, param_wheel_diameter_))
177  {
179  p_nh_->setParam(s_wheel_diameter, param_wheel_diameter_);
180  ROS_WARN_STREAM("[" << __func__ << "] Failed to get wheel_diameter for slave" << static_cast<int>(slave_number_) <<
181  " motor" << static_cast<int>(motor_number_) << ", setting to default value: " <<
183  }
184  else
185  {
186  if(param_wheel_diameter_ < 0)
187  {
188 
190  p_nh_->setParam(s_wheel_diameter, param_wheel_diameter_);
191  ROS_WARN_STREAM("[" << __func__ << "] Set value to wheel_diameter for slave" << static_cast<int>(slave_number_)
192  << " motor" << static_cast<int>(motor_number_) << " is out of range, setting to default value: "
194  }
195  }
196 
197  const std::string s_additional_ratio_vel = s_node_name_ + "/slv" + std::to_string(slave_number_) + "/motor" +
198  std::to_string(motor_number_) + "/additional_ratio_vel";
199  if(!p_nh_->getParam(s_additional_ratio_vel, param_add_ratio_vel_))
200  {
202  p_nh_->setParam(s_additional_ratio_vel, param_add_ratio_vel_);
203  ROS_WARN_STREAM("[" << __func__ << "] Failed to get additional_ratio_vel for slave" <<
204  static_cast<int>(slave_number_) << " motor" << static_cast<int>(motor_number_) <<
205  ", setting to default value: " << param_add_ratio_vel_);
206  }
207  const std::string s_additional_ratio_pos = s_node_name_ + "/slv" + std::to_string(slave_number_) + "/motor" +
208  std::to_string(motor_number_) + "/additional_ratio_pos";
209  if(!p_nh_->getParam(s_additional_ratio_pos, param_add_ratio_pos_))
210  {
212  p_nh_->setParam(s_additional_ratio_pos, param_add_ratio_pos_);
213  ROS_WARN_STREAM("[" << __func__ << "] Failed to get additional_ratio_pos for slave" <<
214  static_cast<int>(slave_number_) << " motor" << static_cast<int>(motor_number_) <<
215  ", setting to default value: " << param_add_ratio_pos_);
216  }
217 
218  const std::string s_additional_ratio_trq = s_node_name_ + "/slv" + std::to_string(slave_number_) + "/motor" +
219  std::to_string(motor_number_) + "/additional_ratio_trq";
220  if(!p_nh_->getParam(s_additional_ratio_trq, param_add_ratio_trq_))
221  {
223  p_nh_->setParam(s_additional_ratio_trq, param_add_ratio_trq_);
224  ROS_WARN_STREAM("[" << __func__ << "] Failed to get additional_ratio_trq for slave" <<
225  static_cast<int>(slave_number_) << " motor" << static_cast<int>(motor_number_) <<
226  ", setting to default value: " << param_add_ratio_trq_);
227  }
228 
229  /* Parameters that are already validated in tmc_coe_ros.cpp. Only need to get the param value */
230  const std::string s_interface_name = s_node_name_ + "/interface_name";
231  (void)p_nh_->getParam(s_interface_name, param_interface_name_);
232  const std::string s_SDO_PDO_retries = s_node_name_ + "/SDO_PDO_retries";
233  (void)p_nh_->getParam(s_SDO_PDO_retries, param_SDO_PDO_retries_);
234 }
235 
236 /* Initialize Publisher */
238 {
239  ROS_INFO_STREAM("[TmcCoeMotor::" << __func__ << "] called");
240 
241  // Set frame IDs
243 
244  /* Checks if namespace is empty if not, remove "/" */
245  if(s_namespace_.compare("/") == 0)
246  {
247  frame_id_ = "tmcm" + p_tmc_coe_interpreter_->getSlaveName(slave_number_).substr(5) + "_mtr" +
248  std::to_string(motor_number_) + "_frame";
249  }
250  else
251  {
252  s_namespace_.erase(s_namespace_.begin());
253  frame_id_ = s_namespace_ + "/tmcm" + p_tmc_coe_interpreter_->getSlaveName(slave_number_).substr(5) + "_mtr" +
254  std::to_string(motor_number_) + "_frame";
255  }
256 
258  {
259  tmc_coe_info_pub_ = p_nh_->advertise<adi_tmc_coe::TmcCoeInfo>(param_tmc_coe_info_topic_, 100);
260  seq_ctr_ = 0;
263 
265  {
266  ROS_INFO_STREAM("[" << __func__ << "] Publisher TimerCallback is created successfully!");
267  }
268  else
269  {
270  ROS_ERROR_STREAM("[" << __func__ << "] Publisher TimerCallback not created!");
271  }
272  }
273 }
274 
275 /* Publisher Callback */
277 {
278  std::string mode_of_operation = "";
279 
280  tmc_coe_info_msg_.header.stamp = ros::Time::now();
281  tmc_coe_info_msg_.header.seq = seq_ctr_;
282  tmc_coe_info_msg_.header.frame_id = frame_id_;
283  tmc_coe_info_msg_.interface_name = param_interface_name_;
284  tmc_coe_info_msg_.slave_number = slave_number_;
285  tmc_coe_info_msg_.motor_number = motor_number_;
286 
287  /* Initialize messages to 0 first */
288  tmc_coe_info_msg_.velocity = 0;
289  tmc_coe_info_msg_.position = 0;
290  tmc_coe_info_msg_.torque = 0;
291 
292  switch (p_tmc_coe_interpreter_->input_pdo_[slave_number_]->modes_of_operation_display)
293  {
294  case NONE: mode_of_operation = "None"; break;
295  case PROFILE_POSITION: mode_of_operation = "Profile Position"; break;
296  case PROFILE_VELOCITY: mode_of_operation = "Profile Velocity"; break;
297  case HOMING_MODE: mode_of_operation = "Homing Mode"; break;
298  case CYCLIC_SYNC_POS: mode_of_operation = "Cyclic Synchronous Position Mode"; break;
299  case CYCLIC_SYNC_VEL: mode_of_operation = "Cyclic Synchronous Velocity Mode"; break;
300  case CYCLIC_SYNC_TRQ: mode_of_operation = "Cyclic Synchronous Torque Mode"; break;
301  default : mode_of_operation = "NONE"; break;
302  }
303  tmc_coe_info_msg_.mode_of_operation = mode_of_operation;
305 
307  {
308  tmc_coe_info_msg_.velocity = p_tmc_coe_interpreter_->input_pdo_[slave_number_]->velocity_actual_value *
310  }
311 
313  {
314  tmc_coe_info_msg_.position = p_tmc_coe_interpreter_->input_pdo_[slave_number_]->position_actual_value *
316  }
317 
319  {
320  tmc_coe_info_msg_.torque = p_tmc_coe_interpreter_->input_pdo_[slave_number_]->torque_actual_value *
322  }
323 
325  seq_ctr_++;
326 }
327 
328 /* Initialize Subscriber */
330 {
331  ROS_INFO_STREAM("[TmcCoeMotor::" << __func__ << "] called");
332 
336 }
337 
338 /* Subscriber Callback */
339 void TmcCoeMotor::cmdVelCallback(const geometry_msgs::Twist& msg)
340 {
341  float val = msg.linear.x;
342  uint8_t prev_cycle_count = 0;
343  uint8_t retries = 0;
344 
345  val = val / param_add_ratio_vel_;
346 
347  ROS_DEBUG_STREAM("[" << __func__ << "] Subscriber callback entered, received: " << msg.linear.x << " board value: "
348  << val);
350 
351  while(retries <= param_SDO_PDO_retries_)
352  {
354  {
355  if(p_tmc_coe_interpreter_->input_pdo_[slave_number_]->modes_of_operation_display != PROFILE_VELOCITY)
356  {
358  }
359  p_tmc_coe_interpreter_->output_pdo_[slave_number_]->target_velocity = val;
360 
361  while((p_tmc_coe_interpreter_->getCycleCounter() - prev_cycle_count) < 1)
362  {
363  // Wait until it reaches next cycle
364  }
365 
366  if(p_tmc_coe_interpreter_->output_pdo_[slave_number_]->target_velocity == val)
367  {
368  ROS_DEBUG_STREAM("["<< __func__ << "] Subscriber callback exited successfully");
369  break;
370  }
371  prev_cycle_count = p_tmc_coe_interpreter_->getCycleCounter();
372  retries++;
373  }
374  }
376 
377  if(p_tmc_coe_interpreter_->output_pdo_[slave_number_]->target_velocity != val)
378  {
379  ROS_ERROR_STREAM("["<< __func__ << "] Failed to set Velocity");
380  }
381 }
382 
383 void TmcCoeMotor::cmdAbsPosCallback(const std_msgs::Int32 msg)
384 {
385  int32_t val = msg.data;
386 
387  val /= param_add_ratio_pos_;
388 
389  ROS_DEBUG_STREAM("[" << __func__ << "] Subscriber callback entered, received: " << msg.data << " board value: "
390  << val);
392 
394  {
396  {
397  if(p_tmc_coe_interpreter_->input_pdo_[slave_number_]->modes_of_operation_display != PROFILE_POSITION)
398  {
400  }
401  p_tmc_coe_interpreter_->output_pdo_[slave_number_]->target_position = val;
403  }
404 
406  {
407  break;
408  }
409  }
412 
414  {
416  {
418  }
420  {
421  break;
422  }
423  }
425 
426  if(p_tmc_coe_interpreter_->output_pdo_[slave_number_]->target_position == val)
427  {
428  ROS_DEBUG_STREAM("["<< __func__ << "] Subscriber callback exited successfully");
429  }
430  else
431  {
432  ROS_ERROR_STREAM("["<< __func__ << "] Failed to set Absolute Position");
433  }
434 }
435 
436 void TmcCoeMotor::cmdRelPosCallback(const std_msgs::Int32 msg)
437 {
438  int32_t val = msg.data;
439 
440  val /= param_add_ratio_pos_;
441 
442  ROS_DEBUG_STREAM("[" << __func__ << "] Subscriber callback entered, received: " << msg.data << " board value: "
443  << val);
445 
447  {
449  {
450  if(p_tmc_coe_interpreter_->input_pdo_[slave_number_]->modes_of_operation_display != PROFILE_POSITION)
451  {
453  }
454  p_tmc_coe_interpreter_->output_pdo_[slave_number_]->target_position = val;
456  }
457 
459  {
460  break;
461  }
462  }
465 
467  {
469  {
471  }
473  {
474  break;
475  }
476  }
478 
479  if(p_tmc_coe_interpreter_->output_pdo_[slave_number_]->target_position == val)
480  {
481  ROS_DEBUG_STREAM("["<< __func__ << "] Subscriber callback exited successfully");
482  }
483  else
484  {
485  ROS_ERROR_STREAM("["<< __func__ << "] Failed to set Relative Position");
486  }
487 }
SET_POINT_ACK_IN_PROCESS
@ SET_POINT_ACK_IN_PROCESS
Definition: tmc_coe_interpreter.h:60
TmcCoeMotor::s_node_name_
std::string s_node_name_
Definition: tmc_coe_motor.h:71
uint8_t
unsigned char uint8_t
ros::NodeHandle::setParam
void setParam(const std::string &key, bool b) const
ros::this_node::getNamespace
const ROSCPP_DECL std::string & getNamespace()
TmcCoeMotor::slave_number_
uint8_t slave_number_
Definition: tmc_coe_motor.h:74
TmcCoeMotor::tmc_coe_info_msg_
adi_tmc_coe::TmcCoeInfo tmc_coe_info_msg_
Definition: tmc_coe_motor.h:58
TmcCoeInterpreter::input_pdo_
std::vector< input_pdo_t * > input_pdo_
Definition: tmc_coe_interpreter.h:200
ROS_ERROR_STREAM
#define ROS_ERROR_STREAM(args)
PROFILE_VELOCITY
@ PROFILE_VELOCITY
Definition: tmc_coe_motor.h:20
MAX_RATE
const uint8_t MAX_RATE
Definition: tmc_coe_motor.h:35
PROFILE_POSITION
@ PROFILE_POSITION
Definition: tmc_coe_motor.h:19
TmcCoeMotor::init
virtual void init()
Definition: tmc_coe_motor.cpp:33
TmcCoeMotor::param_interface_name_
std::string param_interface_name_
Definition: tmc_coe_motor.h:89
ros::NodeHandle::getParam
bool getParam(const std::string &key, bool &b) const
TmcCoeMotor::param_pub_rate_tmc_coe_info_
float param_pub_rate_tmc_coe_info_
Definition: tmc_coe_motor.h:90
TmcCoeMotor::param_wheel_diameter_
float param_wheel_diameter_
Definition: tmc_coe_motor.h:85
TmcCoeMotor::s_namespace_
std::string s_namespace_
Definition: tmc_coe_motor.h:72
TmcCoeMotor::param_add_ratio_pos_
float param_add_ratio_pos_
Definition: tmc_coe_motor.h:87
ros::Timer::isValid
bool isValid()
TmcCoeMotor::tmc_cmd_relpos_sub_
ros::Subscriber tmc_cmd_relpos_sub_
Definition: tmc_coe_motor.h:69
ENABLE_OPERATION
@ ENABLE_OPERATION
Definition: tmc_coe_interpreter.h:32
TmcCoeMotor::cmdAbsPosCallback
virtual void cmdAbsPosCallback(const std_msgs::Int32 msg)
Definition: tmc_coe_motor.cpp:383
TmcCoeMotor::TmcCoeMotor
TmcCoeMotor(ros::NodeHandle *p_nh, TmcCoeInterpreter *p_tmc_coe_interpreter, uint8_t slave_number, uint8_t motor_number)
Definition: tmc_coe_motor.cpp:11
TmcCoeMotor::param_SDO_PDO_retries_
int param_SDO_PDO_retries_
Definition: tmc_coe_motor.h:75
TmcCoeMotor::param_en_pub_tmc_coe_info_
bool param_en_pub_tmc_coe_info_
Definition: tmc_coe_motor.h:76
TmcCoeMotor::param_add_ratio_trq_
float param_add_ratio_trq_
Definition: tmc_coe_motor.h:88
TmcCoeMotor::rosPublishTmcCoeInfo
virtual void rosPublishTmcCoeInfo(const ros::TimerEvent &event)
Definition: tmc_coe_motor.cpp:276
TmcCoeMotor::param_tmc_coe_info_topic_
std::string param_tmc_coe_info_topic_
Definition: tmc_coe_motor.h:80
HOMING_MODE
@ HOMING_MODE
Definition: tmc_coe_motor.h:21
TmcCoeInterpreter::statusWordState
bool statusWordState(uint8_t slave_number, fsa_state_t state)
Definition: tmc_coe_interpreter.cpp:355
ROS_DEBUG_STREAM
#define ROS_DEBUG_STREAM(args)
TmcCoeMotor::param_pub_actual_trq_
bool param_pub_actual_trq_
Definition: tmc_coe_motor.h:79
tmc_coe_motor.h
ros::Publisher::publish
void publish(const boost::shared_ptr< M > &message) const
ros::NodeHandle::advertise
Publisher advertise(AdvertiseOptions &ops)
CYCLIC_SYNC_VEL
@ CYCLIC_SYNC_VEL
Definition: tmc_coe_motor.h:23
TmcCoeMotor::p_nh_
ros::NodeHandle * p_nh_
Definition: tmc_coe_motor.h:92
TmcCoeMotor::param_tmc_cmd_relpos_topic_
std::string param_tmc_cmd_relpos_topic_
Definition: tmc_coe_motor.h:83
TmcCoeMotor::param_tmc_cmd_abspos_topic_
std::string param_tmc_cmd_abspos_topic_
Definition: tmc_coe_motor.h:82
TmcCoeMotor::tmc_cmd_abspos_sub_
ros::Subscriber tmc_cmd_abspos_sub_
Definition: tmc_coe_motor.h:68
ROS_WARN_STREAM
#define ROS_WARN_STREAM(args)
TmcCoeMotor::initSubscriber
virtual void initSubscriber()
Definition: tmc_coe_motor.cpp:329
TmcCoeMotor::seq_ctr_
uint32_t seq_ctr_
Definition: tmc_coe_motor.h:60
TmcCoeMotor::initPublisher
void initPublisher()
Definition: tmc_coe_motor.cpp:237
TmcCoeInterpreter::getSlaveName
std::string getSlaveName(uint8_t slave_number)
Definition: tmc_coe_interpreter.cpp:658
TmcCoeInterpreter::isCycleFinished
bool isCycleFinished()
Definition: tmc_coe_interpreter.cpp:679
TmcCoeMotor::tmc_cmd_vel_sub_
ros::Subscriber tmc_cmd_vel_sub_
Definition: tmc_coe_motor.h:67
TmcCoeInterpreter::stopCycleCounter
void stopCycleCounter()
Definition: tmc_coe_interpreter.cpp:707
TmcCoeMotor::~TmcCoeMotor
virtual ~TmcCoeMotor()
Definition: tmc_coe_motor.cpp:24
TmcCoeMotor::initParams
void initParams()
Definition: tmc_coe_motor.cpp:47
TmcCoeMotor::param_tmc_cmd_vel_topic_
std::string param_tmc_cmd_vel_topic_
Definition: tmc_coe_motor.h:81
ros::NodeHandle::subscribe
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())
ros::TimerEvent
TmcCoeMotor::frame_id_
std::string frame_id_
Definition: tmc_coe_motor.h:59
ROS_INFO_STREAM
#define ROS_INFO_STREAM(args)
CYCLIC_SYNC_POS
@ CYCLIC_SYNC_POS
Definition: tmc_coe_motor.h:22
RELATIVE_POSITION
@ RELATIVE_POSITION
Definition: tmc_coe_motor.h:31
ros::this_node::getName
const ROSCPP_DECL std::string & getName()
TmcCoeInterpreter::getCycleCounter
uint8_t getCycleCounter()
Definition: tmc_coe_interpreter.cpp:689
TmcCoeMotor::tmc_coe_info_pub_
ros::Publisher tmc_coe_info_pub_
Definition: tmc_coe_motor.h:57
TmcCoeMotor::cmdVelCallback
virtual void cmdVelCallback(const geometry_msgs::Twist &msg)
Definition: tmc_coe_motor.cpp:339
int32_t
signed int int32_t
ABSOLUTE_POSITION
@ ABSOLUTE_POSITION
Definition: tmc_coe_motor.h:30
TmcCoeInterpreter
Definition: tmc_coe_interpreter.h:148
DEFAULT_RATE
const uint8_t DEFAULT_RATE
Definition: tmc_coe_motor.h:34
NONE
@ NONE
Definition: tmc_coe_motor.h:18
TmcCoeInterpreter::output_pdo_
std::vector< output_pdo_t * > output_pdo_
Definition: tmc_coe_interpreter.h:201
TmcCoeInterpreter::startCycleCounter
void startCycleCounter()
Definition: tmc_coe_interpreter.cpp:698
TmcCoeMotor::p_tmc_coe_interpreter_
TmcCoeInterpreter * p_tmc_coe_interpreter_
Definition: tmc_coe_motor.h:93
TmcCoeMotor::param_add_ratio_vel_
float param_add_ratio_vel_
Definition: tmc_coe_motor.h:86
TmcCoeMotor::cmdRelPosCallback
virtual void cmdRelPosCallback(const std_msgs::Int32 msg)
Definition: tmc_coe_motor.cpp:436
ros::Rate
TmcCoeMotor::param_pub_actual_pos_
bool param_pub_actual_pos_
Definition: tmc_coe_motor.h:78
CYCLIC_SYNC_TRQ
@ CYCLIC_SYNC_TRQ
Definition: tmc_coe_motor.h:24
TmcCoeMotor::motor_number_
uint8_t motor_number_
Definition: tmc_coe_motor.h:73
TmcCoeMotor::param_pub_actual_vel_
bool param_pub_actual_vel_
Definition: tmc_coe_motor.h:77
ros::NodeHandle::createTimer
Timer createTimer(Duration period, const TimerCallback &callback, bool oneshot=false, bool autostart=true) const
TmcCoeMotor::param_tmc_cmd_trq_topic_
std::string param_tmc_cmd_trq_topic_
Definition: tmc_coe_motor.h:84
ros::Duration
TmcCoeMotor::timer_callback_
ros::Timer timer_callback_
Definition: tmc_coe_motor.h:56
ros::NodeHandle
ros::Time::now
static Time now()


adi_tmc_coe
Author(s):
autogenerated on Sun Feb 2 2025 03:07:24