From 42aac934cf3cda321e2b971334675e37fde4210d Mon Sep 17 00:00:00 2001 From: mmaralit-adi Date: Mon, 18 Sep 2023 15:35:43 +0800 Subject: [PATCH] Adaptations on ROS coding standard and synchronization with upcoming ROS2 Driver version of this * Adaptations on ROS coding standards * Synchronization of handling between this ROS1 Driver and the up-for-release ROS2 Driver version * Added handling for SIGTERM and SIGKILL * Removed support for TMC variants that are either obsolete, no CAN support, or no Motor Drive Co-Authored-By: Christian Joseph Acar <124771470+CAcarADI@users.noreply.github.com> --- CMakeLists.txt | 4 +- README.md | 12 +- config/TMCM-1021_Ext.yaml | 89 ------ config/TMCM-1070_Ext.yaml | 89 ------ config/TMCM-1076_Ext.yaml | 89 ------ config/TMCM-1110_Ext.yaml | 89 ------ config/TMCM-1111_Ext.yaml | 89 ------ config/TMCM-1141_Ext.yaml | 89 ------ config/TMCM-1161_Ext.yaml | 89 ------ config/TMCM-1181_Ext.yaml | 89 ------ config/TMCM-1210_Ext.yaml | 89 ------ config/TMCM-1211_Ext.yaml | 89 ------ config/TMCM-1243_Ext.yaml | 89 ------ config/TMCM-1310_Ext.yaml | 89 ------ config/TMCM-1316_Ext.yaml | 89 ------ config/TMCM-1321_Ext.yaml | 89 ------ config/TMCM-1370_Ext.yaml | 89 ------ config/TMCM-1640_Ext.yaml | 89 ------ config/TMCM-2300_Ext.yaml | 105 ------- config/TMCM-3213_Ext.yaml | 121 -------- config/TMCM-3215_Ext.yaml | 121 -------- config/TMCM-3313_Ext.yaml | 121 -------- config/TMCM-3315_Ext.yaml | 121 -------- config/TMCM-6211_Ext.yaml | 169 ----------- config/TMCM-6213_Ext.yaml | 169 ----------- config/autogenerated/TMCM-0010.yaml | 30 -- config/autogenerated/TMCM-0960.yaml | 54 ---- config/autogenerated/TMCM-1021.yaml | 176 ----------- config/autogenerated/TMCM-1070.yaml | 60 ---- config/autogenerated/TMCM-1076.yaml | 58 ---- config/autogenerated/TMCM-1110.yaml | 182 ----------- config/autogenerated/TMCM-1111.yaml | 268 ----------------- config/autogenerated/TMCM-1141.yaml | 170 ----------- config/autogenerated/TMCM-1161.yaml | 180 ----------- config/autogenerated/TMCM-1181.yaml | 176 ----------- config/autogenerated/TMCM-1210.yaml | 186 ------------ config/autogenerated/TMCM-1211.yaml | 212 ------------- config/autogenerated/TMCM-1243.yaml | 188 ------------ config/autogenerated/TMCM-1310.yaml | 280 ----------------- config/autogenerated/TMCM-1316.yaml | 274 ----------------- config/autogenerated/TMCM-1321.yaml | 262 ---------------- config/autogenerated/TMCM-1370.yaml | 268 ----------------- config/autogenerated/TMCM-1640.yaml | 207 ------------- config/autogenerated/TMCM-2300.yaml | 80 ----- config/autogenerated/TMCM-3213.yaml | 206 ------------- config/autogenerated/TMCM-3215.yaml | 206 ------------- config/autogenerated/TMCM-3313.yaml | 276 ----------------- config/autogenerated/TMCM-3315.yaml | 274 ----------------- config/autogenerated/TMCM-6211.yaml | 198 ------------ config/autogenerated/TMCM-6213.yaml | 206 ------------- include/tmcl_ros/socket_can_wrapper.h | 38 ++- include/tmcl_ros/tmcl_bldc_motor.h | 54 ++-- include/tmcl_ros/tmcl_interpreter.h | 55 ++-- include/tmcl_ros/tmcl_motor.h | 114 +++---- include/tmcl_ros/tmcl_ros.h | 158 +++++----- include/tmcl_ros/tmcl_stepper_motor.h | 38 +-- launch/tmcm_1021.launch | 64 ---- launch/tmcm_1070.launch | 64 ---- launch/tmcm_1076.launch | 64 ---- launch/tmcm_1110.launch | 64 ---- launch/tmcm_1111.launch | 64 ---- launch/tmcm_1141.launch | 64 ---- launch/tmcm_1161.launch | 64 ---- launch/tmcm_1181.launch | 64 ---- launch/tmcm_1210.launch | 64 ---- launch/tmcm_1211.launch | 64 ---- launch/tmcm_1243.launch | 64 ---- launch/tmcm_1310.launch | 64 ---- launch/tmcm_1316.launch | 64 ---- launch/tmcm_1321.launch | 64 ---- launch/tmcm_1370.launch | 64 ---- launch/tmcm_1640.launch | 64 ---- launch/tmcm_2300.launch | 79 ----- launch/tmcm_3213.launch | 95 ------ launch/tmcm_3215.launch | 95 ------ launch/tmcm_3313.launch | 95 ------ launch/tmcm_3315.launch | 95 ------ launch/tmcm_6211.launch | 143 --------- launch/tmcm_6213.launch | 143 --------- msg/TmcInfo.msg | 2 +- src/socket_can_wrapper.cpp | 52 ++-- src/tmcl_bldc_motor.cpp | 180 +++++------ src/tmcl_interpreter.cpp | 106 ++++--- src/tmcl_motor.cpp | 285 ++++++++++-------- src/tmcl_ros.cpp | 416 ++++++++++++++------------ src/tmcl_ros_node.cpp | 7 +- src/tmcl_stepper_motor.cpp | 197 ++++++------ srv/TmcCustomCmd.srv | 2 +- srv/TmcGapGgpAll.srv | 2 +- 89 files changed, 918 insertions(+), 9601 deletions(-) delete mode 100644 config/TMCM-1021_Ext.yaml delete mode 100644 config/TMCM-1070_Ext.yaml delete mode 100644 config/TMCM-1076_Ext.yaml delete mode 100644 config/TMCM-1110_Ext.yaml delete mode 100644 config/TMCM-1111_Ext.yaml delete mode 100644 config/TMCM-1141_Ext.yaml delete mode 100644 config/TMCM-1161_Ext.yaml delete mode 100644 config/TMCM-1181_Ext.yaml delete mode 100644 config/TMCM-1210_Ext.yaml delete mode 100644 config/TMCM-1211_Ext.yaml delete mode 100644 config/TMCM-1243_Ext.yaml delete mode 100644 config/TMCM-1310_Ext.yaml delete mode 100644 config/TMCM-1316_Ext.yaml delete mode 100644 config/TMCM-1321_Ext.yaml delete mode 100644 config/TMCM-1370_Ext.yaml delete mode 100644 config/TMCM-1640_Ext.yaml delete mode 100644 config/TMCM-2300_Ext.yaml delete mode 100644 config/TMCM-3213_Ext.yaml delete mode 100644 config/TMCM-3215_Ext.yaml delete mode 100644 config/TMCM-3313_Ext.yaml delete mode 100644 config/TMCM-3315_Ext.yaml delete mode 100644 config/TMCM-6211_Ext.yaml delete mode 100644 config/TMCM-6213_Ext.yaml delete mode 100644 config/autogenerated/TMCM-0010.yaml delete mode 100644 config/autogenerated/TMCM-0960.yaml delete mode 100644 config/autogenerated/TMCM-1021.yaml delete mode 100644 config/autogenerated/TMCM-1070.yaml delete mode 100644 config/autogenerated/TMCM-1076.yaml delete mode 100644 config/autogenerated/TMCM-1110.yaml delete mode 100644 config/autogenerated/TMCM-1111.yaml delete mode 100644 config/autogenerated/TMCM-1141.yaml delete mode 100644 config/autogenerated/TMCM-1161.yaml delete mode 100644 config/autogenerated/TMCM-1181.yaml delete mode 100644 config/autogenerated/TMCM-1210.yaml delete mode 100644 config/autogenerated/TMCM-1211.yaml delete mode 100644 config/autogenerated/TMCM-1243.yaml delete mode 100644 config/autogenerated/TMCM-1310.yaml delete mode 100644 config/autogenerated/TMCM-1316.yaml delete mode 100644 config/autogenerated/TMCM-1321.yaml delete mode 100644 config/autogenerated/TMCM-1370.yaml delete mode 100644 config/autogenerated/TMCM-1640.yaml delete mode 100644 config/autogenerated/TMCM-2300.yaml delete mode 100644 config/autogenerated/TMCM-3213.yaml delete mode 100644 config/autogenerated/TMCM-3215.yaml delete mode 100644 config/autogenerated/TMCM-3313.yaml delete mode 100644 config/autogenerated/TMCM-3315.yaml delete mode 100644 config/autogenerated/TMCM-6211.yaml delete mode 100644 config/autogenerated/TMCM-6213.yaml delete mode 100644 launch/tmcm_1021.launch delete mode 100644 launch/tmcm_1070.launch delete mode 100644 launch/tmcm_1076.launch delete mode 100644 launch/tmcm_1110.launch delete mode 100644 launch/tmcm_1111.launch delete mode 100644 launch/tmcm_1141.launch delete mode 100644 launch/tmcm_1161.launch delete mode 100644 launch/tmcm_1181.launch delete mode 100644 launch/tmcm_1210.launch delete mode 100644 launch/tmcm_1211.launch delete mode 100644 launch/tmcm_1243.launch delete mode 100644 launch/tmcm_1310.launch delete mode 100644 launch/tmcm_1316.launch delete mode 100644 launch/tmcm_1321.launch delete mode 100644 launch/tmcm_1370.launch delete mode 100644 launch/tmcm_1640.launch delete mode 100644 launch/tmcm_2300.launch delete mode 100644 launch/tmcm_3213.launch delete mode 100644 launch/tmcm_3215.launch delete mode 100644 launch/tmcm_3313.launch delete mode 100644 launch/tmcm_3315.launch delete mode 100644 launch/tmcm_6211.launch delete mode 100644 launch/tmcm_6213.launch diff --git a/CMakeLists.txt b/CMakeLists.txt index 7544ba6..f47ee9e 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -125,7 +125,7 @@ include_directories( #add_definitions(-DDEBUG) ## Declare a C++ library -add_library(socket_can_wrapper src/socket_can_wrapper.cpp) +add_library(${PROJECT_NAME}_socket_can_wrapper src/socket_can_wrapper.cpp) add_library(tmcl_interpreter src/tmcl_interpreter.cpp) add_library(tmcl_ros src/tmcl_ros.cpp) add_library(tmcl_motor src/tmcl_motor.cpp) @@ -158,7 +158,7 @@ add_executable(${PROJECT_NAME}_node src/tmcl_ros_node.cpp) # add_dependencies(${PROJECT_NAME}_node ${${PROJECT_NAME}_EXPORTED_TARGETS} ${catkin_EXPORTED_TARGETS}) ## Specify libraries to link a library or executable target against -target_link_libraries(tmcl_interpreter socket_can_wrapper) +target_link_libraries(tmcl_interpreter ${PROJECT_NAME}_socket_can_wrapper) target_link_libraries(tmcl_ros tmcl_interpreter) target_link_libraries(tmcl_ros tmcl_motor) target_link_libraries(tmcl_interpreter tmcl_motor) diff --git a/README.md b/README.md index 4918175..182e255 100644 --- a/README.md +++ b/README.md @@ -164,13 +164,13 @@ $ roslaunch tmcl_ros tmcm_1636.launch ## tmcl_ros_node -> :memo: _Note: For those with in the topic names, these are ideally the motor number. For example, if there are 2 motors used, there should be two published topics for tmc_info, specifically /tmc_info_0 for motor 0 and then /tmc_info_1 for motor 1._ +> :memo: _Note: For those with in the topic names, these are ideally the motor number. For example, if there are 2 motors used, there should be two published topics for tmc_info, specifically /tmc_info_0 for motor 0 and then /tmc_info_1 for motor 1._ ### Published topics These are the default topic names, topic names can be modified as a ROS parameter. -+ **/tmc_info_** ++ **/tmc_info_** - Data containing: + (1) board voltage (V) + (2) statusflag value (only for boards with StatusFlags AP, else, value is set to 0) @@ -182,13 +182,13 @@ These are the default topic names, topic names can be modified as a ROS paramete ### Subscriber topics -+ **/cmd_vel_** ++ **/cmd_vel_** - Velocity command (rpm or m/s) -+ **/cmd_abspos_** ++ **/cmd_abspos_** - Absolute position command (degree angle) -+ **/cmd_relpos_** ++ **/cmd_relpos_** - Relative position command (degree angle) -+ **/cmd_trq_** ++ **/cmd_trq_** - Torque command (mA) ### Advertised services diff --git a/config/TMCM-1021_Ext.yaml b/config/TMCM-1021_Ext.yaml deleted file mode 100644 index c064d5f..0000000 --- a/config/TMCM-1021_Ext.yaml +++ /dev/null @@ -1,89 +0,0 @@ -########################################################## -# Parameter Configurations for TMCM-1021 -########################################################## - -########## Interface Settings - -# Communication interface -# Description: Interface used between the PC and the TMC -# Possible values: -# - 0: CAN -comm_interface: 0 - -# Communication interface name -# Description: Name of the interface or device as detected by the PC -# Possible values: -# - can0, can1, can2, ..., etc -comm_interface_name: can0 - -# Communication interface Tx ID -# Description: Currently applicable only for CAN interface (Tx ID) -# Possible values: -# - 0 to 255 -# Note: The ID that would work will be the one set at the TMC's GP: 71 -comm_tx_id: 1 - -# Communication interface Rx ID -# Description: Currently applicable only for CAN interface (Rx ID) -# Possible values: -# - 0 to 255 -# Note: The ID that would work will be the one set at the TMC's GP: 70 -comm_rx_id: 2 - -# Communication timeout rate in seconds -# Description: Indicates how long should the node will wait for the rx data -# Possible values: -# - value in millisecs 0 - 5000 -comm_timeout_ms: 100 - -# Communication timeout tries -# Description: Indicates how many the node will retry sending data before shutting down if no data received -# Possible values: -# - 1 - 3 -comm_exec_cmd_retries: 1 - -########## Additional Settings - -# Adhoc Mode -# Description: This mode expects that the used module is not known. The velocity, position and torque relies on the additional ratios -adhoc_mode: false - -# Active motors or axes -# Description: Enables/disables active motors or axes. If disabled, settings for those motors will be ignored or not set. -# Possible values: -# - 0: Not used -# - 1: Active -en_motors: [1] - -# Publish rate of TMC information -# Decription: Publish rate (hertz) of TMC information -# Possible values: 10 - 100 -pub_rate_tmc_info: 10 - -# Auto start mode additional delay -# Decription: Added delay if auto start mode is enabled. You can add delay if your TMCL program needs to run over 2 seconds. -# Possible values: 0 - 10 (secs) -auto_start_additional_delay: 0 - -########################################################## -########################################################## -# Configurations below are divided on each motor/axis. If the module used have more motors than listed below, -# copy and paste all the configuration per motor, configure the needed topic names, wheel diameter values and -# generic ratios, and rename the motor name (should follow motor naming below - motor0, motor1, ..., motorn) -# otherwise, the node will fail. - -motor0: - en_pub_tmc_info: true - pub_actual_vel: true - pub_actual_pos: true - pub_actual_trq: true - tmc_info_topic: "/tmc_info_0" - tmc_cmd_vel_topic: "/cmd_vel_0" - tmc_cmd_abspos_topic: "/cmd_abspos_0" - tmc_cmd_relpos_topic: "/cmd_relpos_0" - tmc_cmd_trq_topic: "/cmd_trq_0" - - wheel_diameter: 0.25 - additional_ratio_vel: 1 - additional_ratio_pos: 1 - additional_ratio_trq: 1 diff --git a/config/TMCM-1070_Ext.yaml b/config/TMCM-1070_Ext.yaml deleted file mode 100644 index b37149e..0000000 --- a/config/TMCM-1070_Ext.yaml +++ /dev/null @@ -1,89 +0,0 @@ -########################################################## -# Parameter Configurations for TMCM-1070 -########################################################## - -########## Interface Settings - -# Communication interface -# Description: Interface used between the PC and the TMC -# Possible values: -# - 0: CAN -comm_interface: 0 - -# Communication interface name -# Description: Name of the interface or device as detected by the PC -# Possible values: -# - can0, can1, can2, ..., etc -comm_interface_name: can0 - -# Communication interface Tx ID -# Description: Currently applicable only for CAN interface (Tx ID) -# Possible values: -# - 0 to 255 -# Note: The ID that would work will be the one set at the TMC's GP: 71 -comm_tx_id: 1 - -# Communication interface Rx ID -# Description: Currently applicable only for CAN interface (Rx ID) -# Possible values: -# - 0 to 255 -# Note: The ID that would work will be the one set at the TMC's GP: 70 -comm_rx_id: 2 - -# Communication timeout rate in seconds -# Description: Indicates how long should the node will wait for the rx data -# Possible values: -# - value in millisecs 0 - 5000 -comm_timeout_ms: 100 - -# Communication timeout tries -# Description: Indicates how many the node will retry sending data before shutting down if no data received -# Possible values: -# - 1 - 3 -comm_exec_cmd_retries: 1 - -########## Additional Settings - -# Adhoc Mode -# Description: This mode expects that the used module is not known. The velocity, position and torque relies on the additional ratios -adhoc_mode: false - -# Active motors or axes -# Description: Enables/disables active motors or axes. If disabled, settings for those motors will be ignored or not set. -# Possible values: -# - 0: Not used -# - 1: Active -en_motors: [1] - -# Publish rate of TMC information -# Decription: Publish rate (hertz) of TMC information -# Possible values: 10 - 100 -pub_rate_tmc_info: 10 - -# Auto start mode additional delay -# Decription: Added delay if auto start mode is enabled. You can add delay if your TMCL program needs to run over 2 seconds. -# Possible values: 0 - 10 (secs) -auto_start_additional_delay: 0 - -########################################################## -########################################################## -# Configurations below are divided on each motor/axis. If the module used have more motors than listed below, -# copy and paste all the configuration per motor, configure the needed topic names, wheel diameter values and -# generic ratios, and rename the motor name (should follow motor naming below - motor0, motor1, ..., motorn) -# otherwise, the node will fail. - -motor0: - en_pub_tmc_info: true - pub_actual_vel: true - pub_actual_pos: true - pub_actual_trq: true - tmc_info_topic: "/tmc_info_0" - tmc_cmd_vel_topic: "/cmd_vel_0" - tmc_cmd_abspos_topic: "/cmd_abspos_0" - tmc_cmd_relpos_topic: "/cmd_relpos_0" - tmc_cmd_trq_topic: "/cmd_trq_0" - - wheel_diameter: 0.25 - additional_ratio_vel: 1 - additional_ratio_pos: 1 - additional_ratio_trq: 1 diff --git a/config/TMCM-1076_Ext.yaml b/config/TMCM-1076_Ext.yaml deleted file mode 100644 index c44181e..0000000 --- a/config/TMCM-1076_Ext.yaml +++ /dev/null @@ -1,89 +0,0 @@ -########################################################## -# Parameter Configurations for TMCM-1076 -########################################################## - -########## Interface Settings - -# Communication interface -# Description: Interface used between the PC and the TMC -# Possible values: -# - 0: CAN -comm_interface: 0 - -# Communication interface name -# Description: Name of the interface or device as detected by the PC -# Possible values: -# - can0, can1, can2, ..., etc -comm_interface_name: can0 - -# Communication interface Tx ID -# Description: Currently applicable only for CAN interface (Tx ID) -# Possible values: -# - 0 to 255 -# Note: The ID that would work will be the one set at the TMC's GP: 71 -comm_tx_id: 1 - -# Communication interface Rx ID -# Description: Currently applicable only for CAN interface (Rx ID) -# Possible values: -# - 0 to 255 -# Note: The ID that would work will be the one set at the TMC's GP: 70 -comm_rx_id: 2 - -# Communication timeout rate in seconds -# Description: Indicates how long should the node will wait for the rx data -# Possible values: -# - value in millisecs 0 - 5000 -comm_timeout_ms: 100 - -# Communication timeout tries -# Description: Indicates how many the node will retry sending data before shutting down if no data received -# Possible values: -# - 1 - 3 -comm_exec_cmd_retries: 1 - -########## Additional Settings - -# Adhoc Mode -# Description: This mode expects that the used module is not known. The velocity, position and torque relies on the additional ratios -adhoc_mode: false - -# Active motors or axes -# Description: Enables/disables active motors or axes. If disabled, settings for those motors will be ignored or not set. -# Possible values: -# - 0: Not used -# - 1: Active -en_motors: [1] - -# Publish rate of TMC information -# Decription: Publish rate (hertz) of TMC information -# Possible values: 10 - 100 -pub_rate_tmc_info: 10 - -# Auto start mode additional delay -# Decription: Added delay if auto start mode is enabled. You can add delay if your TMCL program needs to run over 2 seconds. -# Possible values: 0 - 10 (secs) -auto_start_additional_delay: 0 - -########################################################## -########################################################## -# Configurations below are divided on each motor/axis. If the module used have more motors than listed below, -# copy and paste all the configuration per motor, configure the needed topic names, wheel diameter values and -# generic ratios, and rename the motor name (should follow motor naming below - motor0, motor1, ..., motorn) -# otherwise, the node will fail. - -motor0: - en_pub_tmc_info: true - pub_actual_vel: true - pub_actual_pos: true - pub_actual_trq: true - tmc_info_topic: "/tmc_info_0" - tmc_cmd_vel_topic: "/cmd_vel_0" - tmc_cmd_abspos_topic: "/cmd_abspos_0" - tmc_cmd_relpos_topic: "/cmd_relpos_0" - tmc_cmd_trq_topic: "/cmd_trq_0" - - wheel_diameter: 0.25 - additional_ratio_vel: 1 - additional_ratio_pos: 1 - additional_ratio_trq: 1 diff --git a/config/TMCM-1110_Ext.yaml b/config/TMCM-1110_Ext.yaml deleted file mode 100644 index 6ccce2a..0000000 --- a/config/TMCM-1110_Ext.yaml +++ /dev/null @@ -1,89 +0,0 @@ -########################################################## -# Parameter Configurations for TMCM-1110 -########################################################## - -########## Interface Settings - -# Communication interface -# Description: Interface used between the PC and the TMC -# Possible values: -# - 0: CAN -comm_interface: 0 - -# Communication interface name -# Description: Name of the interface or device as detected by the PC -# Possible values: -# - can0, can1, can2, ..., etc -comm_interface_name: can0 - -# Communication interface Tx ID -# Description: Currently applicable only for CAN interface (Tx ID) -# Possible values: -# - 0 to 255 -# Note: The ID that would work will be the one set at the TMC's GP: 71 -comm_tx_id: 1 - -# Communication interface Rx ID -# Description: Currently applicable only for CAN interface (Rx ID) -# Possible values: -# - 0 to 255 -# Note: The ID that would work will be the one set at the TMC's GP: 70 -comm_rx_id: 2 - -# Communication timeout rate in seconds -# Description: Indicates how long should the node will wait for the rx data -# Possible values: -# - value in millisecs 0 - 5000 -comm_timeout_ms: 100 - -# Communication timeout tries -# Description: Indicates how many the node will retry sending data before shutting down if no data received -# Possible values: -# - 1 - 3 -comm_exec_cmd_retries: 1 - -########## Additional Settings - -# Adhoc Mode -# Description: This mode expects that the used module is not known. The velocity, position and torque relies on the additional ratios -adhoc_mode: false - -# Active motors or axes -# Description: Enables/disables active motors or axes. If disabled, settings for those motors will be ignored or not set. -# Possible values: -# - 0: Not used -# - 1: Active -en_motors: [1] - -# Publish rate of TMC information -# Decription: Publish rate (hertz) of TMC information -# Possible values: 10 - 100 -pub_rate_tmc_info: 10 - -# Auto start mode additional delay -# Decription: Added delay if auto start mode is enabled. You can add delay if your TMCL program needs to run over 2 seconds. -# Possible values: 0 - 10 (secs) -auto_start_additional_delay: 0 - -########################################################## -########################################################## -# Configurations below are divided on each motor/axis. If the module used have more motors than listed below, -# copy and paste all the configuration per motor, configure the needed topic names, wheel diameter values and -# generic ratios, and rename the motor name (should follow motor naming below - motor0, motor1, ..., motorn) -# otherwise, the node will fail. - -motor0: - en_pub_tmc_info: true - pub_actual_vel: true - pub_actual_pos: true - pub_actual_trq: true - tmc_info_topic: "/tmc_info_0" - tmc_cmd_vel_topic: "/cmd_vel_0" - tmc_cmd_abspos_topic: "/cmd_abspos_0" - tmc_cmd_relpos_topic: "/cmd_relpos_0" - tmc_cmd_trq_topic: "/cmd_trq_0" - - wheel_diameter: 0.25 - additional_ratio_vel: 1 - additional_ratio_pos: 1 - additional_ratio_trq: 1 diff --git a/config/TMCM-1111_Ext.yaml b/config/TMCM-1111_Ext.yaml deleted file mode 100644 index e7cc902..0000000 --- a/config/TMCM-1111_Ext.yaml +++ /dev/null @@ -1,89 +0,0 @@ -########################################################## -# Parameter Configurations for TMCM-1111 -########################################################## - -########## Interface Settings - -# Communication interface -# Description: Interface used between the PC and the TMC -# Possible values: -# - 0: CAN -comm_interface: 0 - -# Communication interface name -# Description: Name of the interface or device as detected by the PC -# Possible values: -# - can0, can1, can2, ..., etc -comm_interface_name: can0 - -# Communication interface Tx ID -# Description: Currently applicable only for CAN interface (Tx ID) -# Possible values: -# - 0 to 255 -# Note: The ID that would work will be the one set at the TMC's GP: 71 -comm_tx_id: 1 - -# Communication interface Rx ID -# Description: Currently applicable only for CAN interface (Rx ID) -# Possible values: -# - 0 to 255 -# Note: The ID that would work will be the one set at the TMC's GP: 70 -comm_rx_id: 2 - -# Communication timeout rate in seconds -# Description: Indicates how long should the node will wait for the rx data -# Possible values: -# - value in millisecs 0 - 5000 -comm_timeout_ms: 100 - -# Communication timeout tries -# Description: Indicates how many the node will retry sending data before shutting down if no data received -# Possible values: -# - 1 - 3 -comm_exec_cmd_retries: 1 - -########## Additional Settings - -# Adhoc Mode -# Description: This mode expects that the used module is not known. The velocity, position and torque relies on the additional ratios -adhoc_mode: false - -# Active motors or axes -# Description: Enables/disables active motors or axes. If disabled, settings for those motors will be ignored or not set. -# Possible values: -# - 0: Not used -# - 1: Active -en_motors: [1] - -# Publish rate of TMC information -# Decription: Publish rate (hertz) of TMC information -# Possible values: 10 - 100 -pub_rate_tmc_info: 10 - -# Auto start mode additional delay -# Decription: Added delay if auto start mode is enabled. You can add delay if your TMCL program needs to run over 2 seconds. -# Possible values: 0 - 10 (secs) -auto_start_additional_delay: 0 - -########################################################## -########################################################## -# Configurations below are divided on each motor/axis. If the module used have more motors than listed below, -# copy and paste all the configuration per motor, configure the needed topic names, wheel diameter values and -# generic ratios, and rename the motor name (should follow motor naming below - motor0, motor1, ..., motorn) -# otherwise, the node will fail. - -motor0: - en_pub_tmc_info: true - pub_actual_vel: true - pub_actual_pos: true - pub_actual_trq: true - tmc_info_topic: "/tmc_info_0" - tmc_cmd_vel_topic: "/cmd_vel_0" - tmc_cmd_abspos_topic: "/cmd_abspos_0" - tmc_cmd_relpos_topic: "/cmd_relpos_0" - tmc_cmd_trq_topic: "/cmd_trq_0" - - wheel_diameter: 0.25 - additional_ratio_vel: 1 - additional_ratio_pos: 1 - additional_ratio_trq: 1 diff --git a/config/TMCM-1141_Ext.yaml b/config/TMCM-1141_Ext.yaml deleted file mode 100644 index 278a20b..0000000 --- a/config/TMCM-1141_Ext.yaml +++ /dev/null @@ -1,89 +0,0 @@ -########################################################## -# Parameter Configurations for TMCM-1141 -########################################################## - -########## Interface Settings - -# Communication interface -# Description: Interface used between the PC and the TMC -# Possible values: -# - 0: CAN -comm_interface: 0 - -# Communication interface name -# Description: Name of the interface or device as detected by the PC -# Possible values: -# - can0, can1, can2, ..., etc -comm_interface_name: can0 - -# Communication interface Tx ID -# Description: Currently applicable only for CAN interface (Tx ID) -# Possible values: -# - 0 to 255 -# Note: The ID that would work will be the one set at the TMC's GP: 71 -comm_tx_id: 1 - -# Communication interface Rx ID -# Description: Currently applicable only for CAN interface (Rx ID) -# Possible values: -# - 0 to 255 -# Note: The ID that would work will be the one set at the TMC's GP: 70 -comm_rx_id: 2 - -# Communication timeout rate in seconds -# Description: Indicates how long should the node will wait for the rx data -# Possible values: -# - value in millisecs 0 - 5000 -comm_timeout_ms: 100 - -# Communication timeout tries -# Description: Indicates how many the node will retry sending data before shutting down if no data received -# Possible values: -# - 1 - 3 -comm_exec_cmd_retries: 1 - -########## Additional Settings - -# Adhoc Mode -# Description: This mode expects that the used module is not known. The velocity, position and torque relies on the additional ratios -adhoc_mode: false - -# Active motors or axes -# Description: Enables/disables active motors or axes. If disabled, settings for those motors will be ignored or not set. -# Possible values: -# - 0: Not used -# - 1: Active -en_motors: [1] - -# Publish rate of TMC information -# Decription: Publish rate (hertz) of TMC information -# Possible values: 10 - 100 -pub_rate_tmc_info: 10 - -# Auto start mode additional delay -# Decription: Added delay if auto start mode is enabled. You can add delay if your TMCL program needs to run over 2 seconds. -# Possible values: 0 - 10 (secs) -auto_start_additional_delay: 0 - -########################################################## -########################################################## -# Configurations below are divided on each motor/axis. If the module used have more motors than listed below, -# copy and paste all the configuration per motor, configure the needed topic names, wheel diameter values and -# generic ratios, and rename the motor name (should follow motor naming below - motor0, motor1, ..., motorn) -# otherwise, the node will fail. - -motor0: - en_pub_tmc_info: true - pub_actual_vel: true - pub_actual_pos: true - pub_actual_trq: true - tmc_info_topic: "/tmc_info_0" - tmc_cmd_vel_topic: "/cmd_vel_0" - tmc_cmd_abspos_topic: "/cmd_abspos_0" - tmc_cmd_relpos_topic: "/cmd_relpos_0" - tmc_cmd_trq_topic: "/cmd_trq_0" - - wheel_diameter: 0.25 - additional_ratio_vel: 1 - additional_ratio_pos: 1 - additional_ratio_trq: 1 diff --git a/config/TMCM-1161_Ext.yaml b/config/TMCM-1161_Ext.yaml deleted file mode 100644 index 3143a27..0000000 --- a/config/TMCM-1161_Ext.yaml +++ /dev/null @@ -1,89 +0,0 @@ -########################################################## -# Parameter Configurations for TMCM-1161 -########################################################## - -########## Interface Settings - -# Communication interface -# Description: Interface used between the PC and the TMC -# Possible values: -# - 0: CAN -comm_interface: 0 - -# Communication interface name -# Description: Name of the interface or device as detected by the PC -# Possible values: -# - can0, can1, can2, ..., etc -comm_interface_name: can0 - -# Communication interface Tx ID -# Description: Currently applicable only for CAN interface (Tx ID) -# Possible values: -# - 0 to 255 -# Note: The ID that would work will be the one set at the TMC's GP: 71 -comm_tx_id: 1 - -# Communication interface Rx ID -# Description: Currently applicable only for CAN interface (Rx ID) -# Possible values: -# - 0 to 255 -# Note: The ID that would work will be the one set at the TMC's GP: 70 -comm_rx_id: 2 - -# Communication timeout rate in seconds -# Description: Indicates how long should the node will wait for the rx data -# Possible values: -# - value in millisecs 0 - 5000 -comm_timeout_ms: 100 - -# Communication timeout tries -# Description: Indicates how many the node will retry sending data before shutting down if no data received -# Possible values: -# - 1 - 3 -comm_exec_cmd_retries: 1 - -########## Additional Settings - -# Adhoc Mode -# Description: This mode expects that the used module is not known. The velocity, position and torque relies on the additional ratios -adhoc_mode: false - -# Active motors or axes -# Description: Enables/disables active motors or axes. If disabled, settings for those motors will be ignored or not set. -# Possible values: -# - 0: Not used -# - 1: Active -en_motors: [1] - -# Publish rate of TMC information -# Decription: Publish rate (hertz) of TMC information -# Possible values: 10 - 100 -pub_rate_tmc_info: 10 - -# Auto start mode additional delay -# Decription: Added delay if auto start mode is enabled. You can add delay if your TMCL program needs to run over 2 seconds. -# Possible values: 0 - 10 (secs) -auto_start_additional_delay: 0 - -########################################################## -########################################################## -# Configurations below are divided on each motor/axis. If the module used have more motors than listed below, -# copy and paste all the configuration per motor, configure the needed topic names, wheel diameter values and -# generic ratios, and rename the motor name (should follow motor naming below - motor0, motor1, ..., motorn) -# otherwise, the node will fail. - -motor0: - en_pub_tmc_info: true - pub_actual_vel: true - pub_actual_pos: true - pub_actual_trq: true - tmc_info_topic: "/tmc_info_0" - tmc_cmd_vel_topic: "/cmd_vel_0" - tmc_cmd_abspos_topic: "/cmd_abspos_0" - tmc_cmd_relpos_topic: "/cmd_relpos_0" - tmc_cmd_trq_topic: "/cmd_trq_0" - - wheel_diameter: 0.25 - additional_ratio_vel: 1 - additional_ratio_pos: 1 - additional_ratio_trq: 1 diff --git a/config/TMCM-1181_Ext.yaml b/config/TMCM-1181_Ext.yaml deleted file mode 100644 index 7bbc118..0000000 --- a/config/TMCM-1181_Ext.yaml +++ /dev/null @@ -1,89 +0,0 @@ -########################################################## -# Parameter Configurations for TMCM-1181 -########################################################## - -########## Interface Settings - -# Communication interface -# Description: Interface used between the PC and the TMC -# Possible values: -# - 0: CAN -comm_interface: 0 - -# Communication interface name -# Description: Name of the interface or device as detected by the PC -# Possible values: -# - can0, can1, can2, ..., etc -comm_interface_name: can0 - -# Communication interface Tx ID -# Description: Currently applicable only for CAN interface (Tx ID) -# Possible values: -# - 0 to 255 -# Note: The ID that would work will be the one set at the TMC's GP: 71 -comm_tx_id: 1 - -# Communication interface Rx ID -# Description: Currently applicable only for CAN interface (Rx ID) -# Possible values: -# - 0 to 255 -# Note: The ID that would work will be the one set at the TMC's GP: 70 -comm_rx_id: 2 - -# Communication timeout rate in seconds -# Description: Indicates how long should the node will wait for the rx data -# Possible values: -# - value in millisecs 0 - 5000 -comm_timeout_ms: 100 - -# Communication timeout tries -# Description: Indicates how many the node will retry sending data before shutting down if no data received -# Possible values: -# - 1 - 3 -comm_exec_cmd_retries: 1 - -########## Additional Settings - -# Adhoc Mode -# Description: This mode expects that the used module is not known. The velocity, position and torque relies on the additional ratios -adhoc_mode: false - -# Active motors or axes -# Description: Enables/disables active motors or axes. If disabled, settings for those motors will be ignored or not set. -# Possible values: -# - 0: Not used -# - 1: Active -en_motors: [1] - -# Publish rate of TMC information -# Decription: Publish rate (hertz) of TMC information -# Possible values: 10 - 100 -pub_rate_tmc_info: 10 - -# Auto start mode additional delay -# Decription: Added delay if auto start mode is enabled. You can add delay if your TMCL program needs to run over 2 seconds. -# Possible values: 0 - 10 (secs) -auto_start_additional_delay: 0 - -########################################################## -########################################################## -# Configurations below are divided on each motor/axis. If the module used have more motors than listed below, -# copy and paste all the configuration per motor, configure the needed topic names, wheel diameter values and -# generic ratios, and rename the motor name (should follow motor naming below - motor0, motor1, ..., motorn) -# otherwise, the node will fail. - -motor0: - en_pub_tmc_info: true - pub_actual_vel: true - pub_actual_pos: true - pub_actual_trq: true - tmc_info_topic: "/tmc_info_0" - tmc_cmd_vel_topic: "/cmd_vel_0" - tmc_cmd_abspos_topic: "/cmd_abspos_0" - tmc_cmd_relpos_topic: "/cmd_relpos_0" - tmc_cmd_trq_topic: "/cmd_trq_0" - - wheel_diameter: 0.25 - additional_ratio_vel: 1 - additional_ratio_pos: 1 - additional_ratio_trq: 1 diff --git a/config/TMCM-1210_Ext.yaml b/config/TMCM-1210_Ext.yaml deleted file mode 100644 index 512bd4f..0000000 --- a/config/TMCM-1210_Ext.yaml +++ /dev/null @@ -1,89 +0,0 @@ -########################################################## -# Parameter Configurations for TMCM-1210 -########################################################## - -########## Interface Settings - -# Communication interface -# Description: Interface used between the PC and the TMC -# Possible values: -# - 0: CAN -comm_interface: 0 - -# Communication interface name -# Description: Name of the interface or device as detected by the PC -# Possible values: -# - can0, can1, can2, ..., etc -comm_interface_name: can0 - -# Communication interface Tx ID -# Description: Currently applicable only for CAN interface (Tx ID) -# Possible values: -# - 0 to 255 -# Note: The ID that would work will be the one set at the TMC's GP: 71 -comm_tx_id: 1 - -# Communication interface Rx ID -# Description: Currently applicable only for CAN interface (Rx ID) -# Possible values: -# - 0 to 255 -# Note: The ID that would work will be the one set at the TMC's GP: 70 -comm_rx_id: 2 - -# Communication timeout rate in seconds -# Description: Indicates how long should the node will wait for the rx data -# Possible values: -# - value in millisecs 0 - 5000 -comm_timeout_ms: 100 - -# Communication timeout tries -# Description: Indicates how many the node will retry sending data before shutting down if no data received -# Possible values: -# - 1 - 3 -comm_exec_cmd_retries: 1 - -########## Additional Settings - -# Adhoc Mode -# Description: This mode expects that the used module is not known. The velocity, position and torque relies on the additional ratios -adhoc_mode: false - -# Active motors or axes -# Description: Enables/disables active motors or axes. If disabled, settings for those motors will be ignored or not set. -# Possible values: -# - 0: Not used -# - 1: Active -en_motors: [1] - -# Publish rate of TMC information -# Decription: Publish rate (hertz) of TMC information -# Possible values: 10 - 100 -pub_rate_tmc_info: 10 - -# Auto start mode additional delay -# Decription: Added delay if auto start mode is enabled. You can add delay if your TMCL program needs to run over 2 seconds. -# Possible values: 0 - 10 (secs) -auto_start_additional_delay: 0 - -########################################################## -########################################################## -# Configurations below are divided on each motor/axis. If the module used have more motors than listed below, -# copy and paste all the configuration per motor, configure the needed topic names, wheel diameter values and -# generic ratios, and rename the motor name (should follow motor naming below - motor0, motor1, ..., motorn) -# otherwise, the node will fail. - -motor0: - en_pub_tmc_info: true - pub_actual_vel: true - pub_actual_pos: true - pub_actual_trq: true - tmc_info_topic: "/tmc_info_0" - tmc_cmd_vel_topic: "/cmd_vel_0" - tmc_cmd_abspos_topic: "/cmd_abspos_0" - tmc_cmd_relpos_topic: "/cmd_relpos_0" - tmc_cmd_trq_topic: "/cmd_trq_0" - - wheel_diameter: 0.25 - additional_ratio_vel: 1 - additional_ratio_pos: 1 - additional_ratio_trq: 1 diff --git a/config/TMCM-1211_Ext.yaml b/config/TMCM-1211_Ext.yaml deleted file mode 100644 index 105bd26..0000000 --- a/config/TMCM-1211_Ext.yaml +++ /dev/null @@ -1,89 +0,0 @@ -########################################################## -# Parameter Configurations for TMCM-1211 -########################################################## - -########## Interface Settings - -# Communication interface -# Description: Interface used between the PC and the TMC -# Possible values: -# - 0: CAN -comm_interface: 0 - -# Communication interface name -# Description: Name of the interface or device as detected by the PC -# Possible values: -# - can0, can1, can2, ..., etc -comm_interface_name: can0 - -# Communication interface Tx ID -# Description: Currently applicable only for CAN interface (Tx ID) -# Possible values: -# - 0 to 255 -# Note: The ID that would work will be the one set at the TMC's GP: 71 -comm_tx_id: 1 - -# Communication interface Rx ID -# Description: Currently applicable only for CAN interface (Rx ID) -# Possible values: -# - 0 to 255 -# Note: The ID that would work will be the one set at the TMC's GP: 70 -comm_rx_id: 2 - -# Communication timeout rate in seconds -# Description: Indicates how long should the node will wait for the rx data -# Possible values: -# - value in millisecs 0 - 5000 -comm_timeout_ms: 100 - -# Communication timeout tries -# Description: Indicates how many the node will retry sending data before shutting down if no data received -# Possible values: -# - 1 - 3 -comm_exec_cmd_retries: 1 - -########## Additional Settings - -# Adhoc Mode -# Description: This mode expects that the used module is not known. The velocity, position and torque relies on the additional ratios -adhoc_mode: false - -# Active motors or axes -# Description: Enables/disables active motors or axes. If disabled, settings for those motors will be ignored or not set. -# Possible values: -# - 0: Not used -# - 1: Active -en_motors: [1] - -# Publish rate of TMC information -# Decription: Publish rate (hertz) of TMC information -# Possible values: 10 - 100 -pub_rate_tmc_info: 10 - -# Auto start mode additional delay -# Decription: Added delay if auto start mode is enabled. You can add delay if your TMCL program needs to run over 2 seconds. -# Possible values: 0 - 10 (secs) -auto_start_additional_delay: 0 - -########################################################## -########################################################## -# Configurations below are divided on each motor/axis. If the module used have more motors than listed below, -# copy and paste all the configuration per motor, configure the needed topic names, wheel diameter values and -# generic ratios, and rename the motor name (should follow motor naming below - motor0, motor1, ..., motorn) -# otherwise, the node will fail. - -motor0: - en_pub_tmc_info: true - pub_actual_vel: true - pub_actual_pos: true - pub_actual_trq: true - tmc_info_topic: "/tmc_info_0" - tmc_cmd_vel_topic: "/cmd_vel_0" - tmc_cmd_abspos_topic: "/cmd_abspos_0" - tmc_cmd_relpos_topic: "/cmd_relpos_0" - tmc_cmd_trq_topic: "/cmd_trq_0" - - wheel_diameter: 0.25 - additional_ratio_vel: 1 - additional_ratio_pos: 1 - additional_ratio_trq: 1 diff --git a/config/TMCM-1243_Ext.yaml b/config/TMCM-1243_Ext.yaml deleted file mode 100644 index 6561c17..0000000 --- a/config/TMCM-1243_Ext.yaml +++ /dev/null @@ -1,89 +0,0 @@ -########################################################## -# Parameter Configurations for TMCM-1243 -########################################################## - -########## Interface Settings - -# Communication interface -# Description: Interface used between the PC and the TMC -# Possible values: -# - 0: CAN -comm_interface: 0 - -# Communication interface name -# Description: Name of the interface or device as detected by the PC -# Possible values: -# - can0, can1, can2, ..., etc -comm_interface_name: can0 - -# Communication interface Tx ID -# Description: Currently applicable only for CAN interface (Tx ID) -# Possible values: -# - 0 to 255 -# Note: The ID that would work will be the one set at the TMC's GP: 71 -comm_tx_id: 1 - -# Communication interface Rx ID -# Description: Currently applicable only for CAN interface (Rx ID) -# Possible values: -# - 0 to 255 -# Note: The ID that would work will be the one set at the TMC's GP: 70 -comm_rx_id: 2 - -# Communication timeout rate in seconds -# Description: Indicates how long should the node will wait for the rx data -# Possible values: -# - value in millisecs 0 - 5000 -comm_timeout_ms: 100 - -# Communication timeout tries -# Description: Indicates how many the node will retry sending data before shutting down if no data received -# Possible values: -# - 1 - 3 -comm_exec_cmd_retries: 1 - -########## Additional Settings - -# Adhoc Mode -# Description: This mode expects that the used module is not known. The velocity, position and torque relies on the additional ratios -adhoc_mode: false - -# Active motors or axes -# Description: Enables/disables active motors or axes. If disabled, settings for those motors will be ignored or not set. -# Possible values: -# - 0: Not used -# - 1: Active -en_motors: [1] - -# Publish rate of TMC information -# Decription: Publish rate (hertz) of TMC information -# Possible values: 10 - 100 -pub_rate_tmc_info: 10 - -# Auto start mode additional delay -# Decription: Added delay if auto start mode is enabled. You can add delay if your TMCL program needs to run over 2 seconds. -# Possible values: 0 - 10 (secs) -auto_start_additional_delay: 0 - -########################################################## -########################################################## -# Configurations below are divided on each motor/axis. If the module used have more motors than listed below, -# copy and paste all the configuration per motor, configure the needed topic names, wheel diameter values and -# generic ratios, and rename the motor name (should follow motor naming below - motor0, motor1, ..., motorn) -# otherwise, the node will fail. - -motor0: - en_pub_tmc_info: true - pub_actual_vel: true - pub_actual_pos: true - pub_actual_trq: true - tmc_info_topic: "/tmc_info_0" - tmc_cmd_vel_topic: "/cmd_vel_0" - tmc_cmd_abspos_topic: "/cmd_abspos_0" - tmc_cmd_relpos_topic: "/cmd_relpos_0" - tmc_cmd_trq_topic: "/cmd_trq_0" - - wheel_diameter: 0.25 - additional_ratio_vel: 1 - additional_ratio_pos: 1 - additional_ratio_trq: 1 diff --git a/config/TMCM-1310_Ext.yaml b/config/TMCM-1310_Ext.yaml deleted file mode 100644 index 09ab8af..0000000 --- a/config/TMCM-1310_Ext.yaml +++ /dev/null @@ -1,89 +0,0 @@ -########################################################## -# Parameter Configurations for TMCM-1310 -########################################################## - -########## Interface Settings - -# Communication interface -# Description: Interface used between the PC and the TMC -# Possible values: -# - 0: CAN -comm_interface: 0 - -# Communication interface name -# Description: Name of the interface or device as detected by the PC -# Possible values: -# - can0, can1, can2, ..., etc -comm_interface_name: can0 - -# Communication interface Tx ID -# Description: Currently applicable only for CAN interface (Tx ID) -# Possible values: -# - 0 to 255 -# Note: The ID that would work will be the one set at the TMC's GP: 71 -comm_tx_id: 1 - -# Communication interface Rx ID -# Description: Currently applicable only for CAN interface (Rx ID) -# Possible values: -# - 0 to 255 -# Note: The ID that would work will be the one set at the TMC's GP: 70 -comm_rx_id: 2 - -# Communication timeout rate in seconds -# Description: Indicates how long should the node will wait for the rx data -# Possible values: -# - value in millisecs 0 - 5000 -comm_timeout_ms: 100 - -# Communication timeout tries -# Description: Indicates how many the node will retry sending data before shutting down if no data received -# Possible values: -# - 1 - 3 -comm_exec_cmd_retries: 1 - -########## Additional Settings - -# Adhoc Mode -# Description: This mode expects that the used module is not known. The velocity, position and torque relies on the additional ratios -adhoc_mode: false - -# Active motors or axes -# Description: Enables/disables active motors or axes. If disabled, settings for those motors will be ignored or not set. -# Possible values: -# - 0: Not used -# - 1: Active -en_motors: [1] - -# Publish rate of TMC information -# Decription: Publish rate (hertz) of TMC information -# Possible values: 10 - 100 -pub_rate_tmc_info: 10 - -# Auto start mode additional delay -# Decription: Added delay if auto start mode is enabled. You can add delay if your TMCL program needs to run over 2 seconds. -# Possible values: 0 - 10 (secs) -auto_start_additional_delay: 0 - -########################################################## -########################################################## -# Configurations below are divided on each motor/axis. If the module used have more motors than listed below, -# copy and paste all the configuration per motor, configure the needed topic names, wheel diameter values and -# generic ratios, and rename the motor name (should follow motor naming below - motor0, motor1, ..., motorn) -# otherwise, the node will fail. - -motor0: - en_pub_tmc_info: true - pub_actual_vel: true - pub_actual_pos: true - pub_actual_trq: true - tmc_info_topic: "/tmc_info_0" - tmc_cmd_vel_topic: "/cmd_vel_0" - tmc_cmd_abspos_topic: "/cmd_abspos_0" - tmc_cmd_relpos_topic: "/cmd_relpos_0" - tmc_cmd_trq_topic: "/cmd_trq_0" - - wheel_diameter: 0.25 - additional_ratio_vel: 1 - additional_ratio_pos: 1 - additional_ratio_trq: 1 diff --git a/config/TMCM-1316_Ext.yaml b/config/TMCM-1316_Ext.yaml deleted file mode 100644 index 6b7ebc1..0000000 --- a/config/TMCM-1316_Ext.yaml +++ /dev/null @@ -1,89 +0,0 @@ -########################################################## -# Parameter Configurations for TMCM-1316 -########################################################## - -########## Interface Settings - -# Communication interface -# Description: Interface used between the PC and the TMC -# Possible values: -# - 0: CAN -comm_interface: 0 - -# Communication interface name -# Description: Name of the interface or device as detected by the PC -# Possible values: -# - can0, can1, can2, ..., etc -comm_interface_name: can0 - -# Communication interface Tx ID -# Description: Currently applicable only for CAN interface (Tx ID) -# Possible values: -# - 0 to 255 -# Note: The ID that would work will be the one set at the TMC's GP: 71 -comm_tx_id: 1 - -# Communication interface Rx ID -# Description: Currently applicable only for CAN interface (Rx ID) -# Possible values: -# - 0 to 255 -# Note: The ID that would work will be the one set at the TMC's GP: 70 -comm_rx_id: 2 - -# Communication timeout rate in seconds -# Description: Indicates how long should the node will wait for the rx data -# Possible values: -# - value in millisecs 0 - 5000 -comm_timeout_ms: 100 - -# Communication timeout tries -# Description: Indicates how many the node will retry sending data before shutting down if no data received -# Possible values: -# - 1 - 3 -comm_exec_cmd_retries: 1 - -########## Additional Settings - -# Adhoc Mode -# Description: This mode expects that the used module is not known. The velocity, position and torque relies on the additional ratios -adhoc_mode: false - -# Active motors or axes -# Description: Enables/disables active motors or axes. If disabled, settings for those motors will be ignored or not set. -# Possible values: -# - 0: Not used -# - 1: Active -en_motors: [1] - -# Publish rate of TMC information -# Decription: Publish rate (hertz) of TMC information -# Possible values: 10 - 100 -pub_rate_tmc_info: 10 - -# Auto start mode additional delay -# Decription: Added delay if auto start mode is enabled. You can add delay if your TMCL program needs to run over 2 seconds. -# Possible values: 0 - 10 (secs) -auto_start_additional_delay: 0 - -########################################################## -########################################################## -# Configurations below are divided on each motor/axis. If the module used have more motors than listed below, -# copy and paste all the configuration per motor, configure the needed topic names, wheel diameter values and -# generic ratios, and rename the motor name (should follow motor naming below - motor0, motor1, ..., motorn) -# otherwise, the node will fail. - -motor0: - en_pub_tmc_info: true - pub_actual_vel: true - pub_actual_pos: true - pub_actual_trq: true - tmc_info_topic: "/tmc_info_0" - tmc_cmd_vel_topic: "/cmd_vel_0" - tmc_cmd_abspos_topic: "/cmd_abspos_0" - tmc_cmd_relpos_topic: "/cmd_relpos_0" - tmc_cmd_trq_topic: "/cmd_trq_0" - - wheel_diameter: 0.25 - additional_ratio_vel: 1 - additional_ratio_pos: 1 - additional_ratio_trq: 1 diff --git a/config/TMCM-1321_Ext.yaml b/config/TMCM-1321_Ext.yaml deleted file mode 100644 index a2950c4..0000000 --- a/config/TMCM-1321_Ext.yaml +++ /dev/null @@ -1,89 +0,0 @@ -########################################################## -# Parameter Configurations for TMCM-1321 -########################################################## - -########## Interface Settings - -# Communication interface -# Description: Interface used between the PC and the TMC -# Possible values: -# - 0: CAN -comm_interface: 0 - -# Communication interface name -# Description: Name of the interface or device as detected by the PC -# Possible values: -# - can0, can1, can2, ..., etc -comm_interface_name: can0 - -# Communication interface Tx ID -# Description: Currently applicable only for CAN interface (Tx ID) -# Possible values: -# - 0 to 255 -# Note: The ID that would work will be the one set at the TMC's GP: 71 -comm_tx_id: 1 - -# Communication interface Rx ID -# Description: Currently applicable only for CAN interface (Rx ID) -# Possible values: -# - 0 to 255 -# Note: The ID that would work will be the one set at the TMC's GP: 70 -comm_rx_id: 2 - -# Communication timeout rate in seconds -# Description: Indicates how long should the node will wait for the rx data -# Possible values: -# - value in millisecs 0 - 5000 -comm_timeout_ms: 100 - -# Communication timeout tries -# Description: Indicates how many the node will retry sending data before shutting down if no data received -# Possible values: -# - 1 - 3 -comm_exec_cmd_retries: 1 - -########## Additional Settings - -# Adhoc Mode -# Description: This mode expects that the used module is not known. The velocity, position and torque relies on the additional ratios -adhoc_mode: false - -# Active motors or axes -# Description: Enables/disables active motors or axes. If disabled, settings for those motors will be ignored or not set. -# Possible values: -# - 0: Not used -# - 1: Active -en_motors: [1] - -# Publish rate of TMC information -# Decription: Publish rate (hertz) of TMC information -# Possible values: 10 - 100 -pub_rate_tmc_info: 10 - -# Auto start mode additional delay -# Decription: Added delay if auto start mode is enabled. You can add delay if your TMCL program needs to run over 2 seconds. -# Possible values: 0 - 10 (secs) -auto_start_additional_delay: 0 - -########################################################## -########################################################## -# Configurations below are divided on each motor/axis. If the module used have more motors than listed below, -# copy and paste all the configuration per motor, configure the needed topic names, wheel diameter values and -# generic ratios, and rename the motor name (should follow motor naming below - motor0, motor1, ..., motorn) -# otherwise, the node will fail. - -motor0: - en_pub_tmc_info: true - pub_actual_vel: true - pub_actual_pos: true - pub_actual_trq: true - tmc_info_topic: "/tmc_info_0" - tmc_cmd_vel_topic: "/cmd_vel_0" - tmc_cmd_abspos_topic: "/cmd_abspos_0" - tmc_cmd_relpos_topic: "/cmd_relpos_0" - tmc_cmd_trq_topic: "/cmd_trq_0" - - wheel_diameter: 0.25 - additional_ratio_vel: 1 - additional_ratio_pos: 1 - additional_ratio_trq: 1 diff --git a/config/TMCM-1370_Ext.yaml b/config/TMCM-1370_Ext.yaml deleted file mode 100644 index 1315a56..0000000 --- a/config/TMCM-1370_Ext.yaml +++ /dev/null @@ -1,89 +0,0 @@ -########################################################## -# Parameter Configurations for TMCM-1370 -########################################################## - -########## Interface Settings - -# Communication interface -# Description: Interface used between the PC and the TMC -# Possible values: -# - 0: CAN -comm_interface: 0 - -# Communication interface name -# Description: Name of the interface or device as detected by the PC -# Possible values: -# - can0, can1, can2, ..., etc -comm_interface_name: can0 - -# Communication interface Tx ID -# Description: Currently applicable only for CAN interface (Tx ID) -# Possible values: -# - 0 to 255 -# Note: The ID that would work will be the one set at the TMC's GP: 71 -comm_tx_id: 1 - -# Communication interface Rx ID -# Description: Currently applicable only for CAN interface (Rx ID) -# Possible values: -# - 0 to 255 -# Note: The ID that would work will be the one set at the TMC's GP: 70 -comm_rx_id: 2 - -# Communication timeout rate in seconds -# Description: Indicates how long should the node will wait for the rx data -# Possible values: -# - value in millisecs 0 - 5000 -comm_timeout_ms: 100 - -# Communication timeout tries -# Description: Indicates how many the node will retry sending data before shutting down if no data received -# Possible values: -# - 1 - 3 -comm_exec_cmd_retries: 1 - -########## Additional Settings - -# Adhoc Mode -# Description: This mode expects that the used module is not known. The velocity, position and torque relies on the additional ratios -adhoc_mode: false - -# Active motors or axes -# Description: Enables/disables active motors or axes. If disabled, settings for those motors will be ignored or not set. -# Possible values: -# - 0: Not used -# - 1: Active -en_motors: [1] - -# Publish rate of TMC information -# Decription: Publish rate (hertz) of TMC information -# Possible values: 10 - 100 -pub_rate_tmc_info: 10 - -# Auto start mode additional delay -# Decription: Added delay if auto start mode is enabled. You can add delay if your TMCL program needs to run over 2 seconds. -# Possible values: 0 - 10 (secs) -auto_start_additional_delay: 0 - -########################################################## -########################################################## -# Configurations below are divided on each motor/axis. If the module used have more motors than listed below, -# copy and paste all the configuration per motor, configure the needed topic names, wheel diameter values and -# generic ratios, and rename the motor name (should follow motor naming below - motor0, motor1, ..., motorn) -# otherwise, the node will fail. - -motor0: - en_pub_tmc_info: true - pub_actual_vel: true - pub_actual_pos: true - pub_actual_trq: true - tmc_info_topic: "/tmc_info_0" - tmc_cmd_vel_topic: "/cmd_vel_0" - tmc_cmd_abspos_topic: "/cmd_abspos_0" - tmc_cmd_relpos_topic: "/cmd_relpos_0" - tmc_cmd_trq_topic: "/cmd_trq_0" - - wheel_diameter: 0.25 - additional_ratio_vel: 1 - additional_ratio_pos: 1 - additional_ratio_trq: 1 diff --git a/config/TMCM-1640_Ext.yaml b/config/TMCM-1640_Ext.yaml deleted file mode 100644 index 678af0c..0000000 --- a/config/TMCM-1640_Ext.yaml +++ /dev/null @@ -1,89 +0,0 @@ -########################################################## -# Parameter Configurations for TMCM-1640 -########################################################## - -########## Interface Settings - -# Communication interface -# Description: Interface used between the PC and the TMC -# Possible values: -# - 0: CAN -comm_interface: 0 - -# Communication interface name -# Description: Name of the interface or device as detected by the PC -# Possible values: -# - can0, can1, can2, ..., etc -comm_interface_name: can0 - -# Communication interface Tx ID -# Description: Currently applicable only for CAN interface (Tx ID) -# Possible values: -# - 0 to 255 -# Note: The ID that would work will be the one set at the TMC's GP: 71 -comm_tx_id: 1 - -# Communication interface Rx ID -# Description: Currently applicable only for CAN interface (Rx ID) -# Possible values: -# - 0 to 255 -# Note: The ID that would work will be the one set at the TMC's GP: 70 -comm_rx_id: 2 - -# Communication timeout rate in seconds -# Description: Indicates how long should the node will wait for the rx data -# Possible values: -# - value in millisecs 0 - 5000 -comm_timeout_ms: 100 - -# Communication timeout tries -# Description: Indicates how many the node will retry sending data before shutting down if no data received -# Possible values: -# - 1 - 3 -comm_exec_cmd_retries: 1 - -########## Additional Settings - -# Adhoc Mode -# Description: This mode expects that the used module is not known. The velocity, position and torque relies on the additional ratios -adhoc_mode: false - -# Active motors or axes -# Description: Enables/disables active motors or axes. If disabled, settings for those motors will be ignored or not set. -# Possible values: -# - 0: Not used -# - 1: Active -en_motors: [1] - -# Publish rate of TMC information -# Decription: Publish rate (hertz) of TMC information -# Possible values: 10 - 100 -pub_rate_tmc_info: 10 - -# Auto start mode additional delay -# Decription: Added delay if auto start mode is enabled. You can add delay if your TMCL program needs to run over 2 seconds. -# Possible values: 0 - 10 (secs) -auto_start_additional_delay: 0 - -########################################################## -########################################################## -# Configurations below are divided on each motor/axis. If the module used have more motors than listed below, -# copy and paste all the configuration per motor, configure the needed topic names, wheel diameter values and -# generic ratios, and rename the motor name (should follow motor naming below - motor0, motor1, ..., motorn) -# otherwise, the node will fail. - -motor0: - en_pub_tmc_info: true - pub_actual_vel: true - pub_actual_pos: true - pub_actual_trq: true - tmc_info_topic: "/tmc_info_0" - tmc_cmd_vel_topic: "/cmd_vel_0" - tmc_cmd_abspos_topic: "/cmd_abspos_0" - tmc_cmd_relpos_topic: "/cmd_relpos_0" - tmc_cmd_trq_topic: "/cmd_trq_0" - - wheel_diameter: 0.25 - additional_ratio_vel: 1 - additional_ratio_pos: 1 - additional_ratio_trq: 1 diff --git a/config/TMCM-2300_Ext.yaml b/config/TMCM-2300_Ext.yaml deleted file mode 100644 index 35419be..0000000 --- a/config/TMCM-2300_Ext.yaml +++ /dev/null @@ -1,105 +0,0 @@ -########################################################## -# Parameter Configurations for TMCM-2300 -########################################################## - -########## Interface Settings - -# Communication interface -# Description: Interface used between the PC and the TMC -# Possible values: -# - 0: CAN -comm_interface: 0 - -# Communication interface name -# Description: Name of the interface or device as detected by the PC -# Possible values: -# - can0, can1, can2, ..., etc -comm_interface_name: can0 - -# Communication interface Tx ID -# Description: Currently applicable only for CAN interface (Tx ID) -# Possible values: -# - 0 to 255 -# Note: The ID that would work will be the one set at the TMC's GP: 71 -comm_tx_id: 1 - -# Communication interface Rx ID -# Description: Currently applicable only for CAN interface (Rx ID) -# Possible values: -# - 0 to 255 -# Note: The ID that would work will be the one set at the TMC's GP: 70 -comm_rx_id: 2 - -# Communication timeout rate in seconds -# Description: Indicates how long should the node will wait for the rx data -# Possible values: -# - value in millisecs 0 - 5000 -comm_timeout_ms: 100 - -# Communication timeout tries -# Description: Indicates how many the node will retry sending data before shutting down if no data received -# Possible values: -# - 1 - 3 -comm_exec_cmd_retries: 1 - -########## Additional Settings - -# Adhoc Mode -# Description: This mode expects that the used module is not known. The velocity, position and torque relies on the additional ratios -adhoc_mode: false - -# Active motors or axes -# Description: Enables/disables active motors or axes. If disabled, settings for those motors will be ignored or not set. -# Possible values: -# - 0: Not used -# - 1: Active -en_motors: [1,1] - -# Publish rate of TMC information -# Decription: Publish rate (hertz) of TMC information -# Possible values: 10 - 100 -pub_rate_tmc_info: 10 - -# Auto start mode additional delay -# Decription: Added delay if auto start mode is enabled. You can add delay if your TMCL program needs to run over 2 seconds. -# Possible values: 0 - 10 (secs) -auto_start_additional_delay: 0 - -########################################################## -########################################################## -# Configurations below are divided on each motor/axis. If the module used have more motors than listed below, -# copy and paste all the configuration per motor, configure the needed topic names, wheel diameter values and -# generic ratios, and rename the motor name (should follow motor naming below - motor0, motor1, ..., motorn) -# otherwise, the node will fail. - -motor0: - en_pub_tmc_info: true - pub_actual_vel: true - pub_actual_pos: true - pub_actual_trq: true - tmc_info_topic: "/tmc_info_0" - tmc_cmd_vel_topic: "/cmd_vel_0" - tmc_cmd_abspos_topic: "/cmd_abspos_0" - tmc_cmd_relpos_topic: "/cmd_relpos_0" - tmc_cmd_trq_topic: "/cmd_trq_0" - - wheel_diameter: 0.25 - additional_ratio_vel: 1 - additional_ratio_pos: 1 - additional_ratio_trq: 1 - -motor1: - en_pub_tmc_info: true - pub_actual_vel: true - pub_actual_pos: true - pub_actual_trq: true - tmc_info_topic: "/tmc_info_1" - tmc_cmd_vel_topic: "/cmd_vel_1" - tmc_cmd_abspos_topic: "/cmd_abspos_1" - tmc_cmd_relpos_topic: "/cmd_relpos_1" - tmc_cmd_trq_topic: "/cmd_trq_1" - - wheel_diameter: 0.25 - additional_ratio_vel: 1 - additional_ratio_pos: 1 - additional_ratio_trq: 1 diff --git a/config/TMCM-3213_Ext.yaml b/config/TMCM-3213_Ext.yaml deleted file mode 100644 index 78d3fea..0000000 --- a/config/TMCM-3213_Ext.yaml +++ /dev/null @@ -1,121 +0,0 @@ -########################################################## -# Parameter Configurations for TMCM-3213 -########################################################## - -########## Interface Settings - -# Communication interface -# Description: Interface used between the PC and the TMC -# Possible values: -# - 0: CAN -comm_interface: 0 - -# Communication interface name -# Description: Name of the interface or device as detected by the PC -# Possible values: -# - can0, can1, can2, ..., etc -comm_interface_name: can0 - -# Communication interface Tx ID -# Description: Currently applicable only for CAN interface (Tx ID) -# Possible values: -# - 0 to 255 -# Note: The ID that would work will be the one set at the TMC's GP: 71 -comm_tx_id: 1 - -# Communication interface Rx ID -# Description: Currently applicable only for CAN interface (Rx ID) -# Possible values: -# - 0 to 255 -# Note: The ID that would work will be the one set at the TMC's GP: 70 -comm_rx_id: 2 - -# Communication timeout rate in seconds -# Description: Indicates how long should the node will wait for the rx data -# Possible values: -# - value in millisecs 0 - 5000 -comm_timeout_ms: 100 - -# Communication timeout tries -# Description: Indicates how many the node will retry sending data before shutting down if no data received -# Possible values: -# - 1 - 3 -comm_exec_cmd_retries: 1 - -########## Additional Settings - -# Adhoc Mode -# Description: This mode expects that the used module is not known. The velocity, position and torque relies on the additional ratios -adhoc_mode: false - -# Active motors or axes -# Description: Enables/disables active motors or axes. If disabled, settings for those motors will be ignored or not set. -# Possible values: -# - 0: Not used -# - 1: Active -en_motors: [1,1,1] - -# Publish rate of TMC information -# Decription: Publish rate (hertz) of TMC information -# Possible values: 10 - 100 -pub_rate_tmc_info: 10 - -# Auto start mode additional delay -# Decription: Added delay if auto start mode is enabled. You can add delay if your TMCL program needs to run over 2 seconds. -# Possible values: 0 - 10 (secs) -auto_start_additional_delay: 0 - -########################################################## -########################################################## -# Configurations below are divided on each motor/axis. If the module used have more motors than listed below, -# copy and paste all the configuration per motor, configure the needed topic names, wheel diameter values and -# generic ratios, and rename the motor name (should follow motor naming below - motor0, motor1, ..., motorn) -# otherwise, the node will fail. - -motor0: - en_pub_tmc_info: true - pub_actual_vel: true - pub_actual_pos: true - pub_actual_trq: true - tmc_info_topic: "/tmc_info_0" - tmc_cmd_vel_topic: "/cmd_vel_0" - tmc_cmd_abspos_topic: "/cmd_abspos_0" - tmc_cmd_relpos_topic: "/cmd_relpos_0" - tmc_cmd_trq_topic: "/cmd_trq_0" - - wheel_diameter: 0.25 - additional_ratio_vel: 1 - additional_ratio_pos: 1 - additional_ratio_trq: 1 - -motor1: - en_pub_tmc_info: true - pub_actual_vel: true - pub_actual_pos: true - pub_actual_trq: true - tmc_info_topic: "/tmc_info_1" - tmc_cmd_vel_topic: "/cmd_vel_1" - tmc_cmd_abspos_topic: "/cmd_abspos_1" - tmc_cmd_relpos_topic: "/cmd_relpos_1" - tmc_cmd_trq_topic: "/cmd_trq_1" - - wheel_diameter: 0.25 - additional_ratio_vel: 1 - additional_ratio_pos: 1 - additional_ratio_trq: 1 - -motor2: - en_pub_tmc_info: true - pub_actual_vel: true - pub_actual_pos: true - pub_actual_trq: true - tmc_info_topic: "/tmc_info_2" - tmc_cmd_vel_topic: "/cmd_vel_2" - tmc_cmd_abspos_topic: "/cmd_abspos_2" - tmc_cmd_relpos_topic: "/cmd_relpos_2" - tmc_cmd_trq_topic: "/cmd_trq_2" - - wheel_diameter: 0.25 - additional_ratio_vel: 1 - additional_ratio_pos: 1 - additional_ratio_trq: 1 diff --git a/config/TMCM-3215_Ext.yaml b/config/TMCM-3215_Ext.yaml deleted file mode 100644 index 2afcd28..0000000 --- a/config/TMCM-3215_Ext.yaml +++ /dev/null @@ -1,121 +0,0 @@ -########################################################## -# Parameter Configurations for TMCM-3215 -########################################################## - -########## Interface Settings - -# Communication interface -# Description: Interface used between the PC and the TMC -# Possible values: -# - 0: CAN -comm_interface: 0 - -# Communication interface name -# Description: Name of the interface or device as detected by the PC -# Possible values: -# - can0, can1, can2, ..., etc -comm_interface_name: can0 - -# Communication interface Tx ID -# Description: Currently applicable only for CAN interface (Tx ID) -# Possible values: -# - 0 to 255 -# Note: The ID that would work will be the one set at the TMC's GP: 71 -comm_tx_id: 1 - -# Communication interface Rx ID -# Description: Currently applicable only for CAN interface (Rx ID) -# Possible values: -# - 0 to 255 -# Note: The ID that would work will be the one set at the TMC's GP: 70 -comm_rx_id: 2 - -# Communication timeout rate in seconds -# Description: Indicates how long should the node will wait for the rx data -# Possible values: -# - value in millisecs 0 - 5000 -comm_timeout_ms: 100 - -# Communication timeout tries -# Description: Indicates how many the node will retry sending data before shutting down if no data received -# Possible values: -# - 1 - 3 -comm_exec_cmd_retries: 1 - -########## Additional Settings - -# Adhoc Mode -# Description: This mode expects that the used module is not known. The velocity, position and torque relies on the additional ratios -adhoc_mode: false - -# Active motors or axes -# Description: Enables/disables active motors or axes. If disabled, settings for those motors will be ignored or not set. -# Possible values: -# - 0: Not used -# - 1: Active -en_motors: [1,1,1] - -# Publish rate of TMC information -# Decription: Publish rate (hertz) of TMC information -# Possible values: 10 - 100 -pub_rate_tmc_info: 10 - -# Auto start mode additional delay -# Decription: Added delay if auto start mode is enabled. You can add delay if your TMCL program needs to run over 2 seconds. -# Possible values: 0 - 10 (secs) -auto_start_additional_delay: 0 - -########################################################## -########################################################## -# Configurations below are divided on each motor/axis. If the module used have more motors than listed below, -# copy and paste all the configuration per motor, configure the needed topic names, wheel diameter values and -# generic ratios, and rename the motor name (should follow motor naming below - motor0, motor1, ..., motorn) -# otherwise, the node will fail. - -motor0: - en_pub_tmc_info: true - pub_actual_vel: true - pub_actual_pos: true - pub_actual_trq: true - tmc_info_topic: "/tmc_info_0" - tmc_cmd_vel_topic: "/cmd_vel_0" - tmc_cmd_abspos_topic: "/cmd_abspos_0" - tmc_cmd_relpos_topic: "/cmd_relpos_0" - tmc_cmd_trq_topic: "/cmd_trq_0" - - wheel_diameter: 0.25 - additional_ratio_vel: 1 - additional_ratio_pos: 1 - additional_ratio_trq: 1 - -motor1: - en_pub_tmc_info: true - pub_actual_vel: true - pub_actual_pos: true - pub_actual_trq: true - tmc_info_topic: "/tmc_info_1" - tmc_cmd_vel_topic: "/cmd_vel_1" - tmc_cmd_abspos_topic: "/cmd_abspos_1" - tmc_cmd_relpos_topic: "/cmd_relpos_1" - tmc_cmd_trq_topic: "/cmd_trq_1" - - wheel_diameter: 0.25 - additional_ratio_vel: 1 - additional_ratio_pos: 1 - additional_ratio_trq: 1 - -motor2: - en_pub_tmc_info: true - pub_actual_vel: true - pub_actual_pos: true - pub_actual_trq: true - tmc_info_topic: "/tmc_info_2" - tmc_cmd_vel_topic: "/cmd_vel_2" - tmc_cmd_abspos_topic: "/cmd_abspos_2" - tmc_cmd_relpos_topic: "/cmd_relpos_2" - tmc_cmd_trq_topic: "/cmd_trq_2" - - wheel_diameter: 0.25 - additional_ratio_vel: 1 - additional_ratio_pos: 1 - additional_ratio_trq: 1 diff --git a/config/TMCM-3313_Ext.yaml b/config/TMCM-3313_Ext.yaml deleted file mode 100644 index 326504f..0000000 --- a/config/TMCM-3313_Ext.yaml +++ /dev/null @@ -1,121 +0,0 @@ -########################################################## -# Parameter Configurations for TMCM-3313 -########################################################## - -########## Interface Settings - -# Communication interface -# Description: Interface used between the PC and the TMC -# Possible values: -# - 0: CAN -comm_interface: 0 - -# Communication interface name -# Description: Name of the interface or device as detected by the PC -# Possible values: -# - can0, can1, can2, ..., etc -comm_interface_name: can0 - -# Communication interface Tx ID -# Description: Currently applicable only for CAN interface (Tx ID) -# Possible values: -# - 0 to 255 -# Note: The ID that would work will be the one set at the TMC's GP: 71 -comm_tx_id: 1 - -# Communication interface Rx ID -# Description: Currently applicable only for CAN interface (Rx ID) -# Possible values: -# - 0 to 255 -# Note: The ID that would work will be the one set at the TMC's GP: 70 -comm_rx_id: 2 - -# Communication timeout rate in seconds -# Description: Indicates how long should the node will wait for the rx data -# Possible values: -# - value in millisecs 0 - 5000 -comm_timeout_ms: 100 - -# Communication timeout tries -# Description: Indicates how many the node will retry sending data before shutting down if no data received -# Possible values: -# - 1 - 3 -comm_exec_cmd_retries: 1 - -########## Additional Settings - -# Adhoc Mode -# Description: This mode expects that the used module is not known. The velocity, position and torque relies on the additional ratios -adhoc_mode: false - -# Active motors or axes -# Description: Enables/disables active motors or axes. If disabled, settings for those motors will be ignored or not set. -# Possible values: -# - 0: Not used -# - 1: Active -en_motors: [1,1,1] - -# Publish rate of TMC information -# Decription: Publish rate (hertz) of TMC information -# Possible values: 10 - 100 -pub_rate_tmc_info: 10 - -# Auto start mode additional delay -# Decription: Added delay if auto start mode is enabled. You can add delay if your TMCL program needs to run over 2 seconds. -# Possible values: 0 - 10 (secs) -auto_start_additional_delay: 0 - -########################################################## -########################################################## -# Configurations below are divided on each motor/axis. If the module used have more motors than listed below, -# copy and paste all the configuration per motor, configure the needed topic names, wheel diameter values and -# generic ratios, and rename the motor name (should follow motor naming below - motor0, motor1, ..., motorn) -# otherwise, the node will fail. - -motor0: - en_pub_tmc_info: true - pub_actual_vel: true - pub_actual_pos: true - pub_actual_trq: true - tmc_info_topic: "/tmc_info_0" - tmc_cmd_vel_topic: "/cmd_vel_0" - tmc_cmd_abspos_topic: "/cmd_abspos_0" - tmc_cmd_relpos_topic: "/cmd_relpos_0" - tmc_cmd_trq_topic: "/cmd_trq_0" - - wheel_diameter: 0.25 - additional_ratio_vel: 1 - additional_ratio_pos: 1 - additional_ratio_trq: 1 - -motor1: - en_pub_tmc_info: true - pub_actual_vel: true - pub_actual_pos: true - pub_actual_trq: true - tmc_info_topic: "/tmc_info_1" - tmc_cmd_vel_topic: "/cmd_vel_1" - tmc_cmd_abspos_topic: "/cmd_abspos_1" - tmc_cmd_relpos_topic: "/cmd_relpos_1" - tmc_cmd_trq_topic: "/cmd_trq_1" - - wheel_diameter: 0.25 - additional_ratio_vel: 1 - additional_ratio_pos: 1 - additional_ratio_trq: 1 - -motor2: - en_pub_tmc_info: true - pub_actual_vel: true - pub_actual_pos: true - pub_actual_trq: true - tmc_info_topic: "/tmc_info_2" - tmc_cmd_vel_topic: "/cmd_vel_2" - tmc_cmd_abspos_topic: "/cmd_abspos_2" - tmc_cmd_relpos_topic: "/cmd_relpos_2" - tmc_cmd_trq_topic: "/cmd_trq_2" - - wheel_diameter: 0.25 - additional_ratio_vel: 1 - additional_ratio_pos: 1 - additional_ratio_trq: 1 diff --git a/config/TMCM-3315_Ext.yaml b/config/TMCM-3315_Ext.yaml deleted file mode 100644 index cec155d..0000000 --- a/config/TMCM-3315_Ext.yaml +++ /dev/null @@ -1,121 +0,0 @@ -########################################################## -# Parameter Configurations for TMCM-3315 -########################################################## - -########## Interface Settings - -# Communication interface -# Description: Interface used between the PC and the TMC -# Possible values: -# - 0: CAN -comm_interface: 0 - -# Communication interface name -# Description: Name of the interface or device as detected by the PC -# Possible values: -# - can0, can1, can2, ..., etc -comm_interface_name: can0 - -# Communication interface Tx ID -# Description: Currently applicable only for CAN interface (Tx ID) -# Possible values: -# - 0 to 255 -# Note: The ID that would work will be the one set at the TMC's GP: 71 -comm_tx_id: 1 - -# Communication interface Rx ID -# Description: Currently applicable only for CAN interface (Rx ID) -# Possible values: -# - 0 to 255 -# Note: The ID that would work will be the one set at the TMC's GP: 70 -comm_rx_id: 2 - -# Communication timeout rate in seconds -# Description: Indicates how long should the node will wait for the rx data -# Possible values: -# - value in millisecs 0 - 5000 -comm_timeout_ms: 100 - -# Communication timeout tries -# Description: Indicates how many the node will retry sending data before shutting down if no data received -# Possible values: -# - 1 - 3 -comm_exec_cmd_retries: 1 - -########## Additional Settings - -# Adhoc Mode -# Description: This mode expects that the used module is not known. The velocity, position and torque relies on the additional ratios -adhoc_mode: false - -# Active motors or axes -# Description: Enables/disables active motors or axes. If disabled, settings for those motors will be ignored or not set. -# Possible values: -# - 0: Not used -# - 1: Active -en_motors: [1,1,1] - -# Publish rate of TMC information -# Decription: Publish rate (hertz) of TMC information -# Possible values: 10 - 100 -pub_rate_tmc_info: 10 - -# Auto start mode additional delay -# Decription: Added delay if auto start mode is enabled. You can add delay if your TMCL program needs to run over 2 seconds. -# Possible values: 0 - 10 (secs) -auto_start_additional_delay: 0 - -########################################################## -########################################################## -# Configurations below are divided on each motor/axis. If the module used have more motors than listed below, -# copy and paste all the configuration per motor, configure the needed topic names, wheel diameter values and -# generic ratios, and rename the motor name (should follow motor naming below - motor0, motor1, ..., motorn) -# otherwise, the node will fail. - -motor0: - en_pub_tmc_info: true - pub_actual_vel: true - pub_actual_pos: true - pub_actual_trq: true - tmc_info_topic: "/tmc_info_0" - tmc_cmd_vel_topic: "/cmd_vel_0" - tmc_cmd_abspos_topic: "/cmd_abspos_0" - tmc_cmd_relpos_topic: "/cmd_relpos_0" - tmc_cmd_trq_topic: "/cmd_trq_0" - - wheel_diameter: 0.25 - additional_ratio_vel: 1 - additional_ratio_pos: 1 - additional_ratio_trq: 1 - -motor1: - en_pub_tmc_info: true - pub_actual_vel: true - pub_actual_pos: true - pub_actual_trq: true - tmc_info_topic: "/tmc_info_1" - tmc_cmd_vel_topic: "/cmd_vel_1" - tmc_cmd_abspos_topic: "/cmd_abspos_1" - tmc_cmd_relpos_topic: "/cmd_relpos_1" - tmc_cmd_trq_topic: "/cmd_trq_1" - - wheel_diameter: 0.25 - additional_ratio_vel: 1 - additional_ratio_pos: 1 - additional_ratio_trq: 1 - -motor2: - en_pub_tmc_info: true - pub_actual_vel: true - pub_actual_pos: true - pub_actual_trq: true - tmc_info_topic: "/tmc_info_2" - tmc_cmd_vel_topic: "/cmd_vel_2" - tmc_cmd_abspos_topic: "/cmd_abspos_2" - tmc_cmd_relpos_topic: "/cmd_relpos_2" - tmc_cmd_trq_topic: "/cmd_trq_2" - - wheel_diameter: 0.25 - additional_ratio_vel: 1 - additional_ratio_pos: 1 - additional_ratio_trq: 1 diff --git a/config/TMCM-6211_Ext.yaml b/config/TMCM-6211_Ext.yaml deleted file mode 100644 index 488b251..0000000 --- a/config/TMCM-6211_Ext.yaml +++ /dev/null @@ -1,169 +0,0 @@ -########################################################## -# Parameter Configurations for TMCM-6211 -########################################################## - -########## Interface Settings - -# Communication interface -# Description: Interface used between the PC and the TMC -# Possible values: -# - 0: CAN -comm_interface: 0 - -# Communication interface name -# Description: Name of the interface or device as detected by the PC -# Possible values: -# - can0, can1, can2, ..., etc -comm_interface_name: can0 - -# Communication interface Tx ID -# Description: Currently applicable only for CAN interface (Tx ID) -# Possible values: -# - 0 to 255 -# Note: The ID that would work will be the one set at the TMC's GP: 71 -comm_tx_id: 1 - -# Communication interface Rx ID -# Description: Currently applicable only for CAN interface (Rx ID) -# Possible values: -# - 0 to 255 -# Note: The ID that would work will be the one set at the TMC's GP: 70 -comm_rx_id: 2 - -# Communication timeout rate in seconds -# Description: Indicates how long should the node will wait for the rx data -# Possible values: -# - value in millisecs 0 - 5000 -comm_timeout_ms: 100 - -# Communication timeout tries -# Description: Indicates how many the node will retry sending data before shutting down if no data received -# Possible values: -# - 1 - 3 -comm_exec_cmd_retries: 1 - -########## Additional Settings - -# Adhoc Mode -# Description: This mode expects that the used module is not known. The velocity, position and torque relies on the additional ratios -adhoc_mode: false - -# Active motors or axes -# Description: Enables/disables active motors or axes. If disabled, settings for those motors will be ignored or not set. -# Possible values: -# - 0: Not used -# - 1: Active -en_motors: [1,1,1,1,1,1] - -# Publish rate of TMC information -# Decription: Publish rate (hertz) of TMC information -# Possible values: 10 - 100 -pub_rate_tmc_info: 10 - -# Auto start mode additional delay -# Decription: Added delay if auto start mode is enabled. You can add delay if your TMCL program needs to run over 2 seconds. -# Possible values: 0 - 10 (secs) -auto_start_additional_delay: 0 - -########################################################## -########################################################## -# Configurations below are divided on each motor/axis. If the module used have more motors than listed below, -# copy and paste all the configuration per motor, configure the needed topic names, wheel diameter values and -# generic ratios, and rename the motor name (should follow motor naming below - motor0, motor1, ..., motorn) -# otherwise, the node will fail. - -motor0: - en_pub_tmc_info: true - pub_actual_vel: true - pub_actual_pos: true - pub_actual_trq: true - tmc_info_topic: "/tmc_info_0" - tmc_cmd_vel_topic: "/cmd_vel_0" - tmc_cmd_abspos_topic: "/cmd_abspos_0" - tmc_cmd_relpos_topic: "/cmd_relpos_0" - tmc_cmd_trq_topic: "/cmd_trq_0" - - wheel_diameter: 0.25 - additional_ratio_vel: 1 - additional_ratio_pos: 1 - additional_ratio_trq: 1 - -motor1: - en_pub_tmc_info: true - pub_actual_vel: true - pub_actual_pos: true - pub_actual_trq: true - tmc_info_topic: "/tmc_info_1" - tmc_cmd_vel_topic: "/cmd_vel_1" - tmc_cmd_abspos_topic: "/cmd_abspos_1" - tmc_cmd_relpos_topic: "/cmd_relpos_1" - tmc_cmd_trq_topic: "/cmd_trq_1" - - wheel_diameter: 0.25 - additional_ratio_vel: 1 - additional_ratio_pos: 1 - additional_ratio_trq: 1 - -motor2: - en_pub_tmc_info: true - pub_actual_vel: true - pub_actual_pos: true - pub_actual_trq: true - tmc_info_topic: "/tmc_info_2" - tmc_cmd_vel_topic: "/cmd_vel_2" - tmc_cmd_abspos_topic: "/cmd_abspos_2" - tmc_cmd_relpos_topic: "/cmd_relpos_2" - tmc_cmd_trq_topic: "/cmd_trq_2" - - wheel_diameter: 0.25 - additional_ratio_vel: 1 - additional_ratio_pos: 1 - additional_ratio_trq: 1 - -motor3: - en_pub_tmc_info: true - pub_actual_vel: true - pub_actual_pos: true - pub_actual_trq: true - tmc_info_topic: "/tmc_info_3" - tmc_cmd_vel_topic: "/cmd_vel_3" - tmc_cmd_abspos_topic: "/cmd_abspos_3" - tmc_cmd_relpos_topic: "/cmd_relpos_3" - tmc_cmd_trq_topic: "/cmd_trq_3" - - wheel_diameter: 0.25 - additional_ratio_vel: 1 - additional_ratio_pos: 1 - additional_ratio_trq: 1 - -motor4: - en_pub_tmc_info: true - pub_actual_vel: true - pub_actual_pos: true - pub_actual_trq: true - tmc_info_topic: "/tmc_info_4" - tmc_cmd_vel_topic: "/cmd_vel_4" - tmc_cmd_abspos_topic: "/cmd_abspos_4" - tmc_cmd_relpos_topic: "/cmd_relpos_4" - tmc_cmd_trq_topic: "/cmd_trq_4" - - wheel_diameter: 0.25 - additional_ratio_vel: 1 - additional_ratio_pos: 1 - additional_ratio_trq: 1 - -motor5: - en_pub_tmc_info: true - pub_actual_vel: true - pub_actual_pos: true - pub_actual_trq: true - tmc_info_topic: "/tmc_info_5" - tmc_cmd_vel_topic: "/cmd_vel_5" - tmc_cmd_abspos_topic: "/cmd_abspos_5" - tmc_cmd_relpos_topic: "/cmd_relpos_5" - tmc_cmd_trq_topic: "/cmd_trq_5" - - wheel_diameter: 0.25 - additional_ratio_vel: 1 - additional_ratio_pos: 1 - additional_ratio_trq: 1 diff --git a/config/TMCM-6213_Ext.yaml b/config/TMCM-6213_Ext.yaml deleted file mode 100644 index 4b620d3..0000000 --- a/config/TMCM-6213_Ext.yaml +++ /dev/null @@ -1,169 +0,0 @@ -########################################################## -# Parameter Configurations for TMCM-6213 -########################################################## - -########## Interface Settings - -# Communication interface -# Description: Interface used between the PC and the TMC -# Possible values: -# - 0: CAN -comm_interface: 0 - -# Communication interface name -# Description: Name of the interface or device as detected by the PC -# Possible values: -# - can0, can1, can2, ..., etc -comm_interface_name: can0 - -# Communication interface Tx ID -# Description: Currently applicable only for CAN interface (Tx ID) -# Possible values: -# - 0 to 255 -# Note: The ID that would work will be the one set at the TMC's GP: 71 -comm_tx_id: 1 - -# Communication interface Rx ID -# Description: Currently applicable only for CAN interface (Rx ID) -# Possible values: -# - 0 to 255 -# Note: The ID that would work will be the one set at the TMC's GP: 70 -comm_rx_id: 2 - -# Communication timeout rate in seconds -# Description: Indicates how long should the node will wait for the rx data -# Possible values: -# - value in millisecs 0 - 5000 -comm_timeout_ms: 100 - -# Communication timeout tries -# Description: Indicates how many the node will retry sending data before shutting down if no data received -# Possible values: -# - 1 - 3 -comm_exec_cmd_retries: 1 - -########## Additional Settings - -# Adhoc Mode -# Description: This mode expects that the used module is not known. The velocity, position and torque relies on the additional ratios -adhoc_mode: false - -# Active motors or axes -# Description: Enables/disables active motors or axes. If disabled, settings for those motors will be ignored or not set. -# Possible values: -# - 0: Not used -# - 1: Active -en_motors: [1,1,1,1,1,1] - -# Publish rate of TMC information -# Decription: Publish rate (hertz) of TMC information -# Possible values: 10 - 100 -pub_rate_tmc_info: 10 - -# Auto start mode additional delay -# Decription: Added delay if auto start mode is enabled. You can add delay if your TMCL program needs to run over 2 seconds. -# Possible values: 0 - 10 (secs) -auto_start_additional_delay: 0 - -########################################################## -########################################################## -# Configurations below are divided on each motor/axis. If the module used have more motors than listed below, -# copy and paste all the configuration per motor, configure the needed topic names, wheel diameter values and -# generic ratios, and rename the motor name (should follow motor naming below - motor0, motor1, ..., motorn) -# otherwise, the node will fail. - -motor0: - en_pub_tmc_info: true - pub_actual_vel: true - pub_actual_pos: true - pub_actual_trq: true - tmc_info_topic: "/tmc_info_0" - tmc_cmd_vel_topic: "/cmd_vel_0" - tmc_cmd_abspos_topic: "/cmd_abspos_0" - tmc_cmd_relpos_topic: "/cmd_relpos_0" - tmc_cmd_trq_topic: "/cmd_trq_0" - - wheel_diameter: 0.25 - additional_ratio_vel: 1 - additional_ratio_pos: 1 - additional_ratio_trq: 1 - -motor1: - en_pub_tmc_info: true - pub_actual_vel: true - pub_actual_pos: true - pub_actual_trq: true - tmc_info_topic: "/tmc_info_1" - tmc_cmd_vel_topic: "/cmd_vel_1" - tmc_cmd_abspos_topic: "/cmd_abspos_1" - tmc_cmd_relpos_topic: "/cmd_relpos_1" - tmc_cmd_trq_topic: "/cmd_trq_1" - - wheel_diameter: 0.25 - additional_ratio_vel: 1 - additional_ratio_pos: 1 - additional_ratio_trq: 1 - -motor2: - en_pub_tmc_info: true - pub_actual_vel: true - pub_actual_pos: true - pub_actual_trq: true - tmc_info_topic: "/tmc_info_2" - tmc_cmd_vel_topic: "/cmd_vel_2" - tmc_cmd_abspos_topic: "/cmd_abspos_2" - tmc_cmd_relpos_topic: "/cmd_relpos_2" - tmc_cmd_trq_topic: "/cmd_trq_2" - - wheel_diameter: 0.25 - additional_ratio_vel: 1 - additional_ratio_pos: 1 - additional_ratio_trq: 1 - -motor3: - en_pub_tmc_info: true - pub_actual_vel: true - pub_actual_pos: true - pub_actual_trq: true - tmc_info_topic: "/tmc_info_3" - tmc_cmd_vel_topic: "/cmd_vel_3" - tmc_cmd_abspos_topic: "/cmd_abspos_3" - tmc_cmd_relpos_topic: "/cmd_relpos_3" - tmc_cmd_trq_topic: "/cmd_trq_3" - - wheel_diameter: 0.25 - additional_ratio_vel: 1 - additional_ratio_pos: 1 - additional_ratio_trq: 1 - -motor4: - en_pub_tmc_info: true - pub_actual_vel: true - pub_actual_pos: true - pub_actual_trq: true - tmc_info_topic: "/tmc_info_4" - tmc_cmd_vel_topic: "/cmd_vel_4" - tmc_cmd_abspos_topic: "/cmd_abspos_4" - tmc_cmd_relpos_topic: "/cmd_relpos_4" - tmc_cmd_trq_topic: "/cmd_trq_4" - - wheel_diameter: 0.25 - additional_ratio_vel: 1 - additional_ratio_pos: 1 - additional_ratio_trq: 1 - -motor5: - en_pub_tmc_info: true - pub_actual_vel: true - pub_actual_pos: true - pub_actual_trq: true - tmc_info_topic: "/tmc_info_5" - tmc_cmd_vel_topic: "/cmd_vel_5" - tmc_cmd_abspos_topic: "/cmd_abspos_5" - tmc_cmd_relpos_topic: "/cmd_relpos_5" - tmc_cmd_trq_topic: "/cmd_trq_5" - - wheel_diameter: 0.25 - additional_ratio_vel: 1 - additional_ratio_pos: 1 - additional_ratio_trq: 1 diff --git a/config/autogenerated/TMCM-0010.yaml b/config/autogenerated/TMCM-0010.yaml deleted file mode 100644 index 1524ac0..0000000 --- a/config/autogenerated/TMCM-0010.yaml +++ /dev/null @@ -1,30 +0,0 @@ -#================================================================================= -# Auto-generated YAML configurations for TMCM-0010-OPC -#================================================================================= - -# Note that it is assumed that the AP configurations don't differ between all motors/axes. -# This means only configurations for Axis0 are placed into this YAML. - -# Available Axis Parameters -AP_name: [SupplyVoltage, - BrakeChopperEnabled, - BrakeChopperVoltage, - BrakeChopperHysteresis, - BrakeChopperLowerVoltage, - BrakeChopperActive, - MainLoopsPerSecond, - UsbLoopsPerSecond] - -AP_type: [0, - 1, - 2, - 3, - 4, - 5, - 200, - 201] - -# Available Global Parameters -GP_name: [] - -GP_type: [] diff --git a/config/autogenerated/TMCM-0960.yaml b/config/autogenerated/TMCM-0960.yaml deleted file mode 100644 index e5ccbe4..0000000 --- a/config/autogenerated/TMCM-0960.yaml +++ /dev/null @@ -1,54 +0,0 @@ -#================================================================================= -# Auto-generated YAML configurations for TMCM-0960-MotionPy -#================================================================================= - -# Note that it is assumed that the AP configurations don't differ between all motors/axes. -# This means only configurations for Axis0 are placed into this YAML. - -# Available Axis Parameters -AP_name: [linear_homing_margin, - linear_homing_hyst, - linear_homing_status, - linear_bound_low_step, - linear_bound_low_actual, - linear_bound_high_step, - linear_bound_high_actual, - linear_position_step, - linear_position_absolute, - linear_position_relative, - linear_position_step_actual, - linear_position_absolute_actual, - linear_position_relative_actual, - linear_velocity_actual, - linear_velocity_position, - linear_velocity_homing, - linear_acceleration_position, - linear_acceleration_homing, - linear_length] - -AP_type: [0, - 1, - 2, - 3, - 4, - 5, - 6, - 7, - 8, - 9, - 10, - 11, - 12, - 13, - 14, - 15, - 16, - 17, - 18] - -# Available Global Parameters -GP_name: [controlHost, - controlModule] - -GP_type: [0, - 1] diff --git a/config/autogenerated/TMCM-1021.yaml b/config/autogenerated/TMCM-1021.yaml deleted file mode 100644 index 1b64336..0000000 --- a/config/autogenerated/TMCM-1021.yaml +++ /dev/null @@ -1,176 +0,0 @@ -#================================================================================= -# Auto-generated YAML configurations for TMCM-1021 -#================================================================================= - -# Note that it is assumed that the AP configurations don't differ between all motors/axes. -# This means only configurations for Axis0 are placed into this YAML. - -# Available Axis Parameters -AP_name: [TargetPosition, - ActualPosition, - TargetVelocity, - ActualVelocity, - MaxVelocity, - MaxAcceleration, - MaxCurrent, - StandbyCurrent, - PositionReachedFlag, - reference switch status, - RightEndstop, - LeftEndstop, - right limit switch disable, - left limit switch disable, - ramp mode, - StartStopVelocity, - MicrostepResolution, - Intpol, - DoubleEdgeSteps, - ChopperBlankTime, - ConstantTOffMode, - DisableFastDecayComparator, - ChopperHysteresisEnd, - ChopperHysteresisStart, - TOff, - SEIMIN, - SECDS, - smartEnergyHysteresis, - SECUS, - smartEnergyHysteresisStart, - SG2FilterEnable, - SG2Threshold, - slope control high side, - slope control low side, - ShortToGroundProtection, - ShortDetectionTime, - VSense, - smartEnergyActualCurrent, - smartEnergyStallVelocity, - smartEnergyThresholdSpeed, - smartEnergySlowRunCurrent, - RandomTOffMode, - ReferenceSearchMode, - ReferenceSearchSpeed, - reference switch speed, - reference switch distance, - last reference switch position, - BoostCurrent, - freewheeling delay, - LoadValue, - extended error flags, - DrvStatusFlags, - EncoderPosition, - encoder prescaler, - max. encoder deviation, - PowerDownDelay, - absolute resolver value, - step/direction mode] - -AP_type: [0, - 1, - 2, - 3, - 4, - 5, - 6, - 7, - 8, - 9, - 10, - 11, - 12, - 13, - 128, - 130, - 140, - 160, - 161, - 162, - 163, - 164, - 165, - 166, - 167, - 168, - 169, - 170, - 171, - 172, - 173, - 174, - 175, - 176, - 177, - 178, - 179, - 180, - 181, - 182, - 183, - 184, - 193, - 194, - 195, - 196, - 197, - 200, - 204, - 206, - 207, - 208, - 209, - 210, - 212, - 214, - 215, - 254] - -# Available Global Parameters -GP_name: [serial baud rate, - serial address, - ASCII mode, - serial heartbeat, - CAN bitrate, - CAN send id, - CAN receive id, - telegram pause time, - serial host address, - auto start mode, - limit switch polarity, - protection mode, - CAN heartbeat, - CAN secondary address, - eeprom coordinate store, - zero user variables, - serial secondary address, - reverse shaft, - application status, - download mode, - program counter, - last tmcl error, - tick timer, - random number] - -GP_type: [65, - 66, - 67, - 68, - 69, - 70, - 71, - 75, - 76, - 77, - 79, - 81, - 82, - 83, - 84, - 85, - 87, - 90, - 128, - 129, - 130, - 131, - 132, - 133] diff --git a/config/autogenerated/TMCM-1070.yaml b/config/autogenerated/TMCM-1070.yaml deleted file mode 100644 index 9434945..0000000 --- a/config/autogenerated/TMCM-1070.yaml +++ /dev/null @@ -1,60 +0,0 @@ -#================================================================================= -# Auto-generated YAML configurations for TMCM-1070 -#================================================================================= - -# Note that it is assumed that the AP configurations don't differ between all motors/axes. -# This means only configurations for Axis0 are placed into this YAML. - -# Available Axis Parameters -AP_name: [MaxCurrent, - StandbyCurrent, - IHOLDDELAY, - TCOOLTHRS, - TStep, - TPWMTHRS, - PWMConf, - COOLConf, - CHOPConf, - uStepResolution, - Intpol, - DoubleEdgeSteps, - SEIMIN, - SECDS, - smartEnergyHysteresis, - SECUS, - smartEnergyHysteresisStart, - SG2FilterEnable, - SG2Threshold, - VSense, - smartEnergyActualCurrent, - smartEnergyThresholdSpeed, - LoadValue] - -AP_type: [6, - 7, - 9, - 22, - 135, - 136, - 137, - 138, - 139, - 140, - 141, - 142, - 168, - 169, - 170, - 171, - 172, - 173, - 174, - 179, - 180, - 182, - 206] - -# Available Global Parameters -GP_name: [tick timer] - -GP_type: [132] diff --git a/config/autogenerated/TMCM-1076.yaml b/config/autogenerated/TMCM-1076.yaml deleted file mode 100644 index 478a947..0000000 --- a/config/autogenerated/TMCM-1076.yaml +++ /dev/null @@ -1,58 +0,0 @@ -#================================================================================= -# Auto-generated YAML configurations for TMCM-1076 -#================================================================================= - -# Note that it is assumed that the AP configurations don't differ between all motors/axes. -# This means only configurations for Axis0 are placed into this YAML. - -# Available Axis Parameters -AP_name: [MaxCurrent, - StandbyCurrent, - IHOLDDELAY, - TCOOLTHRS, - TStep, - TPWMTHRS, - PWMConf, - COOLConf, - CHOPConf, - uStepResolution, - Intpol, - DoubleEdgeSteps, - SEIMIN, - SECDS, - smartEnergyHysteresis, - SECUS, - smartEnergyHysteresisStart, - SG2FilterEnable, - SG2Threshold, - smartEnergyActualCurrent, - smartEnergyThresholdSpeed, - LoadValue] - -AP_type: [6, - 7, - 9, - 22, - 135, - 136, - 137, - 138, - 139, - 140, - 141, - 142, - 168, - 169, - 170, - 171, - 172, - 173, - 174, - 180, - 182, - 206] - -# Available Global Parameters -GP_name: [tick timer] - -GP_type: [132] diff --git a/config/autogenerated/TMCM-1110.yaml b/config/autogenerated/TMCM-1110.yaml deleted file mode 100644 index 07320cd..0000000 --- a/config/autogenerated/TMCM-1110.yaml +++ /dev/null @@ -1,182 +0,0 @@ -#================================================================================= -# Auto-generated YAML configurations for TMCM-1110 -#================================================================================= - -# Note that it is assumed that the AP configurations don't differ between all motors/axes. -# This means only configurations for Axis0 are placed into this YAML. - -# Available Axis Parameters -AP_name: [TargetPosition, - ActualPosition, - TargetVelocity, - ActualVelocity, - MaxVelocity, - MaxAcceleration, - MaxCurrent, - StandbyCurrent, - PositionReachedFlag, - reference switch status, - RightEndstop, - LeftEndstop, - right limit switch disable, - left limit switch disable, - minimum speed, - actual acceleration, - ramp mode, - MicrostepResolution, - ref. switch tolerance, - soft stop flag, - ramp divisor, - PulseDivisor, - Intpol, - DoubleEdgeSteps, - ChopperBlankTime, - ConstantTOffMode, - DisableFastDecayComparator, - ChopperHysteresisEnd, - ChopperHysteresisStart, - TOff, - SEIMIN, - SECDS, - smartEnergyHysteresis, - SECUS, - smartEnergyHysteresisStart, - SG2FilterEnable, - SG2Threshold, - slope control high side, - slope control low side, - ShortToGroundProtection, - ShortDetectionTime, - VSense, - smartEnergyActualCurrent, - smartEnergyStallVelocity, - smartEnergyThresholdSpeed, - smartEnergySlowRunCurrent, - RandomTOffMode, - ReferenceSearchMode, - ReferenceSearchSpeed, - reference switch speed, - reference switch distance, - freewheeling delay, - LoadValue, - DrvStatusFlags, - EncoderPosition, - encoder prescaler, - max. encoder deviation, - group index, - PowerDownDelay, - step/direction mode] - -AP_type: [0, - 1, - 2, - 3, - 4, - 5, - 6, - 7, - 8, - 9, - 10, - 11, - 12, - 13, - 130, - 135, - 138, - 140, - 141, - 149, - 153, - 154, - 160, - 161, - 162, - 163, - 164, - 165, - 166, - 167, - 168, - 169, - 170, - 171, - 172, - 173, - 174, - 175, - 176, - 177, - 178, - 179, - 180, - 181, - 182, - 183, - 184, - 193, - 194, - 195, - 196, - 204, - 206, - 208, - 209, - 210, - 212, - 213, - 214, - 254] - -# Available Global Parameters -GP_name: [serial baud rate, - serial address, - ASCII mode, - serial heartbeat, - CAN bitrate, - CAN send id, - CAN receive id, - telegram pause time, - serial host address, - auto start mode, - i/o mask, - limit switch polarity, - protection mode, - CAN heartbeat, - CAN secondary address, - eeprom coordinate store, - zero user variables, - step pulse length, - serial secondary address, - application status, - download mode, - program counter, - last tmcl error, - tick timer, - random number] - -GP_type: [65, - 66, - 67, - 68, - 69, - 70, - 71, - 75, - 76, - 77, - 78, - 79, - 81, - 82, - 83, - 84, - 85, - 86, - 87, - 128, - 129, - 130, - 131, - 132, - 133] diff --git a/config/autogenerated/TMCM-1111.yaml b/config/autogenerated/TMCM-1111.yaml deleted file mode 100644 index 35c824f..0000000 --- a/config/autogenerated/TMCM-1111.yaml +++ /dev/null @@ -1,268 +0,0 @@ -#================================================================================= -# Auto-generated YAML configurations for TMCM-1111 -#================================================================================= - -# Note that it is assumed that the AP configurations don't differ between all motors/axes. -# This means only configurations for Axis0 are placed into this YAML. - -# Available Axis Parameters -AP_name: [TargetPosition, - ActualPosition, - TargetVelocity, - ActualVelocity, - MaxVelocity, - MaxAcceleration, - MaxCurrent, - StandbyCurrent, - PositionReachedFlag, - HomeSwitch, - RightEndstop, - LeftEndstop, - right limit switch enable/polarity, - left limit switch enable/polarity, - RampType, - StartVelocity, - StartAcceleration, - MaxDeceleration, - break velocity, - final deceleration, - StopVelocity, - stop deceleration, - BOW1, - BOW2, - BOW3, - BOW4, - virtual stop left, - virtual stop right, - virtual stop enable, - virtual stop mode, - swap limit switches, - limit switch soft stop, - BOW_SCALER, - torque, - CLGammaVMin, - CLGammaVMax, - CLMaxGamma, - CLBeta, - CLOffset, - CLCurrentMin, - CLCurrentMax, - CLCorrectionVelocityP, - CLCorrectionVelocityI, - CLCorrectionVelIClip, - CLCorrectionVelDVClock, - CLCorrectionVelDVClip, - CLUpscaleDelay, - CLDownscaleDelay, - ActualScalerValue, - CLCorrectionPositionP, - CLMaxCorrectionTolerance, - CLStartUp, - relative positioning option, - closed loop, - MeasuredSpeed, - current measured speed, - CLInitFlag, - EncoderDeviation, - enc_vmean_wait, - enc_vmean_filter, - enc_vmean_int, - MicrostepResolution, - enc_freq, - enc_filter_length, - ChopperBlankTime, - ConstantTOffMode, - ChopperHysteresisDecrement, - ChopperHysteresisEnd, - ChopperHysteresisStart, - TOff, - SEIMIN, - SECDS, - smartEnergyHysteresis, - SECUS, - smartEnergyHysteresisStart, - SG2FilterEnable, - SG2Threshold, - slope control high side, - slope control high side, - ShortToGroundProtection, - ShortDetectionTime, - VSense, - smartEnergyActualCurrent, - smartEnergyStallVelocity, - smartEnergyThresholdSpeed, - smartEnergySlowRunCurrent, - RandomTOffMode, - ReferenceSearchMode, - ReferenceSearchSpeed, - reference switch speed, - reference switch distance, - last reference switch position, - BoostCurrent, - encoder mode, - fullstep resolution, - LoadValue, - extended error flags, - driver error flags, - EncoderPosition, - encoder resolution, - max. position encoder deviation, - max. velocity encoder deviation, - setting delay, - reverse shaft, - step/direction gear ratio, - step/direction mode] - -AP_type: [0, - 1, - 2, - 3, - 4, - 5, - 6, - 7, - 8, - 9, - 10, - 11, - 12, - 13, - 14, - 15, - 16, - 17, - 18, - 19, - 20, - 21, - 22, - 23, - 24, - 25, - 26, - 27, - 28, - 29, - 33, - 34, - 35, - 50, - 108, - 109, - 110, - 111, - 112, - 113, - 114, - 115, - 116, - 117, - 118, - 119, - 120, - 121, - 123, - 124, - 125, - 126, - 127, - 129, - 131, - 132, - 133, - 134, - 136, - 137, - 138, - 140, - 150, - 151, - 162, - 163, - 164, - 165, - 166, - 167, - 168, - 169, - 170, - 171, - 172, - 173, - 174, - 175, - 176, - 177, - 178, - 179, - 180, - 181, - 182, - 183, - 184, - 193, - 194, - 195, - 196, - 197, - 200, - 201, - 202, - 206, - 207, - 208, - 209, - 210, - 212, - 213, - 214, - 251, - 253, - 254] - -# Available Global Parameters -GP_name: [serial baud rate, - serial address, - serial heartbeat, - CAN bitrate, - CAN send id, - CAN receive id, - CAN receive id, - serial host address, - auto start mode, - i/o mask, - protection mode, - CAN heartbeat, - CAN secondary address, - store coordinates in EEPROM, - do not restore user variables, - serial secondary address, - application status, - download mode, - program counter, - last tmcl error, - tick timer, - random number] - -GP_type: [65, - 66, - 68, - 69, - 70, - 71, - 75, - 76, - 77, - 78, - 81, - 82, - 83, - 84, - 85, - 87, - 128, - 129, - 130, - 131, - 132, - 133] diff --git a/config/autogenerated/TMCM-1141.yaml b/config/autogenerated/TMCM-1141.yaml deleted file mode 100644 index 7f14c95..0000000 --- a/config/autogenerated/TMCM-1141.yaml +++ /dev/null @@ -1,170 +0,0 @@ -#================================================================================= -# Auto-generated YAML configurations for TMCM-1141 -#================================================================================= - -# Note that it is assumed that the AP configurations don't differ between all motors/axes. -# This means only configurations for Axis0 are placed into this YAML. - -# Available Axis Parameters -AP_name: [TargetPosition, - ActualPosition, - TargetVelocity, - ActualVelocity, - MaxVelocity, - MaxAcceleration, - MaxCurrent, - StandbyCurrent, - PositionReachedFlag, - reference switch status, - RightEndstop, - LeftEndstop, - right limit switch disable, - left limit switch disable, - minimum speed, - actual acceleration, - ramp mode, - MicrostepResolution, - ref. switch tolerance, - soft stop flag, - EndSwitchPowerDown, - ramp divisor, - PulseDivisor, - Intpol, - DoubleEdgeSteps, - ChopperBlankTime, - ConstantTOffMode, - DisableFastDecayComparator, - ChopperHysteresisEnd, - ChopperHysteresisStart, - TOff, - SEIMIN, - SECDS, - smartEnergyHysteresis, - SECUS, - smartEnergyHysteresisStart, - SG2FilterEnable, - SG2Threshold, - slope control high side, - slope control low side, - ShortToGroundProtection, - ShortDetectionTime, - VSense, - smartEnergyActualCurrent, - smartEnergyStallVelocity, - smartEnergyThresholdSpeed, - smartEnergySlowRunCurrent, - RandomTOffMode, - ReferenceSearchMode, - ReferenceSearchSpeed, - reference switch speed, - reference switch distance, - last reference switch position, - BoostCurrent, - freewheeling delay, - LoadValue, - extended error flags, - DrvStatusFlags, - PowerDownDelay, - step/direction mode] - -AP_type: [0, - 1, - 2, - 3, - 4, - 5, - 6, - 7, - 8, - 9, - 10, - 11, - 12, - 13, - 130, - 135, - 138, - 140, - 141, - 149, - 150, - 153, - 154, - 160, - 161, - 162, - 163, - 164, - 165, - 166, - 167, - 168, - 169, - 170, - 171, - 172, - 173, - 174, - 175, - 176, - 177, - 178, - 179, - 180, - 181, - 182, - 183, - 184, - 193, - 194, - 195, - 196, - 197, - 200, - 204, - 206, - 207, - 208, - 214, - 254] - -# Available Global Parameters -GP_name: [serial baud rate, - serial address, - ASCII mode, - serial heartbeat, - telegram pause time, - serial host address, - auto start mode, - limit switch polarity, - protection mode, - eeprom coordinate store, - zero user variables, - serial secondary address, - reverse shaft direction, - application status, - download mode, - program counter, - last tmcl error, - tick timer, - random number] - -GP_type: [65, - 66, - 67, - 68, - 75, - 76, - 77, - 79, - 81, - 84, - 85, - 87, - 90, - 128, - 129, - 130, - 131, - 132, - 133] diff --git a/config/autogenerated/TMCM-1161.yaml b/config/autogenerated/TMCM-1161.yaml deleted file mode 100644 index c5e9e7f..0000000 --- a/config/autogenerated/TMCM-1161.yaml +++ /dev/null @@ -1,180 +0,0 @@ -#================================================================================= -# Auto-generated YAML configurations for TMCM-1161 -#================================================================================= - -# Note that it is assumed that the AP configurations don't differ between all motors/axes. -# This means only configurations for Axis0 are placed into this YAML. - -# Available Axis Parameters -AP_name: [TargetPosition, - ActualPosition, - TargetVelocity, - ActualVelocity, - MaxVelocity, - MaxAcceleration, - MaxCurrent, - StandbyCurrent, - PositionReachedFlag, - reference switch status, - RightEndstop, - LeftEndstop, - right limit switch disable, - left limit switch disable, - minimum speed, - actual acceleration, - ramp mode, - MicrostepResolution, - ref. switch tolerance, - soft stop flag, - EndSwitchPowerDown, - ramp divisor, - PulseDivisor, - Intpol, - DoubleEdgeSteps, - ChopperBlankTime, - ConstantTOffMode, - DisableFastDecayComparator, - ChopperHysteresisEnd, - ChopperHysteresisStart, - TOff, - SEIMIN, - SECDS, - smartEnergyHysteresis, - SECUS, - smartEnergyHysteresisStart, - SG2FilterEnable, - SG2Threshold, - slope control high side, - slope control low side, - ShortToGroundProtection, - ShortDetectionTime, - VSense, - smartEnergyActualCurrent, - smartEnergyStallVelocity, - smartEnergyThresholdSpeed, - smartEnergySlowRunCurrent, - RandomTOffMode, - ReferenceSearchMode, - ReferenceSearchSpeed, - reference switch speed, - reference switch distance, - last reference switch position, - BoostCurrent, - freewheeling delay, - LoadValue, - extended error flags, - DrvStatusFlags, - EncoderPosition, - EncoderResolution, - max. encoder deviation, - PowerDownDelay, - absolute resolver value, - step/direction mode] - -AP_type: [0, - 1, - 2, - 3, - 4, - 5, - 6, - 7, - 8, - 9, - 10, - 11, - 12, - 13, - 130, - 135, - 138, - 140, - 141, - 149, - 150, - 153, - 154, - 160, - 161, - 162, - 163, - 164, - 165, - 166, - 167, - 168, - 169, - 170, - 171, - 172, - 173, - 174, - 175, - 176, - 177, - 178, - 179, - 180, - 181, - 182, - 183, - 184, - 193, - 194, - 195, - 196, - 197, - 200, - 204, - 206, - 207, - 208, - 209, - 210, - 212, - 214, - 215, - 254] - -# Available Global Parameters -GP_name: [serial baud rate, - serial address, - ASCII mode, - serial heartbeat, - telegram pause time, - serial host address, - auto start mode, - limit switch polarity, - protection mode, - eeprom coordinate store, - zero user variables, - serial secondary address, - reverse shaft direction, - application status, - download mode, - program counter, - last tmcl error, - tick timer, - random number, - Intpol] - -GP_type: [65, - 66, - 67, - 68, - 75, - 76, - 77, - 79, - 81, - 84, - 85, - 87, - 90, - 128, - 129, - 130, - 131, - 132, - 133, - 255] diff --git a/config/autogenerated/TMCM-1181.yaml b/config/autogenerated/TMCM-1181.yaml deleted file mode 100644 index f59011f..0000000 --- a/config/autogenerated/TMCM-1181.yaml +++ /dev/null @@ -1,176 +0,0 @@ -#================================================================================= -# Auto-generated YAML configurations for TMCM-1181 -#================================================================================= - -# Note that it is assumed that the AP configurations don't differ between all motors/axes. -# This means only configurations for Axis0 are placed into this YAML. - -# Available Axis Parameters -AP_name: [TargetPosition, - ActualPosition, - TargetVelocity, - ActualVelocity, - MaxVelocity, - MaxAcceleration, - MaxCurrent, - StandbyCurrent, - PositionReachedFlag, - reference switch status, - RightEndstop, - LeftEndstop, - right limit switch disable, - left limit switch disable, - minimum speed, - actual acceleration, - ramp mode, - MicrostepResolution, - ref. switch tolerance, - soft stop flag, - EndSwitchPowerDown, - ramp divisor, - PulseDivisor, - Intpol, - DoubleEdgeSteps, - ChopperBlankTime, - ConstantTOffMode, - DisableFastDecayComparator, - ChopperHysteresisEnd, - ChopperHysteresisStart, - TOff, - SEIMIN, - SECDS, - smartEnergyHysteresis, - SECUS, - smartEnergyHysteresisStart, - SG2FilterEnable, - SG2Threshold, - slope control high side, - slope control low side, - ShortToGroundProtection, - ShortDetectionTime, - VSense, - smartEnergyActualCurrent, - smartEnergyStallVelocity, - smartEnergyThresholdSpeed, - smartEnergySlowRunCurrent, - RandomTOffMode, - ReferenceSearchMode, - ReferenceSearchSpeed, - reference switch speed, - reference switch distance, - last reference switch position, - BoostCurrent, - freewheeling delay, - LoadValue, - extended error flags, - DrvStatusFlags, - EncoderPosition, - encoder prescaler, - max. encoder deviation, - PowerDownDelay, - absolute resolver value, - step/direction mode] - -AP_type: [0, - 1, - 2, - 3, - 4, - 5, - 6, - 7, - 8, - 9, - 10, - 11, - 12, - 13, - 130, - 135, - 138, - 140, - 141, - 149, - 150, - 153, - 154, - 160, - 161, - 162, - 163, - 164, - 165, - 166, - 167, - 168, - 169, - 170, - 171, - 172, - 173, - 174, - 175, - 176, - 177, - 178, - 179, - 180, - 181, - 182, - 183, - 184, - 193, - 194, - 195, - 196, - 197, - 200, - 204, - 206, - 207, - 208, - 209, - 210, - 212, - 214, - 215, - 254] - -# Available Global Parameters -GP_name: [serial baud rate, - serial address, - ASCII mode, - serial heartbeat, - telegram pause time, - serial host address, - auto start mode, - protection mode, - eeprom coordinate store, - zero user variables, - serial secondary address, - reverse shaft direction, - application status, - download mode, - program counter, - last tmcl error, - tick timer, - random number] - -GP_type: [65, - 66, - 67, - 68, - 75, - 76, - 77, - 81, - 84, - 85, - 87, - 90, - 128, - 129, - 130, - 131, - 132, - 133] diff --git a/config/autogenerated/TMCM-1210.yaml b/config/autogenerated/TMCM-1210.yaml deleted file mode 100644 index c9f3118..0000000 --- a/config/autogenerated/TMCM-1210.yaml +++ /dev/null @@ -1,186 +0,0 @@ -#================================================================================= -# Auto-generated YAML configurations for TMCM-1210 -#================================================================================= - -# Note that it is assumed that the AP configurations don't differ between all motors/axes. -# This means only configurations for Axis0 are placed into this YAML. - -# Available Axis Parameters -AP_name: [TargetPosition, - ActualPosition, - TargetVelocity, - ActualVelocity, - MaxVelocity, - MaxAcceleration, - MaxCurrent, - StandbyCurrent, - PositionReachedFlag, - HomeSwitch, - RightEndstop, - LeftEndstop, - right limit switch disable, - left limit switch disable, - swap limit switches, - A1, - V1, - MaxDeceleration, - D1, - StartVelocity, - StopVelocity, - RampWaitTime, - THIGH, - min. dcStep speed, - right limit switch polarity, - left limit switch polarity, - softstop, - HighSpeedChopperMode, - HighSpeedFullstepMode, - MeasuredSpeed, - PowerDownRamp, - dcStep time, - dcStep stallGuard, - relative positioning option, - MicrostepResolution, - ChopperBlankTime, - ConstantTOffMode, - DisableFastDecayComparator, - ChopperHysteresisEnd, - ChopperHysteresisStart, - TOff, - SEIMIN, - SECDS, - smartEnergyHysteresis, - SECUS, - smartEnergyHysteresisStart, - SG2FilterEnable, - SG2Threshold, - smartEnergyActualCurrent, - smartEnergyStallVelocity, - smartEnergyThresholdSpeed, - RandomTOffMode, - ChopperSynchronization, - PWMThresholdSpeed, - PWMGrad, - PWMAmplitude, - PWMScale, - PWMMode, - PWMFrequency, - PWMAutoscale, - ReferenceSearchMode, - ReferenceSearchSpeed, - reference switch speed, - reference switch distance, - last reference switch position, - FreewheelingMode, - LoadValue, - EncoderPosition, - PowerDownDelay, - absolute resolver value, - unit mode] - -AP_type: [0, - 1, - 2, - 3, - 4, - 5, - 6, - 7, - 8, - 9, - 10, - 11, - 12, - 13, - 14, - 15, - 16, - 17, - 18, - 19, - 20, - 21, - 22, - 23, - 24, - 25, - 26, - 27, - 28, - 29, - 31, - 32, - 33, - 127, - 140, - 162, - 163, - 164, - 165, - 166, - 167, - 168, - 169, - 170, - 171, - 172, - 173, - 174, - 180, - 181, - 182, - 184, - 185, - 186, - 187, - 188, - 189, - 190, - 191, - 192, - 193, - 194, - 195, - 196, - 197, - 204, - 206, - 209, - 214, - 215, - 255] - -# Available Global Parameters -GP_name: [serial baud rate, - serial address, - serial heartbeat, - telegram pause time, - serial host address, - auto start mode, - protection mode, - eeprom coordinate store, - zero user variables, - serial secondary address, - application status, - download mode, - program counter, - last tmcl error, - tick timer, - random number] - -GP_type: [65, - 66, - 68, - 75, - 76, - 77, - 81, - 84, - 85, - 87, - 128, - 129, - 130, - 131, - 132, - 133] diff --git a/config/autogenerated/TMCM-1211.yaml b/config/autogenerated/TMCM-1211.yaml deleted file mode 100644 index 2888dc3..0000000 --- a/config/autogenerated/TMCM-1211.yaml +++ /dev/null @@ -1,212 +0,0 @@ -#================================================================================= -# Auto-generated YAML configurations for TMCM-1211 -#================================================================================= - -# Note that it is assumed that the AP configurations don't differ between all motors/axes. -# This means only configurations for Axis0 are placed into this YAML. - -# Available Axis Parameters -AP_name: [TargetPosition, - ActualPosition, - TargetVelocity, - ActualVelocity, - MaxVelocity, - MaxAcceleration, - MaxCurrent, - StandbyCurrent, - PositionReachedFlag, - HomeSwitch, - RightEndstop, - LeftEndstop, - right limit switch disable, - left limit switch disable, - swap limit switches, - A1, - V1, - MaxDeceleration, - D1, - StartVelocity, - StopVelocity, - RampWaitTime, - THIGH, - VDCMIN, - right switch polarity, - left switch polarity, - softstop, - HighSpeedChopperMode, - HighSpeedFullstepMode, - MeasuredSpeed, - PowerDownRamp, - RelativePositioningOptionCode, - MicrostepResolution, - ChopperBlankTime, - ConstantTOffMode, - DisableFastDecayComparator, - ChopperHysteresisEnd, - ChopperHysteresisStart, - TOff, - SEIMIN, - SECDS, - smartEnergyHysteresis, - SECUS, - smartEnergyHysteresisStart, - SG2FilterEnable, - SG2Threshold, - ShortToGroundProtection, - VSense, - smartEnergyActualCurrent, - smartEnergyStallVelocity, - smartEnergyThresholdSpeed, - RandomTOffMode, - ChopperSynchronization, - PWMThresholdSpeed, - PWMGrad, - PWMAmplitude, - PWMScale, - pwm mode, - PWMFrequency, - PWMAutoscale, - ReferenceSearchMode, - ReferenceSearchSpeed, - RefSwitchSpeed, - RightLimitSwitchPosition, - LastReferencePosition, - encoder mode, - MotorFullStepResolution, - pwm symmetric, - FreewheelingMode, - LoadValue, - extended error flags, - DrvStatusFlags, - EncoderPosition, - EncoderResolution, - max. encoder deviation, - PowerDownDelay, - reverse shaft, - UnitMode] - -AP_type: [0, - 1, - 2, - 3, - 4, - 5, - 6, - 7, - 8, - 9, - 10, - 11, - 12, - 13, - 14, - 15, - 16, - 17, - 18, - 19, - 20, - 21, - 22, - 23, - 24, - 25, - 26, - 27, - 28, - 29, - 31, - 127, - 140, - 162, - 163, - 164, - 165, - 166, - 167, - 168, - 169, - 170, - 171, - 172, - 173, - 174, - 177, - 179, - 180, - 181, - 182, - 184, - 185, - 186, - 187, - 188, - 189, - 190, - 191, - 192, - 193, - 194, - 195, - 196, - 197, - 201, - 202, - 203, - 204, - 206, - 207, - 208, - 209, - 210, - 212, - 214, - 251, - 255] - -# Available Global Parameters -GP_name: [serial baud rate, - serial address, - serial heartbeat, - CAN bitrate, - CAN send id, - CAN receive id, - telegram pause time, - serial host address, - auto start mode, - i/o mask, - protection mode, - CAN heartbeat, - CAN secondary address, - eeprom coordinate store, - zero user variables, - serial secondary address, - application status, - download mode, - program counter, - last tmcl error, - tick timer, - random number] - -GP_type: [65, - 66, - 68, - 69, - 70, - 71, - 75, - 76, - 77, - 78, - 81, - 82, - 83, - 84, - 85, - 87, - 128, - 129, - 130, - 131, - 132, - 133] diff --git a/config/autogenerated/TMCM-1243.yaml b/config/autogenerated/TMCM-1243.yaml deleted file mode 100644 index 5038d56..0000000 --- a/config/autogenerated/TMCM-1243.yaml +++ /dev/null @@ -1,188 +0,0 @@ -#================================================================================= -# Auto-generated YAML configurations for TMCM-1243 -#================================================================================= - -# Note that it is assumed that the AP configurations don't differ between all motors/axes. -# This means only configurations for Axis0 are placed into this YAML. - -# Available Axis Parameters -AP_name: [TargetPosition, - ActualPosition, - TargetVelocity, - ActualVelocity, - MaxVelocity, - MaxAcceleration, - MaxCurrent, - StandbyCurrent, - PositionReachedFlag, - RightEndstop, - LeftEndstop, - right limit switch disable, - left limit switch disable, - swap limit switches, - A1, - V1, - MaxDeceleration, - D1, - StartVelocity, - StopVelocity, - RampWaitTime, - THIGH, - min. dcStep speed, - right limit switch polarity, - left limit switch polarity, - softstop, - HighSpeedChopperMode, - HighSpeedFullstepMode, - MeasuredSpeed, - PowerDownRamp, - dcStep time, - dcStep stallGuard, - relative positioning option, - MicrostepResolution, - Intpol, - DoubleEdgeSteps, - ChopperBlankTime, - ConstantTOffMode, - DisableFastDecayComparator, - ChopperHysteresisEnd, - ChopperHysteresisStart, - TOff, - SEIMIN, - SECDS, - smartEnergyHysteresis, - SECUS, - smartEnergyHysteresisStart, - SG2FilterEnable, - SG2Threshold, - GlobalCurrentScaler, - smartEnergyActualCurrent, - smartEnergyStallVelocity, - smartEnergyThresholdSpeed, - RandomTOffMode, - ChopperSynchronization, - PWMThresholdSpeed, - PWMGrad, - PWMAmplitude, - PWMScale, - PWMMode, - PWMFrequency, - PWMAutoscale, - fullstep resolution, - FreewheelingMode, - LoadValue, - extended error flags, - DrvStatusFlags, - EncoderPosition, - encoder cleat, - max. encoder deviation, - PowerDownDelay, - absolute resolver value, - unit mode] - -AP_type: [0, - 1, - 2, - 3, - 4, - 5, - 6, - 7, - 8, - 10, - 11, - 12, - 13, - 14, - 15, - 16, - 17, - 18, - 19, - 20, - 21, - 22, - 23, - 24, - 25, - 26, - 27, - 28, - 29, - 31, - 32, - 33, - 127, - 140, - 160, - 161, - 162, - 163, - 164, - 165, - 166, - 167, - 168, - 169, - 170, - 171, - 172, - 173, - 174, - 178, - 180, - 181, - 182, - 184, - 185, - 186, - 187, - 188, - 189, - 190, - 191, - 192, - 202, - 204, - 206, - 207, - 208, - 209, - 210, - 212, - 214, - 215, - 255] - -# Available Global Parameters -GP_name: [serial baud rate, - serial address, - telegram pause time, - serial host address, - auto start mode, - protection mode, - eeprom coordinate store, - zero user variables, - serial secondary address, - application status, - download mode, - program counter, - last tmcl error, - tick timer, - random number] - -GP_type: [65, - 66, - 75, - 76, - 77, - 81, - 84, - 85, - 87, - 128, - 129, - 130, - 131, - 132, - 133] diff --git a/config/autogenerated/TMCM-1310.yaml b/config/autogenerated/TMCM-1310.yaml deleted file mode 100644 index 294df51..0000000 --- a/config/autogenerated/TMCM-1310.yaml +++ /dev/null @@ -1,280 +0,0 @@ -#================================================================================= -# Auto-generated YAML configurations for TMCM-1310 -#================================================================================= - -# Note that it is assumed that the AP configurations don't differ between all motors/axes. -# This means only configurations for Axis0 are placed into this YAML. - -# Available Axis Parameters -AP_name: [TargetPosition, - ActualPosition, - TargetVelocity, - ActualVelocity, - MaxVelocity, - MaxAcceleration, - MaxCurrent, - StandbyCurrent, - PositionReachedFlag, - reference switch status, - RightEndstop, - LeftEndstop, - right limit switch disable, - left limit switch disable, - TargetTorque, - CL max torque mode current, - CL velocity reached flag, - CL velocity window, - status word, - ActualTorque, - CL torque mode slope, - thermal winding time constant, - IIt limit, - IIt sum, - exceed counter, - clear IIt exceed flag, - CLGammaVMin, - CLGammaVMax, - CLMaxGamma, - CLBeta, - CLOffset, - CL scaler minimum, - CL scaler maximum, - CL scaler input select, - CL scaler limit 1, - CL scaler limit 2, - CL scaler increment, - CL scaler decrement, - CL scaler inc. timeout, - CL scaler dec. timeout, - CL current scaler on, - ActualScalerValue, - correction velocity P, - CLMaxCorrectionTolerance, - max. correction speed, - relative positioning option, - ramp mode, - closed loop, - minimum speed, - MeasuredSpeed, - CL encoder detection, - CLInitFlag, - CL position window, - CL position window time, - CL stand still P, - CL stand still D, - CL stand still error limit, - MicrostepResolution, - ref. switch tolerance, - CL actual motor current, - CL current phase A, - CL current phase B, - CL actual supply voltage, - CL actual supply current, - CL module temperature, - CL highest possible motor current, - ChopperBlankTime, - ConstantTOffMode, - DisableFastDecayComparator, - ChopperHysteresisEnd, - ChopperHysteresisStart, - TOff, - SEIMIN, - SECDS, - smartEnergyHysteresis, - SECUS, - smartEnergyHysteresisStart, - SG2FilterEnable, - SG2Threshold, - slope control high side, - slope control low side, - ShortToGroundProtection, - ShortDetectionTime, - VSense, - smartEnergyActualCurrent, - smartEnergyStallVelocity, - smartEnergyThresholdSpeed, - smartEnergySlowRunCurrent, - RandomTOffMode, - ReferenceSearchMode, - ReferenceSearchSpeed, - reference switch speed, - reference switch distance, - ClearOnNull, - BoostCurrent, - encoder mode, - motor fullsteps, - freewheeling delay, - LoadValue, - extended error flags, - DrvStatusFlags, - EncoderPosition, - encoder prescaler, - max. encoder deviation, - PowerDownDelay, - absolute resolver value, - DebugValue0, - DebugValue1, - DebugValue2, - DebugValue3, - DebugValue4, - DebugValue5, - DebugValue6, - DebugValue7, - DebugValue8, - DebugValue9, - actual gamma, - virtual actual position, - CL acutal target current scale factor, - position error, - RampTargetVelocity] - -AP_type: [0, - 1, - 2, - 3, - 4, - 5, - 6, - 7, - 8, - 9, - 10, - 11, - 12, - 13, - 14, - 15, - 16, - 17, - 18, - 19, - 20, - 25, - 26, - 27, - 28, - 29, - 108, - 109, - 110, - 111, - 112, - 113, - 114, - 115, - 116, - 117, - 118, - 119, - 120, - 121, - 122, - 123, - 124, - 125, - 126, - 127, - 128, - 129, - 130, - 131, - 132, - 133, - 134, - 135, - 136, - 137, - 138, - 140, - 141, - 150, - 151, - 152, - 153, - 154, - 155, - 156, - 162, - 163, - 164, - 165, - 166, - 167, - 168, - 169, - 170, - 171, - 172, - 173, - 174, - 175, - 176, - 177, - 178, - 179, - 180, - 181, - 182, - 183, - 184, - 193, - 194, - 195, - 196, - 198, - 200, - 201, - 202, - 204, - 206, - 207, - 208, - 209, - 210, - 212, - 214, - 215, - 220, - 221, - 222, - 223, - 224, - 225, - 226, - 227, - 228, - 229, - 230, - 233, - 236, - 237, - 250] - -# Available Global Parameters -GP_name: [ASCII mode, - serial heartbeat, - auto start mode, - limit switch polarity, - protection mode, - eeprom coordinate store, - zero user variables, - application status, - download mode, - program counter, - last tmcl error, - tick timer, - random number] - -GP_type: [67, - 68, - 77, - 79, - 81, - 84, - 85, - 128, - 129, - 130, - 131, - 132, - 133] diff --git a/config/autogenerated/TMCM-1316.yaml b/config/autogenerated/TMCM-1316.yaml deleted file mode 100644 index c69d12a..0000000 --- a/config/autogenerated/TMCM-1316.yaml +++ /dev/null @@ -1,274 +0,0 @@ -#================================================================================= -# Auto-generated YAML configurations for TMCM-1316 -#================================================================================= - -# Note that it is assumed that the AP configurations don't differ between all motors/axes. -# This means only configurations for Axis0 are placed into this YAML. - -# Available Axis Parameters -AP_name: [TargetPosition, - ActualPosition, - TargetVelocity, - ActualVelocity, - MaxVelocity, - MaxAcceleration, - MaxCurrent, - StandbyCurrent, - PositionReachedFlag, - HomeSwitch, - RightEndstop, - LeftEndstop, - right limit switch enable/polarity, - left limit switch enable/polarity, - RampType, - StartVelocity, - StartAcceleration, - MaxDeceleration, - break velocity, - final deceleration, - StopVelocity, - stop deceleration, - BOW1, - BOW2, - BOW3, - BOW4, - virtual stop left, - virtual stop right, - virtual stop enable, - virtual stop mode, - swap limit switches, - limit switch soft stop, - BOW_SCALER, - torque, - CLGammaVMin, - CLGammaVMax, - CLMaxGamma, - CLBeta, - CLOffset, - CLCurrentMin, - CLCurrentMax, - CLCorrectionVelocityP, - CLCorrectionVelocityI, - CLCorrectionVelIClip, - CLCorrectionVelDVClock, - CLCorrectionVelDVClip, - CLUpscaleDelay, - CLDownscaleDelay, - ActualScalerValue, - CLCorrectionPositionP, - CLMaxCorrectionTolerance, - CLStartUp, - relative positioning option, - closed loop, - MeasuredSpeed, - current measured speed, - CLInitFlag, - EncoderDeviation, - enc_vmean_wait, - enc_vmean_filter, - enc_vmean_int, - MicrostepResolution, - EncoderInputSampleRate, - EncoderInputFilterLength, - ChopperBlankTime, - ConstantTOffMode, - DisableFastDecayComparator, - ChopperHysteresisEnd, - ChopperHysteresisStart, - TOff, - SEIMIN, - SECDS, - smartEnergyHysteresis, - SECUS, - smartEnergyHysteresisStart, - SG2FilterEnable, - SG2Threshold, - smartEnergyActualCurrent, - smartEnergyStallVelocity, - smartEnergyThresholdSpeed, - RandomTOffMode, - ChopperSynchronization, - PWMThresholdSpeed, - PWMGrad, - PWMAmplitude, - PWMScale, - PWMMode, - PWMFrequency, - PWMAutoscale, - ReferenceSearchMode, - ReferenceSearchSpeed, - reference switch speed, - reference switch distance, - last reference switch position, - BoostCurrent, - encoder mode, - motor full step resolution, - FreewheelingMode, - LoadValue, - extended error flags, - driver error flags, - EncoderPosition, - encoder resolution, - max. position encoder deviation, - max. velocity encoder deviation, - PowerDownDelay, - reverse shaft, - step/direction gear ratio, - step/direction mode] - -AP_type: [0, - 1, - 2, - 3, - 4, - 5, - 6, - 7, - 8, - 9, - 10, - 11, - 12, - 13, - 14, - 15, - 16, - 17, - 18, - 19, - 20, - 21, - 22, - 23, - 24, - 25, - 26, - 27, - 28, - 29, - 33, - 34, - 35, - 50, - 108, - 109, - 110, - 111, - 112, - 113, - 114, - 115, - 116, - 117, - 118, - 119, - 120, - 121, - 123, - 124, - 125, - 126, - 127, - 129, - 131, - 132, - 133, - 134, - 136, - 137, - 138, - 140, - 150, - 151, - 162, - 163, - 164, - 165, - 166, - 167, - 168, - 169, - 170, - 171, - 172, - 173, - 174, - 180, - 181, - 182, - 184, - 185, - 186, - 187, - 188, - 189, - 190, - 191, - 192, - 193, - 194, - 195, - 196, - 197, - 200, - 201, - 202, - 204, - 206, - 207, - 208, - 209, - 210, - 212, - 213, - 214, - 251, - 253, - 254] - -# Available Global Parameters -GP_name: [serial baud rate, - serial address, - serial heartbeat, - CAN bitrate, - CAN send id, - CAN receive id, - telegram pause time, - serial host address, - auto start mode, - i/o mask, - protection mode, - CAN heartbeat, - CAN secondary address, - store coordinates in EEPROM, - do not restore user variables, - serial secondary address, - application status, - download mode, - program counter, - last tmcl error, - tick timer, - random number] - -GP_type: [65, - 66, - 68, - 69, - 70, - 71, - 75, - 76, - 77, - 78, - 81, - 82, - 83, - 84, - 85, - 87, - 128, - 129, - 130, - 131, - 132, - 133] diff --git a/config/autogenerated/TMCM-1321.yaml b/config/autogenerated/TMCM-1321.yaml deleted file mode 100644 index 4eeb753..0000000 --- a/config/autogenerated/TMCM-1321.yaml +++ /dev/null @@ -1,262 +0,0 @@ -#================================================================================= -# Auto-generated YAML configurations for TMCM-1321 -#================================================================================= - -# Note that it is assumed that the AP configurations don't differ between all motors/axes. -# This means only configurations for Axis0 are placed into this YAML. - -# Available Axis Parameters -AP_name: [TargetPosition, - ActualPosition, - TargetVelocity, - ActualVelocity, - MaxVelocity, - MaxAcceleration, - MaxCurrent, - StandbyCurrent, - PositionReachedFlag, - HomeSwitch, - RightEndstop, - LeftEndstop, - right limit switch enable/polarity, - left limit switch enable/polarity, - RampType, - StartVelocity, - StartAcceleration, - MaxDeceleration, - break velocity, - final deceleration, - StopVelocity, - stop deceleration, - BOW1, - BOW2, - BOW3, - BOW4, - virtual stop left, - virtual stop right, - virtual stop enable, - virtual stop mode, - swap limit switches, - limit switch soft stop, - position compare value, - position compare pulse length, - position compare output, - position compare repeat, - CLGammaVMin, - CLGammaVMax, - CLMaxGamma, - CLBeta, - CLOffset, - CLCurrentMin, - CLCurrentMax, - CLCorrectionVelocityP, - CLCorrectionVelocityI, - CLCorrectionVelIClip, - CLCorrectionVelDVClock, - CLCorrectionVelDVClip, - CLUpscaleDelay, - CLDownscaleDelay, - ActualScalerValue, - CLCorrectionPositionP, - CLMaxCorrectionTolerance, - CLStartUp, - relative positioning option, - closed loop, - init mode, - MeasuredSpeed, - current measured speed, - CLInitFlag, - EncoderDeviation, - enc_vmean_wait, - enc_vmean_filter, - enc_vmean_int, - MicrostepResolution, - ChopperBlankTime, - ConstantTOffMode, - ChopperHysteresisDecrement, - ChopperHysteresisEnd, - ChopperHysteresisStart, - TOff, - SEIMIN, - SECDS, - smartEnergyHysteresis, - SECUS, - smartEnergyHysteresisStart, - SG2FilterEnable, - SG2Threshold, - slope control high side, - slope control low side, - ShortToGroundProtection, - ShortDetectionTime, - VSense, - smartEnergyActualCurrent, - smartEnergyStallVelocity, - smartEnergyThresholdSpeed, - smartEnergySlowRunCurrent, - RandomTOffMode, - ReferenceSearchMode, - ReferenceSearchSpeed, - reference switch speed, - reference switch distance, - last reference switch position, - BoostCurrent, - fullstep resolution, - LoadValue, - extended error flags, - driver error flags, - EncoderPosition, - encoder resolution, - stop on error mode, - max. position encoder deviation, - max. velocity encoder deviation, - PowerDownDelay, - absolute encoder, - encoder error bits, - all status bits, - reverse shaft, - clear alarm outputs] - -AP_type: [0, - 1, - 2, - 3, - 4, - 5, - 6, - 7, - 8, - 9, - 10, - 11, - 12, - 13, - 14, - 15, - 16, - 17, - 18, - 19, - 20, - 21, - 22, - 23, - 24, - 25, - 26, - 27, - 28, - 29, - 33, - 34, - 35, - 36, - 37, - 38, - 108, - 109, - 110, - 111, - 112, - 113, - 114, - 115, - 116, - 117, - 118, - 119, - 120, - 121, - 123, - 124, - 125, - 126, - 127, - 129, - 130, - 131, - 132, - 133, - 134, - 136, - 137, - 138, - 140, - 162, - 163, - 164, - 165, - 166, - 167, - 168, - 169, - 170, - 171, - 172, - 173, - 174, - 175, - 176, - 177, - 178, - 179, - 180, - 181, - 182, - 183, - 184, - 193, - 194, - 195, - 196, - 196, - 200, - 202, - 206, - 207, - 208, - 209, - 210, - 211, - 212, - 213, - 214, - 215, - 219, - 250, - 251, - 252] - -# Available Global Parameters -GP_name: [serial baud rate, - serial address, - error mask, - telegram pause time, - serial host address, - auto start mode, - protection mode, - eeprom coordinate store, - zero user variables, - serial secondary address, - application status, - download mode, - program counter, - last tmcl error, - tick timer, - random number] - -GP_type: [65, - 66, - 72, - 75, - 76, - 77, - 81, - 84, - 85, - 87, - 128, - 129, - 130, - 131, - 132, - 133] diff --git a/config/autogenerated/TMCM-1370.yaml b/config/autogenerated/TMCM-1370.yaml deleted file mode 100644 index 91efcc6..0000000 --- a/config/autogenerated/TMCM-1370.yaml +++ /dev/null @@ -1,268 +0,0 @@ -#================================================================================= -# Auto-generated YAML configurations for TMCM-1370 -#================================================================================= - -# Note that it is assumed that the AP configurations don't differ between all motors/axes. -# This means only configurations for Axis0 are placed into this YAML. - -# Available Axis Parameters -AP_name: [TargetPosition, - ActualPosition, - TargetVelocity, - ActualVelocity, - MaxVelocity, - MaxAcceleration, - MaxCurrent, - StandbyCurrent, - PositionReachedFlag, - HomeSwitch, - RightEndstop, - LeftEndstop, - right limit switch enable/polarity, - left limit switch enable/polarity, - RampType, - StartVelocity, - StartAcceleration, - MaxDeceleration, - break velocity, - final deceleration, - StopVelocity, - stop deceleration, - BOW1, - BOW2, - BOW3, - BOW4, - virtual stop left, - virtual stop right, - virtual stop enable, - virtual stop mode, - swap limit switches, - limit switch soft stop, - BOW_SCALER, - position compare value, - position compare pulse length, - position compare output, - position compare repeat, - torque, - CLGammaVMin, - CLGammaVMax, - CLMaxGamma, - CLBeta, - CLOffset, - CLCurrentMin, - CLCurrentMax, - CLCorrectionVelocityP, - CLCorrectionVelocityI, - CLCorrectionVelIClip, - CLCorrectionVelDVClock, - CLCorrectionVelDVClip, - CLUpscaleDelay, - CLDownscaleDelay, - ActualScalerValue, - CLCorrectionPositionP, - CLMaxCorrectionTolerance, - CLStartUp, - relative positioning option, - closed loop, - init mode, - MeasuredSpeed, - current measured speed, - CLInitFlag, - EncoderDeviation, - enc_vmean_wait, - enc_vmean_filter, - enc_vmean_int, - ChopperBlankTime, - ConstantTOffMode, - ChopperHysteresisDecrement, - ChopperHysteresisEnd, - ChopperHysteresisStart, - TOff, - SEIMIN, - SECDS, - smartEnergyHysteresis, - SECUS, - smartEnergyHysteresisStart, - SG2FilterEnable, - SG2Threshold, - slope control high side, - slope control high side, - ShortToGroundProtection, - ShortDetectionTime, - VSense, - smartEnergyActualCurrent, - smartEnergyStallVelocity, - smartEnergyThresholdSpeed, - smartEnergySlowRunCurrent, - RandomTOffMode, - ReferenceSearchMode, - ReferenceSearchSpeed, - reference switch speed, - reference switch distance, - last reference switch position, - BoostCurrent, - fullstep resolution, - FreewheelingMode, - LoadValue, - extended error flags, - driver error flags, - EncoderPosition, - encoder resolution, - stop on error mode, - max. position encoder deviation, - max. velocity encoder deviation, - PowerDownDelay, - absolute encoder, - encoder error bits, - all status bits, - reverse shaft, - clear alarm outputs] - -AP_type: [0, - 1, - 2, - 3, - 4, - 5, - 6, - 7, - 8, - 9, - 10, - 11, - 12, - 13, - 14, - 15, - 16, - 17, - 18, - 19, - 20, - 21, - 22, - 23, - 24, - 25, - 26, - 27, - 28, - 29, - 33, - 34, - 35, - 40, - 41, - 42, - 43, - 50, - 108, - 109, - 110, - 111, - 112, - 113, - 114, - 115, - 116, - 117, - 118, - 119, - 120, - 121, - 123, - 124, - 125, - 126, - 127, - 129, - 130, - 131, - 132, - 133, - 134, - 136, - 137, - 138, - 162, - 163, - 164, - 165, - 166, - 167, - 168, - 169, - 170, - 171, - 172, - 173, - 174, - 175, - 176, - 177, - 178, - 179, - 180, - 181, - 182, - 183, - 184, - 193, - 194, - 195, - 196, - 196, - 200, - 202, - 204, - 206, - 207, - 208, - 209, - 210, - 211, - 212, - 213, - 214, - 215, - 219, - 250, - 251, - 252] - -# Available Global Parameters -GP_name: [serial baud rate, - serial address, - io mode, - telegram pause time, - serial host address, - auto start mode, - shutdown pin function, - protection mode, - eeprom coordinate store, - zero user variables, - serial secondary address, - application status, - download mode, - program counter, - last tmcl error, - tick timer, - random number] - -GP_type: [65, - 66, - 72, - 75, - 76, - 77, - 80, - 81, - 84, - 85, - 87, - 128, - 129, - 130, - 131, - 132, - 133] diff --git a/config/autogenerated/TMCM-1640.yaml b/config/autogenerated/TMCM-1640.yaml deleted file mode 100644 index a5c651b..0000000 --- a/config/autogenerated/TMCM-1640.yaml +++ /dev/null @@ -1,207 +0,0 @@ -#================================================================================= -# Auto-generated YAML configurations for TMCM-1640 -#================================================================================= - -# Note that it is assumed that the AP configurations don't differ between all motors/axes. -# This means only configurations for Axis0 are placed into this YAML. - -# Available Axis Parameters -AP_name: [TargetPosition, - ActualPosition, - TargetVelocity, - ActualVelocity, - MaxVelocity, - MaxTorque, - TargetReachedVelocity, - PositionReachedFlag, - MotorHaltedVelocity, - TargetReachedDistance, - Acceleration, - RampVelocity, - RampPosition, - ThermalWindingTimeConstant, - IItlimit, - IItSum, - IItExceededCounter, - ClearIItExceededFlag, - ReinitBldcRegulation, - PIDRegulationLoopDelay, - CurrentRegulationLoopDelay, - EnableRamp, - ActualTorque, - SupplyVoltage, - DriverTemperature, - TargetTorque, - StatusFlags, - CommutationMode, - ClearOnNull, - ClearOnce, - EncoderOffset, - TorqueOffset, - TorqueP, - TorqueI, - TorqueIDivider, - OpenLoopCurrent, - DebugValue0, - DebugValue1, - DebugValue2, - DebugValue3, - DebugValue4, - DebugValue5, - DebugValue6, - DebugValue7, - DebugValue8, - DebugValue9, - CurrentPIDError, - CurrentPIDErrorSum, - ActualHallAngle, - ActualEncoderAngle, - ActualControlledAngle, - PositionPIDError, - VelocityPIDError, - VelocityPIDErrorSum, - PositionP, - VelocityOffset, - VelocityP, - VelocityI, - InitVelocity, - InitSineDelay, - EncoderInitMode, - EncoderSteps, - EncoderDirection, - HallInterpolation, - MotorPoles, - HallSensorPolarity, - DriverEnabled] - -AP_type: [0, - 1, - 2, - 3, - 4, - 6, - 7, - 8, - 9, - 10, - 11, - 13, - 14, - 25, - 26, - 27, - 28, - 29, - 31, - 133, - 134, - 146, - 150, - 151, - 152, - 155, - 156, - 159, - 161, - 163, - 165, - 171, - 172, - 173, - 175, - 177, - 190, - 191, - 192, - 193, - 194, - 195, - 196, - 197, - 198, - 199, - 200, - 201, - 210, - 211, - 212, - 226, - 228, - 229, - 230, - 233, - 234, - 235, - 241, - 244, - 249, - 250, - 251, - 252, - 253, - 254, - 255] - -# Available Global Parameters -GP_name: [serial baud rate, - serial address, - CAN bit rate, - CANsendID, - CANreceiveID, - telegram pause time, - serial host address, - auto start mode, - application status, - program counter, - tick timer] - -GP_type: [65, - 66, - 69, - 70, - 71, - 75, - 76, - 77, - 128, - 130, - 132] - -# Available Registers for StatusFlags -StatusFlags_Reg_name: [OVERCURRENT, - UNDERVOLTAGE, - OVERVOLTAGE, - OVERTEMPERATURE, - MOTORHALTED, - HALLERROR, - DRIVER_ERROR, - INIT_ERROR, - STOP_MODE, - VELOCITY_MODE, - POSITION_MODE, - TORQUE_MODE, - EMERGENCYSTOP, - FREERUNNING, - POSITION_END, - MODULE_INITIALIZED, - ETHERCAT_TIMEOUT, - IIT_EXCEEDED] - -StatusFlags_Reg_shift: [0, - 1, - 2, - 3, - 4, - 5, - 6, - 7, - 8, - 9, - 10, - 11, - 12, - 13, - 14, - 15, - 16, - 17] diff --git a/config/autogenerated/TMCM-2300.yaml b/config/autogenerated/TMCM-2300.yaml deleted file mode 100644 index 59ee7d6..0000000 --- a/config/autogenerated/TMCM-2300.yaml +++ /dev/null @@ -1,80 +0,0 @@ -#================================================================================= -# Auto-generated YAML configurations for TMC2300-MOTOR-EVAL -#================================================================================= - -# Note that it is assumed that the AP configurations don't differ between all motors/axes. -# This means only configurations for Axis0 are placed into this YAML. - -# Available Axis Parameters -AP_name: [TargetPosition, - ActualPosition, - TargetVelocity, - ActualVelocity, - MaxVelocity, - MaxAcceleration, - MaxCurrent, - StandbyCurrent, - PositionReachedFlag, - MeasuredSpeed, - VActual, - MicrostepResolution, - Intpol, - ChopperBlankTime, - SEIMIN, - SECDS, - smartEnergyHysteresis, - SECUS, - smartEnergyHysteresisStart, - SG2Threshold, - smartEnergyActualCurrent, - smartEnergyStallVelocity, - smartEnergyThresholdSpeed, - PWMGrad, - PWMFrequency, - PWMAutoscale, - FreewheelingMode, - LoadValue, - SupplyVoltage] - -AP_type: [0, - 1, - 2, - 3, - 4, - 5, - 6, - 7, - 8, - 29, - 100, - 140, - 141, - 162, - 168, - 169, - 170, - 171, - 172, - 174, - 180, - 181, - 182, - 187, - 191, - 192, - 204, - 206, - 220] - -# Available Global Parameters -GP_name: [serial baud rate, - auto start mode, - application status, - program counter, - tick timer] - -GP_type: [65, - 77, - 128, - 130, - 132] diff --git a/config/autogenerated/TMCM-3213.yaml b/config/autogenerated/TMCM-3213.yaml deleted file mode 100644 index 0358332..0000000 --- a/config/autogenerated/TMCM-3213.yaml +++ /dev/null @@ -1,206 +0,0 @@ -#================================================================================= -# Auto-generated YAML configurations for TMCM-3213 -#================================================================================= - -# Note that it is assumed that the AP configurations don't differ between all motors/axes. -# This means only configurations for Axis0 are placed into this YAML. - -# Available Axis Parameters -AP_name: [TargetPosition, - ActualPosition, - TargetVelocity, - ActualVelocity, - MaxVelocity, - MaxAcceleration, - MaxCurrent, - StandbyCurrent, - PositionReachedFlag, - reference switch status, - RightEndstop, - LeftEndstop, - right limit switch disable, - left limit switch disable, - swap limit switches, - A1, - V1, - MaxDeceleration, - D1, - StartVelocity, - StopVelocity, - RampWaitTime, - THIGH, - min. dcStep speed, - right limit switch polarity, - left limit switch polarity, - softstop, - HighSpeedChopperMode, - HighSpeedFullstepMode, - MeasuredSpeed, - PowerDownRamp, - dcStep time, - dcStep stallGuard, - relative positioning option, - MicrostepResolution, - ChopperBlankTime, - ConstantTOffMode, - DisableFastDecayComparator, - ChopperHysteresisEnd, - ChopperHysteresisStart, - TOff, - SEIMIN, - SECDS, - smartEnergyHysteresis, - SECUS, - smartEnergyHysteresisStart, - SG2FilterEnable, - SG2Threshold, - ShortToGroundProtection, - VSense, - smartEnergyActualCurrent, - smartEnergyStallVelocity, - smartEnergyThresholdSpeed, - RandomTOffMode, - ChopperSynchronization, - PWMThresholdSpeed, - PWMGrad, - PWMAmplitude, - PWMScale, - PWMMode, - PWMFrequency, - PWMAutoscale, - ReferenceSearchMode, - ReferenceSearchSpeed, - reference switch speed, - reference switch distance, - last reference switch position, - latched actual position, - latched encoder position, - encoder mode, - motor full step resolution, - FreewheelingMode, - LoadValue, - extended error flags, - driver error flags, - EncoderPosition, - encoder resolution, - max. encoder deviation, - group index, - PowerDownDelay, - reverse shaft] - -AP_type: [0, - 1, - 2, - 3, - 4, - 5, - 6, - 7, - 8, - 9, - 10, - 11, - 12, - 13, - 14, - 15, - 16, - 17, - 18, - 19, - 20, - 21, - 22, - 23, - 24, - 25, - 26, - 27, - 28, - 29, - 31, - 32, - 33, - 127, - 140, - 162, - 163, - 164, - 165, - 166, - 167, - 168, - 169, - 170, - 171, - 172, - 173, - 174, - 177, - 179, - 180, - 181, - 182, - 184, - 185, - 186, - 187, - 188, - 189, - 190, - 191, - 192, - 193, - 194, - 195, - 196, - 197, - 198, - 199, - 201, - 202, - 204, - 206, - 207, - 208, - 209, - 210, - 212, - 213, - 214, - 251] - -# Available Global Parameters -GP_name: [serial baud rate, - serial address, - serial heartbeat, - telegram pause time, - serial host address, - auto start mode, - protection mode, - store coordinates in EEPROM, - do not restore user variables, - serial secondary address, - application status, - download mode, - program counter, - last tmcl error, - tick timer, - random number] - -GP_type: [65, - 66, - 68, - 75, - 76, - 77, - 81, - 84, - 85, - 87, - 128, - 129, - 130, - 131, - 132, - 133] diff --git a/config/autogenerated/TMCM-3215.yaml b/config/autogenerated/TMCM-3215.yaml deleted file mode 100644 index f8bd73a..0000000 --- a/config/autogenerated/TMCM-3215.yaml +++ /dev/null @@ -1,206 +0,0 @@ -#================================================================================= -# Auto-generated YAML configurations for TMCM-3215 -#================================================================================= - -# Note that it is assumed that the AP configurations don't differ between all motors/axes. -# This means only configurations for Axis0 are placed into this YAML. - -# Available Axis Parameters -AP_name: [TargetPosition, - ActualPosition, - TargetVelocity, - ActualVelocity, - MaxVelocity, - MaxAcceleration, - MaxCurrent, - StandbyCurrent, - PositionReachedFlag, - reference switch status, - RightEndstop, - LeftEndstop, - right limit switch disable, - left limit switch disable, - swap limit switches, - A1, - V1, - MaxDeceleration, - D1, - StartVelocity, - StopVelocity, - RampWaitTime, - THIGH, - min. dcStep speed, - right limit switch polarity, - left limit switch polarity, - softstop, - HighSpeedChopperMode, - HighSpeedFullstepMode, - MeasuredSpeed, - PowerDownRamp, - dcStep time, - dcStep stallGuard, - relative positioning option, - MicrostepResolution, - ChopperBlankTime, - ConstantTOffMode, - DisableFastDecayComparator, - ChopperHysteresisEnd, - ChopperHysteresisStart, - TOff, - SEIMIN, - SECDS, - smartEnergyHysteresis, - SECUS, - smartEnergyHysteresisStart, - SG2FilterEnable, - SG2Threshold, - ShortToGroundProtection, - VSense, - smartEnergyActualCurrent, - smartEnergyStallVelocity, - smartEnergyThresholdSpeed, - RandomTOffMode, - ChopperSynchronization, - PWMThresholdSpeed, - PWMGrad, - PWMAmplitude, - PWMScale, - PWMMode, - PWMFrequency, - PWMAutoscale, - ReferenceSearchMode, - ReferenceSearchSpeed, - reference switch speed, - reference switch distance, - last reference switch position, - latched actual position, - latched encoder position, - encoder mode, - motor full step resolution, - FreewheelingMode, - LoadValue, - extended error flags, - driver error flags, - EncoderPosition, - encoder resolution, - max. encoder deviation, - group index, - PowerDownDelay, - reverse shaft] - -AP_type: [0, - 1, - 2, - 3, - 4, - 5, - 6, - 7, - 8, - 9, - 10, - 11, - 12, - 13, - 14, - 15, - 16, - 17, - 18, - 19, - 20, - 21, - 22, - 23, - 24, - 25, - 26, - 27, - 28, - 29, - 31, - 32, - 33, - 127, - 140, - 162, - 163, - 164, - 165, - 166, - 167, - 168, - 169, - 170, - 171, - 172, - 173, - 174, - 177, - 179, - 180, - 181, - 182, - 184, - 185, - 186, - 187, - 188, - 189, - 190, - 191, - 192, - 193, - 194, - 195, - 196, - 197, - 198, - 199, - 201, - 202, - 204, - 206, - 207, - 208, - 209, - 210, - 212, - 213, - 214, - 251] - -# Available Global Parameters -GP_name: [serial baud rate, - serial address, - serial heartbeat, - telegram pause time, - serial host address, - auto start mode, - protection mode, - store coordinates in EEPROM, - do not restore user variables, - serial secondary address, - application status, - download mode, - program counter, - last tmcl error, - tick timer, - random number] - -GP_type: [65, - 66, - 68, - 75, - 76, - 77, - 81, - 84, - 85, - 87, - 128, - 129, - 130, - 131, - 132, - 133] diff --git a/config/autogenerated/TMCM-3313.yaml b/config/autogenerated/TMCM-3313.yaml deleted file mode 100644 index 4a21a89..0000000 --- a/config/autogenerated/TMCM-3313.yaml +++ /dev/null @@ -1,276 +0,0 @@ -#================================================================================= -# Auto-generated YAML configurations for TMCM-3313 -#================================================================================= - -# Note that it is assumed that the AP configurations don't differ between all motors/axes. -# This means only configurations for Axis0 are placed into this YAML. - -# Available Axis Parameters -AP_name: [TargetPosition, - ActualPosition, - TargetVelocity, - ActualVelocity, - MaxVelocity, - MaxAcceleration, - MaxCurrent, - StandbyCurrent, - PositionReachedFlag, - HomeSwitch, - RightEndstop, - LeftEndstop, - right limit switch enable/polarity, - left limit switch enable/polarity, - RampType, - StartVelocity, - StartAcceleration, - MaxDeceleration, - break velocity, - final deceleration, - StopVelocity, - stop deceleration, - BOW1, - BOW2, - BOW3, - BOW4, - virtual stop left, - virtual stop right, - virtual stop enable, - virtual stop mode, - swap limit switches, - limit switch soft stop, - BOW_SCALER, - torque, - CLGammaVMin, - CLGammaVMax, - CLMaxGamma, - CLBeta, - CLOffset, - CLCurrentMin, - CLCurrentMax, - CLCorrectionVelocityP, - CLCorrectionVelocityI, - CLCorrectionVelIClip, - CLCorrectionVelDVClock, - CLCorrectionVelDVClip, - CLUpscaleDelay, - CLDownscaleDelay, - ActualScalerValue, - CLCorrectionPositionP, - CLMaxCorrectionTolerance, - CLStartUp, - relative positioning option, - closed loop, - MeasuredSpeed, - current measured speed, - CLInitFlag, - EncoderDeviation, - enc_vmean_wait, - enc_vmean_filter, - enc_vmean_int, - MicrostepResolution, - EncoderInputSampleRate, - EncoderInputFilterLength, - ChopperBlankTime, - ConstantTOffMode, - DisableFastDecayComparator, - ChopperHysteresisEnd, - ChopperHysteresisStart, - TOff, - SEIMIN, - SECDS, - smartEnergyHysteresis, - SECUS, - smartEnergyHysteresisStart, - SG2FilterEnable, - SG2Threshold, - VSense, - smartEnergyActualCurrent, - smartEnergyStallVelocity, - smartEnergyThresholdSpeed, - RandomTOffMode, - ChopperSynchronization, - PWMThresholdSpeed, - PWMGrad, - PWMAmplitude, - PWMScale, - PWMMode, - PWMFrequency, - PWMAutoscale, - ReferenceSearchMode, - ReferenceSearchSpeed, - reference switch speed, - reference switch distance, - last reference switch position, - latched actual position, - latched encoder position, - BoostCurrent, - encoder mode, - motor full step resolution, - FreewheelingMode, - LoadValue, - extended error flags, - driver error flags, - EncoderPosition, - encoder resolution, - max. position encoder deviation, - max. velocity encoder deviation, - PowerDownDelay, - group index, - reverse shaft] - -AP_type: [0, - 1, - 2, - 3, - 4, - 5, - 6, - 7, - 8, - 9, - 10, - 11, - 12, - 13, - 14, - 15, - 16, - 17, - 18, - 19, - 20, - 21, - 22, - 23, - 24, - 25, - 26, - 27, - 28, - 29, - 33, - 34, - 35, - 50, - 108, - 109, - 110, - 111, - 112, - 113, - 114, - 115, - 116, - 117, - 118, - 119, - 120, - 121, - 123, - 124, - 125, - 126, - 127, - 129, - 131, - 132, - 133, - 134, - 136, - 137, - 138, - 140, - 150, - 151, - 162, - 163, - 164, - 165, - 166, - 167, - 168, - 169, - 170, - 171, - 172, - 173, - 174, - 179, - 180, - 181, - 182, - 184, - 185, - 186, - 187, - 188, - 189, - 190, - 191, - 192, - 193, - 194, - 195, - 196, - 197, - 198, - 199, - 200, - 201, - 202, - 204, - 206, - 207, - 208, - 209, - 210, - 212, - 213, - 214, - 249, - 251] - -# Available Global Parameters -GP_name: [serial baud rate, - serial address, - serial heartbeat, - CAN bitrate, - CAN send id, - CAN receive id, - telegram pause time, - serial host address, - auto start mode, - protection mode, - CAN heartbeat, - CAN secondary address, - store coordinates in EEPROM, - do not restore user variables, - serial secondary address, - application status, - download mode, - program counter, - last tmcl error, - tick timer, - random number] - -GP_type: [65, - 66, - 68, - 69, - 70, - 71, - 75, - 76, - 77, - 81, - 82, - 83, - 84, - 85, - 87, - 128, - 129, - 130, - 131, - 132, - 133] diff --git a/config/autogenerated/TMCM-3315.yaml b/config/autogenerated/TMCM-3315.yaml deleted file mode 100644 index c5d72ee..0000000 --- a/config/autogenerated/TMCM-3315.yaml +++ /dev/null @@ -1,274 +0,0 @@ -#================================================================================= -# Auto-generated YAML configurations for TMCM-3315 -#================================================================================= - -# Note that it is assumed that the AP configurations don't differ between all motors/axes. -# This means only configurations for Axis0 are placed into this YAML. - -# Available Axis Parameters -AP_name: [TargetPosition, - ActualPosition, - TargetVelocity, - ActualVelocity, - MaxVelocity, - MaxAcceleration, - MaxCurrent, - StandbyCurrent, - PositionReachedFlag, - HomeSwitch, - RightEndstop, - LeftEndstop, - right limit switch enable/polarity, - left limit switch enable/polarity, - RampType, - StartVelocity, - StartAcceleration, - MaxDeceleration, - break velocity, - final deceleration, - StopVelocity, - stop deceleration, - BOW1, - BOW2, - BOW3, - BOW4, - virtual stop left, - virtual stop right, - virtual stop enable, - virtual stop mode, - swap limit switches, - limit switch soft stop, - BOW_SCALER, - torque, - CLGammaVMin, - CLGammaVMax, - CLMaxGamma, - CLBeta, - CLOffset, - CLCurrentMin, - CLCurrentMax, - CLCorrectionVelocityP, - CLCorrectionVelocityI, - CLCorrectionVelIClip, - CLCorrectionVelDVClock, - CLCorrectionVelDVClip, - CLUpscaleDelay, - CLDownscaleDelay, - ActualScalerValue, - CLCorrectionPositionP, - CLMaxCorrectionTolerance, - CLStartUp, - relative positioning option, - closed loop, - MeasuredSpeed, - current measured speed, - CLInitFlag, - EncoderDeviation, - enc_vmean_wait, - enc_vmean_filter, - enc_vmean_int, - MicrostepResolution, - EncoderInputSampleRate, - EncoderInputFilterLength, - ChopperBlankTime, - ConstantTOffMode, - DisableFastDecayComparator, - ChopperHysteresisEnd, - ChopperHysteresisStart, - TOff, - SEIMIN, - SECDS, - smartEnergyHysteresis, - SECUS, - smartEnergyHysteresisStart, - SG2FilterEnable, - SG2Threshold, - smartEnergyActualCurrent, - smartEnergyStallVelocity, - smartEnergyThresholdSpeed, - RandomTOffMode, - ChopperSynchronization, - PWMThresholdSpeed, - PWMGrad, - PWMAmplitude, - PWMScale, - PWMMode, - PWMFrequency, - PWMAutoscale, - ReferenceSearchMode, - ReferenceSearchSpeed, - reference switch speed, - reference switch distance, - last reference switch position, - latched actual position, - latched encoder position, - BoostCurrent, - encoder mode, - motor full step resolution, - FreewheelingMode, - LoadValue, - extended error flags, - driver error flags, - EncoderPosition, - encoder resolution, - max. position encoder deviation, - max. velocity encoder deviation, - PowerDownDelay, - group index, - reverse shaft] - -AP_type: [0, - 1, - 2, - 3, - 4, - 5, - 6, - 7, - 8, - 9, - 10, - 11, - 12, - 13, - 14, - 15, - 16, - 17, - 18, - 19, - 20, - 21, - 22, - 23, - 24, - 25, - 26, - 27, - 28, - 29, - 33, - 34, - 35, - 50, - 108, - 109, - 110, - 111, - 112, - 113, - 114, - 115, - 116, - 117, - 118, - 119, - 120, - 121, - 123, - 124, - 125, - 126, - 127, - 129, - 131, - 132, - 133, - 134, - 136, - 137, - 138, - 140, - 150, - 151, - 162, - 163, - 164, - 165, - 166, - 167, - 168, - 169, - 170, - 171, - 172, - 173, - 174, - 180, - 181, - 182, - 184, - 185, - 186, - 187, - 188, - 189, - 190, - 191, - 192, - 193, - 194, - 195, - 196, - 197, - 198, - 199, - 200, - 201, - 202, - 204, - 206, - 207, - 208, - 209, - 210, - 212, - 213, - 214, - 249, - 251] - -# Available Global Parameters -GP_name: [serial baud rate, - serial address, - serial heartbeat, - CAN bitrate, - CAN send id, - CAN receive id, - telegram pause time, - serial host address, - auto start mode, - protection mode, - CAN heartbeat, - CAN secondary address, - store coordinates in EEPROM, - do not restore user variables, - serial secondary address, - application status, - download mode, - program counter, - last tmcl error, - tick timer, - random number] - -GP_type: [65, - 66, - 68, - 69, - 70, - 71, - 75, - 76, - 77, - 81, - 82, - 83, - 84, - 85, - 87, - 128, - 129, - 130, - 131, - 132, - 133] diff --git a/config/autogenerated/TMCM-6211.yaml b/config/autogenerated/TMCM-6211.yaml deleted file mode 100644 index 3aa4b22..0000000 --- a/config/autogenerated/TMCM-6211.yaml +++ /dev/null @@ -1,198 +0,0 @@ -#================================================================================= -# Auto-generated YAML configurations for TMCM-6211 -#================================================================================= - -# Note that it is assumed that the AP configurations don't differ between all motors/axes. -# This means only configurations for Axis0 are placed into this YAML. - -# Available Axis Parameters -AP_name: [TargetPosition, - ActualPosition, - TargetVelocity, - ActualVelocity, - MaxVelocity, - MaxAcceleration, - MaxCurrent, - StandbyCurrent, - PositionReachedFlag, - reference switch status, - RightEndstop, - LeftEndstop, - right limit switch disable, - left limit switch disable, - swap limit switches, - A1, - V1, - MaxDeceleration, - D1, - StartVelocity, - StopVelocity, - RampWaitTime, - THIGH, - min. dcStep speed, - right limit switch polarity, - left limit switch polarity, - softstop, - HighSpeedChopperMode, - HighSpeedFullstepMode, - MeasuredSpeed, - PowerDownRamp, - dcStep time, - dcStep stallGuard, - relative positioning option, - MicrostepResolution, - ChopperBlankTime, - ConstantTOffMode, - DisableFastDecayComparator, - ChopperHysteresisEnd, - ChopperHysteresisStart, - TOff, - SEIMIN, - SECDS, - smartEnergyHysteresis, - SECUS, - smartEnergyHysteresisStart, - SG2FilterEnable, - SG2Threshold, - ShortToGroundProtection, - VSense, - smartEnergyActualCurrent, - smartEnergyStallVelocity, - smartEnergyThresholdSpeed, - RandomTOffMode, - ChopperSynchronization, - PWMGrad, - PWMAmplitude, - PWMScale, - ReferenceSearchMode, - ReferenceSearchSpeed, - reference switch speed, - reference switch distance, - last reference switch position, - latched actual position, - latched encoder position, - encoder mode, - motor full step resolution, - FreewheelingMode, - LoadValue, - extended error flags, - driver error flags, - EncoderPosition, - encoder resolution, - max. encoder deviation, - group index, - reverse shaft] - -AP_type: [0, - 1, - 2, - 3, - 4, - 5, - 6, - 7, - 8, - 9, - 10, - 11, - 12, - 13, - 14, - 15, - 16, - 17, - 18, - 19, - 20, - 21, - 22, - 23, - 24, - 25, - 26, - 27, - 28, - 29, - 31, - 32, - 33, - 127, - 140, - 162, - 163, - 164, - 165, - 166, - 167, - 168, - 169, - 170, - 171, - 172, - 173, - 174, - 177, - 179, - 180, - 181, - 182, - 184, - 185, - 187, - 188, - 189, - 193, - 194, - 195, - 196, - 197, - 198, - 199, - 201, - 202, - 204, - 206, - 207, - 208, - 209, - 210, - 212, - 213, - 251] - -# Available Global Parameters -GP_name: [serial baud rate, - serial address, - serial heartbeat, - telegram pause time, - serial host address, - auto start mode, - i/o mask, - protection mode, - store coordinates in EEPROM, - do not restore user variables, - serial secondary address, - application status, - download mode, - program counter, - last tmcl error, - tick timer, - random number] - -GP_type: [65, - 66, - 68, - 75, - 76, - 77, - 78, - 81, - 84, - 85, - 87, - 128, - 129, - 130, - 131, - 132, - 133] diff --git a/config/autogenerated/TMCM-6213.yaml b/config/autogenerated/TMCM-6213.yaml deleted file mode 100644 index e4c1227..0000000 --- a/config/autogenerated/TMCM-6213.yaml +++ /dev/null @@ -1,206 +0,0 @@ -#================================================================================= -# Auto-generated YAML configurations for TMCM-6213 -#================================================================================= - -# Note that it is assumed that the AP configurations don't differ between all motors/axes. -# This means only configurations for Axis0 are placed into this YAML. - -# Available Axis Parameters -AP_name: [TargetPosition, - ActualPosition, - TargetVelocity, - ActualVelocity, - MaxVelocity, - MaxAcceleration, - MaxCurrent, - StandbyCurrent, - PositionReachedFlag, - reference switch status, - RightEndstop, - LeftEndstop, - right limit switch disable, - left limit switch disable, - swap limit switches, - A1, - V1, - MaxDeceleration, - D1, - StartVelocity, - StopVelocity, - RampWaitTime, - THIGH, - min. dcStep speed, - right limit switch polarity, - left limit switch polarity, - softstop, - HighSpeedChopperMode, - HighSpeedFullstepMode, - MeasuredSpeed, - PowerDownRamp, - dcStep time, - dcStep stallGuard, - relative positioning option, - MicrostepResolution, - ChopperBlankTime, - ConstantTOffMode, - DisableFastDecayComparator, - ChopperHysteresisEnd, - ChopperHysteresisStart, - TOff, - SEIMIN, - SECDS, - smartEnergyHysteresis, - SECUS, - smartEnergyHysteresisStart, - SG2FilterEnable, - SG2Threshold, - disable short circuit protection, - VSense, - smartEnergyActualCurrent, - smartEnergyStallVelocity, - smartEnergyThresholdSpeed, - RandomTOffMode, - ChopperSynchronization, - PWMThresholdSpeed, - PWMGrad, - PWMAmplitude, - PWMScale, - PWMMode, - PWMFrequency, - PWMAutoscale, - ReferenceSearchMode, - ReferenceSearchSpeed, - reference switch speed, - reference switch distance, - last reference switch position, - latched actual position, - latched encoder position, - encoder mode, - motor full step resolution, - FreewheelingMode, - LoadValue, - extended error flags, - driver error flags, - EncoderPosition, - encoder resolution, - max. encoder deviation, - group index, - PowerDownDelay, - reverse shaft] - -AP_type: [0, - 1, - 2, - 3, - 4, - 5, - 6, - 7, - 8, - 9, - 10, - 11, - 12, - 13, - 14, - 15, - 16, - 17, - 18, - 19, - 20, - 21, - 22, - 23, - 24, - 25, - 26, - 27, - 28, - 29, - 31, - 32, - 33, - 127, - 140, - 162, - 163, - 164, - 165, - 166, - 167, - 168, - 169, - 170, - 171, - 172, - 173, - 174, - 177, - 179, - 180, - 181, - 182, - 184, - 185, - 186, - 187, - 188, - 189, - 190, - 191, - 192, - 193, - 194, - 195, - 196, - 197, - 198, - 199, - 201, - 202, - 204, - 206, - 207, - 208, - 209, - 210, - 212, - 213, - 214, - 251] - -# Available Global Parameters -GP_name: [serial baud rate, - serial address, - serial heartbeat, - telegrm pause time, - serial host address, - auto start mode, - protection mode, - store coordinates in EEPROM, - do not restore user variables, - serial secondary address, - application status, - download mode, - program counter, - last tmcl error, - tick timer, - random number] - -GP_type: [65, - 66, - 68, - 75, - 76, - 77, - 81, - 84, - 85, - 87, - 128, - 129, - 130, - 131, - 132, - 133] diff --git a/include/tmcl_ros/socket_can_wrapper.h b/include/tmcl_ros/socket_can_wrapper.h index ec9ef0f..5bd03d6 100644 --- a/include/tmcl_ros/socket_can_wrapper.h +++ b/include/tmcl_ros/socket_can_wrapper.h @@ -6,35 +6,33 @@ #ifndef SOCKET_CAN_WRAPPER_H #define SOCKET_CAN_WRAPPER_H -#include - class SocketCAN { - public: - /* Constructor */ - SocketCAN(); +public: + /* Constructor */ + SocketCAN(); - /* Destructor */ - ~SocketCAN(); + /* Destructor */ + ~SocketCAN(); - /* Initialize CAN with specified interface name */ - bool initialize(const char *interface_name); + /* Initialize CAN with specified interface name */ + bool initialize(const char *interface_name); - /* De-initialize CAN */ - void deinitialize(); + /* De-initialize CAN */ + void deinitialize(); - /* Check if CAN frames are available */ - bool framesAvailable(); + /* Check if CAN frames are available */ + bool framesAvailable(); - /* Rx CAN frames */ - bool readFrame(uint32_t *id, uint8_t *data, uint8_t *size); + /* Rx CAN frames */ + bool readFrame(uint32_t *id, uint8_t *data, uint8_t *size); - /* Tx CAN frames */ - bool writeFrame(uint32_t id, uint8_t *data, uint8_t size); + /* Tx CAN frames */ + bool writeFrame(uint32_t id, uint8_t *data, uint8_t size); - private: - int can_socket; - std::string interface_name; +private: + int can_socket_; + std::string interface_name_; }; #endif // SOCKET_CAN_WRAPPER_H diff --git a/include/tmcl_ros/tmcl_bldc_motor.h b/include/tmcl_ros/tmcl_bldc_motor.h index 59200ca..320a67a 100644 --- a/include/tmcl_ros/tmcl_bldc_motor.h +++ b/include/tmcl_ros/tmcl_bldc_motor.h @@ -19,32 +19,34 @@ class BLDCMotor : public Motor { - public: - /* Constructor */ - BLDCMotor(ros::NodeHandle* p_nh, TmclInterpreter *p_tmcl_int, uint8_t motor_num); - - /* Destructor */ - ~BLDCMotor() override; - - void init() override; - - private: - /* Publisher */ - void rosPublishTmcInfo(const ros::TimerEvent& event) override; - - /* Subscriber */ - void initSubscriber() override; - void cmdVelCallback(const geometry_msgs::Twist& msg) override; - void cmdAbsPosCallback(const std_msgs::Int32 msg) override; - void cmdRelPosCallback(const std_msgs::Int32 msg) override; - - int32_t position_scaler; - int32_t encoder_steps; - bool b_statusflags_register_available; - std::vector param_statusflags_reg_name; - std::vector param_statusflags_reg_shift; - - bldc_comm_mode_t comm_mode; +public: + /* Constructor */ + BLDCMotor(ros::NodeHandle* p_nh, TmclInterpreter *p_tmcl_interpreter, + uint16_t module_number, uint8_t motor_number); + + /* Destructor */ + ~BLDCMotor() override; + + /* Initialize BLDC Motor */ + void init() override; + +private: + /* Publisher */ + void rosPublishTmcInfo(const ros::TimerEvent& event) override; + + /* Subscriber */ + void initSubscriber() override; + void cmdVelCallback(const geometry_msgs::Twist& msg) override; + void cmdAbsPosCallback(const std_msgs::Int32 msg) override; + void cmdRelPosCallback(const std_msgs::Int32 msg) override; + + int32_t position_scaler_; + int32_t encoder_steps_; + bool b_statusflags_register_available_; + std::vector param_statusflags_reg_name_; + std::vector param_statusflags_reg_shift_; + + bldc_comm_mode_t comm_mode_; }; #endif // TMCL_BLDC_MOTOR_H diff --git a/include/tmcl_ros/tmcl_interpreter.h b/include/tmcl_ros/tmcl_interpreter.h index 997c2f4..825882e 100644 --- a/include/tmcl_ros/tmcl_interpreter.h +++ b/include/tmcl_ros/tmcl_interpreter.h @@ -24,8 +24,8 @@ * - Reply Address: CAN-ID of the Receiver * - Command, Type, Motor, Status can be either of the values enumerated below **/ -#define TMCL_MSG_SZ 7 -#define TMCL_MSG_VALUE_SZ 4 +const uint8_t TMCL_MSG_SZ = 7; +const uint8_t TMCL_MSG_VALUE_SZ = 4; /*******************************************************************************/ /* Interface related settings */ @@ -97,39 +97,40 @@ typedef struct /* Class definition for TMCL Interpreter */ class TmclInterpreter { - public: - /* Constructor */ - TmclInterpreter(uint16_t timeout_ms, uint8_t comm_exec_cmd_retries, std::vector param_ap_name, std::vector param_ap_type); +public: + /* Constructor */ + TmclInterpreter(uint16_t timeout_ms, uint8_t comm_exec_cmd_retries, + std::vector param_ap_name, std::vector param_ap_type); - /* Destructor */ - ~TmclInterpreter(); + /* Destructor */ + ~TmclInterpreter(); - /* Reset interface */ - bool resetInterface(); + /* Reset interface */ + bool resetInterface(); - /* Execute command where type is a number */ - bool executeCmd(tmcl_cmd_t cmd, uint8_t type, uint8_t motor, int32_t *val); + /* Execute command where type is a number */ + bool executeCmd(tmcl_cmd_t cmd, uint8_t type, uint8_t motor, int32_t *val); - /* Execute command where type is a string(only available in ap_name_)*/ - bool executeCmd(tmcl_cmd_t cmd, std::string type, uint8_t motor, int32_t *val); + /* Execute command where type is a string(only available in ap_name_)*/ + bool executeCmd(tmcl_cmd_t cmd, std::string type, uint8_t motor, int32_t *val); - /* Shutdown interface */ - bool shutdownInterface(); + /* Shutdown interface */ + bool shutdownInterface(); - /* Getter b_retries_exceeded variable */ - bool getRetriesExceededStatus(); + /* Getter b_retries_exceeded variable */ + bool getRetriesExceededStatus(); - tmcl_interface_t tmcl_interface; - tmcl_cfg_t tmcl_cfg; - - private: - bool interface_enabled; - uint16_t timeout_ms; - uint8_t comm_exec_cmd_retries; - std::vector param_ap_name; - std::vector param_ap_type; + tmcl_interface_t tmcl_interface_; + tmcl_cfg_t tmcl_cfg_; + +private: + bool interface_enabled_; + uint16_t timeout_ms_; + uint8_t comm_exec_cmd_retries_; + std::vector param_ap_name_; + std::vector param_ap_type_; - bool b_retries_exceeded; + bool b_retries_exceeded_; }; #endif /* _TMCL_INTERPRETER_H */ diff --git a/include/tmcl_ros/tmcl_motor.h b/include/tmcl_ros/tmcl_motor.h index 5f3fb24..aaba5d1 100644 --- a/include/tmcl_ros/tmcl_motor.h +++ b/include/tmcl_ros/tmcl_motor.h @@ -16,71 +16,77 @@ /* Conversion constants */ -/* Derived from converting linear velocity (ROS velocity unit) to rpm (TMC board velocity unit)*/ -#define PI 3.1415926535 -#define SECS_TO_MIN 60 +/* Derived from converting linear velocity (ROS velocity unit) to rpm (TMC board velocity unit) */ +const double PI = 3.1415926535; +const uint8_t SECS_TO_MIN = 60; -/* Used for converting degrees (general position/angular unit) to steps (TMC board position/angular unit)*/ -#define ANGULAR_FULL_ROTATION 360 +/* Used for converting degrees (general position/angular unit) to steps (TMC board position/angular unit) */ +const uint16_t ANGULAR_FULL_ROTATION = 360; class Motor { - public: - /* Constructor */ - Motor(ros::NodeHandle* p_nh, TmclInterpreter *p_tmcl_int, uint8_t motor_num); +public: + /* Constructor */ + Motor(ros::NodeHandle* p_nh, TmclInterpreter *p_tmcl_interpreter, + uint16_t module_number, uint8_t motor_number); - /* Destructor */ - virtual ~Motor(); + /* Destructor */ + virtual ~Motor(); - virtual void init(); + /* Initialize Motor */ + virtual void init(); + +protected: + /* Publisher */ + void initPublisher(); + virtual void rosPublishTmcInfo(const ros::TimerEvent& event); + ros::Timer timer_callback_; + ros::Publisher tmc_info_pub_; + tmcl_ros::TmcInfo tmc_info_msg_; + float param_pub_rate_tmc_info_; + std::string param_tmc_info_topic_; + bool param_en_pub_tmc_info_; + uint32_t seq_ctr_; - private: - void initParams(); - - protected: - /* Publisher */ - void initPublisher(); - virtual void rosPublishTmcInfo(const ros::TimerEvent& event); - ros::Timer timer_callback; - ros::Publisher tmc_info_pub; - tmcl_ros::TmcInfo tmc_info_msg; - float param_pub_rate_tmc_info; - std::string param_tmc_info_topic; - bool param_en_pub_tmc_info; - uint32_t seq_ctr; + /* Subscriber */ + virtual void initSubscriber(); + virtual void cmdVelCallback(const geometry_msgs::Twist& msg); + virtual void cmdAbsPosCallback(const std_msgs::Int32 msg); + virtual void cmdRelPosCallback(const std_msgs::Int32 msg); + virtual void cmdTrqCallback(const std_msgs::Int32 msg); + ros::Subscriber tmc_cmd_vel_sub_; + ros::Subscriber tmc_cmd_abspos_sub_; + ros::Subscriber tmc_cmd_relpos_sub_; + ros::Subscriber tmc_cmd_trq_sub_; - /* Subscriber */ - virtual void initSubscriber(); - ros::Subscriber tmc_cmd_vel_sub; - ros::Subscriber tmc_cmd_abspos_sub; - ros::Subscriber tmc_cmd_relpos_sub; - ros::Subscriber tmc_cmd_trq_sub; - virtual void cmdVelCallback(const geometry_msgs::Twist& msg); - virtual void cmdAbsPosCallback(const std_msgs::Int32 msg); - virtual void cmdRelPosCallback(const std_msgs::Int32 msg); - virtual void cmdTrqCallback(const std_msgs::Int32 msg); + /* Pointers */ + ros::NodeHandle* p_nh_; + TmclInterpreter* p_tmcl_interpreter_; - /* Pointers */ - ros::NodeHandle* p_nh_; - TmclInterpreter* p_tmcl_int; + /* Other Variables */ + std::string param_comm_interface_name_; + std::string s_node_name_; + std::string s_namespace_; + std::string frame_id_; + uint16_t module_number_; + uint8_t motor_number_; - /* Other Variables */ - std::string param_comm_interface_name; - std::string s_node_name; - uint8_t motor_num; + /* Motor Specific Settings (Ext YAML) */ + std::string param_tmc_cmd_vel_topic_; + std::string param_tmc_cmd_abspos_topic_; + std::string param_tmc_cmd_relpos_topic_; + std::string param_tmc_cmd_trq_topic_; + bool param_pub_actual_vel_; + bool param_pub_actual_pos_; + bool param_pub_actual_trq_; + float param_wheel_diameter_; + float param_add_ratio_vel_; + float param_add_ratio_pos_; + float param_add_ratio_trq_; - /* Motor Specific Settings (Ext YAML) */ - std::string param_tmc_cmd_vel_topic; - std::string param_tmc_cmd_abspos_topic; - std::string param_tmc_cmd_relpos_topic; - std::string param_tmc_cmd_trq_topic; - bool param_pub_actual_vel; - bool param_pub_actual_pos; - bool param_pub_actual_trq; - float param_wheel_diameter; - float param_add_ratio_vel; - float param_add_ratio_pos; - float param_add_ratio_trq; +private: + /* Initialize Parameter for Motor Specific */ + void initParams(); }; #endif // TMCL_MOTOR_H diff --git a/include/tmcl_ros/tmcl_ros.h b/include/tmcl_ros/tmcl_ros.h index 1ece815..d49def8 100644 --- a/include/tmcl_ros/tmcl_ros.h +++ b/include/tmcl_ros/tmcl_ros.h @@ -11,95 +11,95 @@ #include "tmcl_bldc_motor.h" #include "tmcl_stepper_motor.h" #include "tmcl_ros/TmcParam.h" -#include -#include #include "tmcl_ros/TmcCustomCmd.h" #include "tmcl_ros/TmcGapGgpAll.h" #include "std_msgs/Int32.h" #include "std_msgs/String.h" -#define MOTOR_TYPE_BLDC 6 +const uint8_t MOTOR_TYPE_BLDC = 6; /* Parameter limits and default values */ -#define TXRX_ID_MAX 255 -#define TX_ID_DEFAULT 1 -#define RX_ID_DEFAULT 2 -#define TIMEOUT_MS_MAX 5000 -#define TIMEOUT_MS_DEFAULT 10 -#define EXEC_CMD_RETRIES_MAX 3 -#define EXEC_CMD_RETRIES_DEFAULT 1 -#define PUB_RATE_MAX 100 -#define PUB_RATE_DEFAULT 10 -#define AUTO_START_ADDITIONAL_DELAY_MAX 60 -#define AUTO_START_ADDITIONAL_DELAY_DEFAULT 0 +const uint8_t TXRX_ID_MAX = 255; +const uint8_t TX_ID_DEFAULT = 1; +const uint8_t RX_ID_DEFAULT = 2; +const uint16_t TIMEOUT_MS_MAX = 5000; +const uint8_t TIMEOUT_MS_DEFAULT = 10; +const uint8_t EXEC_CMD_RETRIES_MAX = 3; +const uint8_t EXEC_CMD_RETRIES_DEFAULT = 1; +const uint8_t PUB_RATE_MAX = 100; +const uint8_t PUB_RATE_MIN = 1; +const uint8_t PUB_RATE_DEFAULT = 10; +const uint8_t AUTO_START_ADDITIONAL_DELAY_MAX = 60; +const uint8_t AUTO_START_ADDITIONAL_DELAY_DEFAULT = 0; class TmclROS { - public: - /* Constructor */ - TmclROS(ros::NodeHandle* p_nh); - - /* Destructor */ - ~TmclROS(); - - /* Initialization */ - bool init(); - - /* De-initialization */ - bool deInit(); - - /* Getter b_retries_exceeded variable */ - bool getRetriesExceededStatus(); - - private: - /* Parameter Validation */ - bool validateParams(); - - /* Creates motor */ - void createMotor(); - - /* Initializes ROS Service */ - void initService(); - - /* ROS Services */ - ros::ServiceServer custom_cmd_server; - ros::ServiceServer gap_all_server; - ros::ServiceServer ggp_all_server; - bool tmclCustomCMDCallBack(tmcl_ros::TmcCustomCmd::Request& req, tmcl_ros::TmcCustomCmd::Response& res); - bool tmclGAPAllCallBack(tmcl_ros::TmcGapGgpAll::Request& req, tmcl_ros::TmcGapGgpAll::Response& res); - bool tmclGGPAllCallBack(tmcl_ros::TmcGapGgpAll::Request& req, tmcl_ros::TmcGapGgpAll::Response& res); - - /* Pointers */ - ros::NodeHandle *p_nh_; - TmclInterpreter *p_tmcl_int; - std::vector p_motor; - - uint8_t total_motors; - uint8_t motor_type; - - /* ROS parameters */ - std::string s_node_name; - std::string s_namespace; - - /* Autogenerated YAML*/ - std::vector param_ap_name; - std::vector param_ap_type; - std::vector param_gp_name; - std::vector param_gp_type; - - /* Ext YAML */ - int param_comm_interface; - std::string param_comm_interface_name; - int param_comm_tx_id; - int param_comm_rx_id; - int param_comm_timeout_ms; - int param_comm_exec_cmd_retries; - int param_auto_start_additional_delay; - float param_pub_rate_tmc_info; - bool param_adhoc_mode; - std::vector param_en_motors; - - tmcl_ros::TmcParam tmc_param_msg; +public: + /* Constructor */ + TmclROS(ros::NodeHandle* p_nh); + + /* Destructor */ + ~TmclROS(); + + /* Initialization */ + bool init(); + + /* De-initialization */ + bool deInit(); + + /* Getter b_retries_exceeded variable */ + bool getRetriesExceededStatus(); + +private: + /* Parameter Validation */ + bool validateParams(); + + /* Creates motor */ + void createMotor(); + + /* Initializes ROS Service */ + void initService(); + + /* ROS Services */ + bool tmclCustomCMDCallBack(tmcl_ros::TmcCustomCmd::Request& req, tmcl_ros::TmcCustomCmd::Response& res); + bool tmclGAPAllCallBack(tmcl_ros::TmcGapGgpAll::Request& req, tmcl_ros::TmcGapGgpAll::Response& res); + bool tmclGGPAllCallBack(tmcl_ros::TmcGapGgpAll::Request& req, tmcl_ros::TmcGapGgpAll::Response& res); + ros::ServiceServer custom_cmd_server_; + ros::ServiceServer gap_all_server_; + ros::ServiceServer ggp_all_server_; + + /* Pointers */ + ros::NodeHandle *p_nh_; + TmclInterpreter *p_tmcl_interpreter_; + std::vector p_motor_; + + uint16_t module_number_; + uint8_t total_motors_; + uint8_t motor_type_; + + /* ROS parameters */ + std::string s_node_name_; + std::string s_namespace_; + + /* Autogenerated YAML*/ + std::vector param_ap_name_; + std::vector param_ap_type_; + std::vector param_gp_name_; + std::vector param_gp_type_; + + /* Ext YAML */ + int param_comm_interface_; + std::string param_comm_interface_name_; + int param_comm_tx_id_; + int param_comm_rx_id_; + int param_comm_timeout_ms_; + int param_comm_exec_cmd_retries_; + int param_auto_start_additional_delay_; + float param_pub_rate_tmc_info_; + bool param_adhoc_mode_; + std::vector param_en_motors_; + + tmcl_ros::TmcParam tmc_param_msg_; }; #endif // TMCL_ROS_H diff --git a/include/tmcl_ros/tmcl_stepper_motor.h b/include/tmcl_ros/tmcl_stepper_motor.h index d4c60dc..fd2307f 100644 --- a/include/tmcl_ros/tmcl_stepper_motor.h +++ b/include/tmcl_ros/tmcl_stepper_motor.h @@ -18,30 +18,32 @@ typedef enum class StepperMotor : public Motor { - public: - /* Constructor */ - StepperMotor(ros::NodeHandle* p_nh, TmclInterpreter *p_tmcl_int, uint8_t motor_num); +public: + /* Constructor */ + StepperMotor(ros::NodeHandle* p_nh, TmclInterpreter *p_tmcl_interpreter, + uint16_t module_number, uint8_t motor_number); - /* Destructor */ - ~StepperMotor() override; + /* Destructor */ + ~StepperMotor() override; - void init() override; + /* Initialize Stepper Motor */ + void init() override; - private: - /* Publisher */ - void rosPublishTmcInfo(const ros::TimerEvent& event) override; +private: + /* Publisher */ + void rosPublishTmcInfo(const ros::TimerEvent& event) override; - /* Subscriber */ - void initSubscriber() override; - void cmdVelCallback(const geometry_msgs::Twist& msg) override; - void cmdAbsPosCallback(const std_msgs::Int32 msg) override; - void cmdRelPosCallback(const std_msgs::Int32 msg) override; - void cmdTrqCallback(const std_msgs::Int32 msg) override; + /* Subscriber */ + void initSubscriber() override; + void cmdVelCallback(const geometry_msgs::Twist& msg) override; + void cmdAbsPosCallback(const std_msgs::Int32 msg) override; + void cmdRelPosCallback(const std_msgs::Int32 msg) override; + void cmdTrqCallback(const std_msgs::Int32 msg) override; - uint16_t microstep_resolution; - uint16_t motor_fullstep_resolution; + uint16_t microstep_resolution_; + uint32_t motor_fullstep_resolution_; - stepper_comm_mode_t comm_mode; + stepper_comm_mode_t comm_mode_; }; #endif // TMCL_STEPPER_MOTOR_H diff --git a/launch/tmcm_1021.launch b/launch/tmcm_1021.launch deleted file mode 100644 index 3ec3034..0000000 --- a/launch/tmcm_1021.launch +++ /dev/null @@ -1,64 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/launch/tmcm_1070.launch b/launch/tmcm_1070.launch deleted file mode 100644 index 226e6d8..0000000 --- a/launch/tmcm_1070.launch +++ /dev/null @@ -1,64 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/launch/tmcm_1076.launch b/launch/tmcm_1076.launch deleted file mode 100644 index d202ead..0000000 --- a/launch/tmcm_1076.launch +++ /dev/null @@ -1,64 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/launch/tmcm_1110.launch b/launch/tmcm_1110.launch deleted file mode 100644 index f21b9e6..0000000 --- a/launch/tmcm_1110.launch +++ /dev/null @@ -1,64 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/launch/tmcm_1111.launch b/launch/tmcm_1111.launch deleted file mode 100644 index 131d2a3..0000000 --- a/launch/tmcm_1111.launch +++ /dev/null @@ -1,64 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/launch/tmcm_1141.launch b/launch/tmcm_1141.launch deleted file mode 100644 index cd25ade..0000000 --- a/launch/tmcm_1141.launch +++ /dev/null @@ -1,64 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/launch/tmcm_1161.launch b/launch/tmcm_1161.launch deleted file mode 100644 index f2d2bdd..0000000 --- a/launch/tmcm_1161.launch +++ /dev/null @@ -1,64 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/launch/tmcm_1181.launch b/launch/tmcm_1181.launch deleted file mode 100644 index 4514eb4..0000000 --- a/launch/tmcm_1181.launch +++ /dev/null @@ -1,64 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/launch/tmcm_1210.launch b/launch/tmcm_1210.launch deleted file mode 100644 index 43e62b1..0000000 --- a/launch/tmcm_1210.launch +++ /dev/null @@ -1,64 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/launch/tmcm_1211.launch b/launch/tmcm_1211.launch deleted file mode 100644 index 6cafbce..0000000 --- a/launch/tmcm_1211.launch +++ /dev/null @@ -1,64 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/launch/tmcm_1243.launch b/launch/tmcm_1243.launch deleted file mode 100644 index c477051..0000000 --- a/launch/tmcm_1243.launch +++ /dev/null @@ -1,64 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/launch/tmcm_1310.launch b/launch/tmcm_1310.launch deleted file mode 100644 index 9157206..0000000 --- a/launch/tmcm_1310.launch +++ /dev/null @@ -1,64 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/launch/tmcm_1316.launch b/launch/tmcm_1316.launch deleted file mode 100644 index 07ce3a1..0000000 --- a/launch/tmcm_1316.launch +++ /dev/null @@ -1,64 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/launch/tmcm_1321.launch b/launch/tmcm_1321.launch deleted file mode 100644 index 48e72d6..0000000 --- a/launch/tmcm_1321.launch +++ /dev/null @@ -1,64 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/launch/tmcm_1370.launch b/launch/tmcm_1370.launch deleted file mode 100644 index 4058ede..0000000 --- a/launch/tmcm_1370.launch +++ /dev/null @@ -1,64 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/launch/tmcm_1640.launch b/launch/tmcm_1640.launch deleted file mode 100644 index 6a162de..0000000 --- a/launch/tmcm_1640.launch +++ /dev/null @@ -1,64 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/launch/tmcm_2300.launch b/launch/tmcm_2300.launch deleted file mode 100644 index 410e924..0000000 --- a/launch/tmcm_2300.launch +++ /dev/null @@ -1,79 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/launch/tmcm_3213.launch b/launch/tmcm_3213.launch deleted file mode 100644 index 33771af..0000000 --- a/launch/tmcm_3213.launch +++ /dev/null @@ -1,95 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/launch/tmcm_3215.launch b/launch/tmcm_3215.launch deleted file mode 100644 index 4b69aa8..0000000 --- a/launch/tmcm_3215.launch +++ /dev/null @@ -1,95 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/launch/tmcm_3313.launch b/launch/tmcm_3313.launch deleted file mode 100644 index d3df61e..0000000 --- a/launch/tmcm_3313.launch +++ /dev/null @@ -1,95 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/launch/tmcm_3315.launch b/launch/tmcm_3315.launch deleted file mode 100644 index c0d8867..0000000 --- a/launch/tmcm_3315.launch +++ /dev/null @@ -1,95 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/launch/tmcm_6211.launch b/launch/tmcm_6211.launch deleted file mode 100644 index 356d587..0000000 --- a/launch/tmcm_6211.launch +++ /dev/null @@ -1,143 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/launch/tmcm_6213.launch b/launch/tmcm_6213.launch deleted file mode 100644 index 8f8856e..0000000 --- a/launch/tmcm_6213.launch +++ /dev/null @@ -1,143 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/msg/TmcInfo.msg b/msg/TmcInfo.msg index 04bf4ca..2c23a61 100644 --- a/msg/TmcInfo.msg +++ b/msg/TmcInfo.msg @@ -3,7 +3,7 @@ string interface_name float32 board_voltage int32 status_flag string status -uint8 motor_num +uint8 motor_number float32 velocity int32 position int32 torque \ No newline at end of file diff --git a/src/socket_can_wrapper.cpp b/src/socket_can_wrapper.cpp index 3059c5e..a10ea88 100644 --- a/src/socket_can_wrapper.cpp +++ b/src/socket_can_wrapper.cpp @@ -19,8 +19,8 @@ SocketCAN::SocketCAN() { ROS_DEBUG_STREAM("[SocketCAN::" << __func__ << "] called"); - can_socket = -1; - interface_name = ""; + can_socket_ = -1; + interface_name_ = ""; } SocketCAN::~SocketCAN() @@ -42,54 +42,54 @@ bool SocketCAN::initialize(const char *interface_name) b_result = true; #else - if(can_socket == -1) + if(can_socket_ == -1) { - this->interface_name = interface_name; + this->interface_name_ = interface_name; /* Create the socket */ - can_socket = socket(PF_CAN, SOCK_RAW, CAN_RAW); + can_socket_ = socket(PF_CAN, SOCK_RAW, CAN_RAW); - if (can_socket != -1) + if (can_socket_ != -1) { /* Get the interface index by interface name */ addr.can_family = AF_CAN; - strcpy(ifr.ifr_name, interface_name); + strcpy(ifr.ifr_name, interface_name_.c_str()); - if(ioctl(can_socket, SIOCGIFINDEX, &ifr) != -1) + if(ioctl(can_socket_, SIOCGIFINDEX, &ifr) != -1) { addr.can_ifindex = ifr.ifr_ifindex; /* Set the non-blocking socket flag */ - flags = fcntl(can_socket, F_GETFL, 0); + flags = fcntl(can_socket_, F_GETFL, 0); if(flags != -1) { - fcntl(can_socket, F_SETFL, flags | O_NONBLOCK); + fcntl(can_socket_, F_SETFL, flags | O_NONBLOCK); /* Bind the socket */ - if(bind(can_socket, (struct sockaddr *) &addr, sizeof(addr)) == 0) + if(bind(can_socket_, (struct sockaddr *) &addr, sizeof(addr)) == 0) { b_result = true; } else { ROS_ERROR_STREAM("[" << __func__ << "] Binding the CAN socket failed"); - close(can_socket); - can_socket = -1; + close(can_socket_); + can_socket_ = -1; } } else { ROS_ERROR_STREAM("[" << __func__ << "] Setting F_GETFL flag failed"); - close(can_socket); - can_socket = -1; + close(can_socket_); + can_socket_ = -1; } } else { ROS_ERROR_STREAM("[" << __func__ << "] Getting the interface index failed"); - close(can_socket); - can_socket = -1; + close(can_socket_); + can_socket_ = -1; } } else @@ -114,10 +114,10 @@ void SocketCAN::deinitialize() ROS_INFO_STREAM("DUMMY " << __func__ << ", always TRUE"); #else - if (can_socket != -1) + if (can_socket_ != -1) { - close(can_socket); - can_socket = -1; + close(can_socket_); + can_socket_ = -1; } #endif @@ -132,11 +132,11 @@ bool SocketCAN::framesAvailable() b_result = true; #else - if (can_socket != -1) + if (can_socket_ != -1) { struct pollfd pfd; - pfd.fd = can_socket; + pfd.fd = can_socket_; pfd.revents = 0; pfd.events = POLLIN; @@ -167,10 +167,10 @@ bool SocketCAN::readFrame(uint32_t *id, uint8_t *data, uint8_t *size) b_result = true; #else - if(can_socket != -1) + if(can_socket_ != -1) { can_frame frame; - ssize_t count = read(can_socket, &frame, sizeof(can_frame)); + ssize_t count = read(can_socket_, &frame, sizeof(can_frame)); if (count == sizeof(can_frame)) { @@ -201,7 +201,7 @@ bool SocketCAN::writeFrame(uint32_t id, uint8_t *data, uint8_t size) b_result = true; #else - if (can_socket != -1) + if (can_socket_ != -1) { can_frame frame; @@ -209,7 +209,7 @@ bool SocketCAN::writeFrame(uint32_t id, uint8_t *data, uint8_t size) frame.can_dlc = size; memcpy(frame.data, data, frame.can_dlc); - ssize_t count = write(can_socket, &frame, sizeof(can_frame)); + ssize_t count = write(can_socket_, &frame, sizeof(can_frame)); if (count == sizeof(can_frame)) { diff --git a/src/tmcl_bldc_motor.cpp b/src/tmcl_bldc_motor.cpp index d7cfacf..be5b20d 100644 --- a/src/tmcl_bldc_motor.cpp +++ b/src/tmcl_bldc_motor.cpp @@ -8,32 +8,34 @@ //////////////////////////////////////////////////////////////////////////////// /* Constructor */ -BLDCMotor::BLDCMotor(ros::NodeHandle *p_nh, TmclInterpreter* p_tmcl_int, uint8_t motor_num) : -Motor(p_nh, p_tmcl_int, motor_num) +BLDCMotor::BLDCMotor(ros::NodeHandle* p_nh, TmclInterpreter *p_tmcl_interpreter, + uint16_t module_number, uint8_t motor_number) : + Motor(p_nh, p_tmcl_interpreter, module_number, motor_number) { - b_statusflags_register_available = true; + b_statusflags_register_available_ = true; ROS_DEBUG_STREAM("[BLDCMotor::" << __func__ << "] called"); /* Save StatusFlags RegisterNames and StatusFlags RegisterShift to vector */ - const std::string s_statusflags_reg_name = s_node_name + "/StatusFlags_Reg_name"; - if(!p_nh_->getParam(s_statusflags_reg_name, param_statusflags_reg_name)) + const std::string s_statusflags_reg_name = s_node_name_ + "/StatusFlags_Reg_name"; + if(!p_nh_->getParam(s_statusflags_reg_name, param_statusflags_reg_name_)) { - b_statusflags_register_available = false; + b_statusflags_register_available_ = false; ROS_WARN_STREAM("[" << __func__ << "] StatusFlags Register Names are not available."); } - const std::string s_statusflags_reg_shift = s_node_name + "/StatusFlags_Reg_shift"; - if(b_statusflags_register_available && !p_nh_->getParam(s_statusflags_reg_shift, param_statusflags_reg_shift)) + const std::string s_statusflags_reg_shift = s_node_name_ + "/StatusFlags_Reg_shift"; + if(b_statusflags_register_available_ && !p_nh_->getParam(s_statusflags_reg_shift, param_statusflags_reg_shift_)) { - b_statusflags_register_available = false; + b_statusflags_register_available_ = false; ROS_WARN_STREAM("[" << __func__ << "] StatusFlags Register Shift are not available."); } /* Check if Reg name and Reg shift vectors have the same length/size */ - if(b_statusflags_register_available && (param_statusflags_reg_name.size() != param_statusflags_reg_shift.size())) + if(b_statusflags_register_available_ && (param_statusflags_reg_name_.size() != param_statusflags_reg_shift_.size())) { - b_statusflags_register_available = false; - ROS_WARN_STREAM("[" << __func__ << "] Missing index for StatusFlagsRegisterName / StatusFlagsRegisterShift. Check autogenerated YAML. StatusFlags wont be used!"); + b_statusflags_register_available_ = false; + ROS_WARN_STREAM("[" << __func__ << "] Missing index for StatusFlagsRegisterName / StatusFlagsRegisterShift." + "Check autogenerated YAML. StatusFlags wont be used!"); } } @@ -49,38 +51,39 @@ void BLDCMotor::init() ROS_INFO_STREAM("[BLDCMotor::" << __func__ << "] called"); - if(p_tmcl_int->executeCmd(TMCL_CMD_GAP, "CommutationMode", motor_num, &val)) + if(p_tmcl_interpreter_->executeCmd(TMCL_CMD_GAP, "CommutationMode", motor_number_, &val)) { - comm_mode = (bldc_comm_mode_t) val; + comm_mode_ = (bldc_comm_mode_t) val; } else { - comm_mode = BLDC_DISABLED_MOTOR; + comm_mode_ = BLDC_DISABLED_MOTOR; ROS_WARN_STREAM("[" << __func__ << "] \"CommutationMode\" is not available. Setting CommutationMode to Disable"); } - if(p_tmcl_int->executeCmd(TMCL_CMD_GAP, "PositionScalerM", motor_num, &val)) + if(p_tmcl_interpreter_->executeCmd(TMCL_CMD_GAP, "PositionScalerM", motor_number_, &val)) { - position_scaler = val; + position_scaler_ = val; } else { - position_scaler = 0; + position_scaler_ = 0; ROS_WARN_STREAM("[" << __func__ << "] \"PositionScalerM\" is not available"); - if(comm_mode >= BLDC_CLOSEDLOOP_MOTOR && p_tmcl_int->executeCmd(TMCL_CMD_GAP, "EncoderSteps", motor_num, &val)) + if(comm_mode_ >= BLDC_CLOSEDLOOP_MOTOR && + p_tmcl_interpreter_->executeCmd(TMCL_CMD_GAP, "EncoderSteps", motor_number_, &val)) { - encoder_steps = val; + encoder_steps_ = val; } else { - encoder_steps = 0; + encoder_steps_ = 0; ROS_WARN_STREAM("[" << __func__ << "] \"EncoderSteps\" is not available."); } } /* Print units of each commands */ - if(param_wheel_diameter == 0) + if(param_wheel_diameter_ == 0) { ROS_INFO_STREAM("[" << __func__ << "] Velocity unit: rpm"); } @@ -88,7 +91,7 @@ void BLDCMotor::init() { ROS_INFO_STREAM("[" << __func__ << "] Velocity unit: m/s"); } - if(position_scaler == 0 && encoder_steps == 0) + if(position_scaler_ == 0 && encoder_steps_ == 0) { ROS_INFO_STREAM("[" << __func__ << "] Position unit: pulses"); } @@ -101,7 +104,7 @@ void BLDCMotor::init() initPublisher(); this->initSubscriber(); - ROS_INFO("[%s] Motor %d Initialized!\n", __func__, motor_num); + ROS_INFO("[%s] Motor %d Initialized!\n", __func__, motor_number_); } /* Publisher Callback */ @@ -114,32 +117,32 @@ void BLDCMotor::rosPublishTmcInfo(const ros::TimerEvent& event) std::string binary = " "; std::string status = " "; - tmc_info_msg.header.stamp = ros::Time::now(); - tmc_info_msg.header.seq = seq_ctr; - tmc_info_msg.header.frame_id = s_node_name + "/motor" + std::to_string(motor_num) + "/tmcl_frame"; - tmc_info_msg.interface_name = param_comm_interface_name; - tmc_info_msg.motor_num = motor_num; + tmc_info_msg_.header.stamp = ros::Time::now(); + tmc_info_msg_.header.seq = seq_ctr_; + tmc_info_msg_.header.frame_id = frame_id_; + tmc_info_msg_.interface_name = param_comm_interface_name_; + tmc_info_msg_.motor_number = motor_number_; /* Initialize messages to 0 first */ - tmc_info_msg.board_voltage = 0; - tmc_info_msg.status_flag = 0; - tmc_info_msg.velocity = 0; - tmc_info_msg.position = 0; - tmc_info_msg.torque = 0; + tmc_info_msg_.board_voltage = 0; + tmc_info_msg_.status_flag = 0; + tmc_info_msg_.velocity = 0; + tmc_info_msg_.position = 0; + tmc_info_msg_.torque = 0; - if(p_tmcl_int->executeCmd(TMCL_CMD_GAP, "SupplyVoltage", motor_num, &val)) + if(p_tmcl_interpreter_->executeCmd(TMCL_CMD_GAP, "SupplyVoltage", motor_number_, &val)) { - tmc_info_msg.board_voltage = val / 10; //converts mV to V + tmc_info_msg_.board_voltage = val / 10; //converts mV to V } else { ROS_DEBUG_STREAM("[" << __func__ << "] Failed to get SupplyVoltage"); } - if(p_tmcl_int->executeCmd(TMCL_CMD_GAP, "StatusFlags", motor_num, &val)) + if(p_tmcl_interpreter_->executeCmd(TMCL_CMD_GAP, "StatusFlags", motor_number_, &val)) { - tmc_info_msg.status_flag = val; - status_flag = tmc_info_msg.status_flag; + tmc_info_msg_.status_flag = val; + status_flag = tmc_info_msg_.status_flag; } else { @@ -147,7 +150,7 @@ void BLDCMotor::rosPublishTmcInfo(const ros::TimerEvent& event) } //Parsing StatusFlags value to display status in string - if(b_statusflags_register_available) + if(b_statusflags_register_available_) { while(status_flag) { @@ -166,11 +169,11 @@ void BLDCMotor::rosPublishTmcInfo(const ros::TimerEvent& event) { if(binary[bin_index] == '1') { - while(array_index < param_statusflags_reg_shift.size()) + while(array_index < param_statusflags_reg_shift_.size()) { - if(bin_index == param_statusflags_reg_shift[array_index]) + if(bin_index == param_statusflags_reg_shift_[array_index]) { - status += param_statusflags_reg_name[array_index - 1] + ", "; + status += param_statusflags_reg_name_[array_index - 1] + ", "; array_index = 0; break; } @@ -178,26 +181,26 @@ void BLDCMotor::rosPublishTmcInfo(const ros::TimerEvent& event) } } } - tmc_info_msg.status = status; + tmc_info_msg_.status = status; } else { - tmc_info_msg.status = "StatusFlags Registers Not Available"; + tmc_info_msg_.status = "StatusFlags Registers Not Available"; } /* Velocity, Position, Torque */ - if(param_pub_actual_vel) + if(param_pub_actual_vel_) { - if(p_tmcl_int->executeCmd(TMCL_CMD_GAP, "ActualVelocity", motor_num, &val)) + if(p_tmcl_interpreter_->executeCmd(TMCL_CMD_GAP, "ActualVelocity", motor_number_, &val)) { //converts rpm to linear velocity - if(param_wheel_diameter == 0) + if(param_wheel_diameter_ == 0) { - tmc_info_msg.velocity = val * param_add_ratio_vel; + tmc_info_msg_.velocity = val * param_add_ratio_vel_; } else { - tmc_info_msg.velocity = ((val * PI * param_wheel_diameter) / SECS_TO_MIN) * param_add_ratio_vel; + tmc_info_msg_.velocity = val * ((PI * param_wheel_diameter_) / SECS_TO_MIN) * param_add_ratio_vel_; } } else @@ -206,22 +209,22 @@ void BLDCMotor::rosPublishTmcInfo(const ros::TimerEvent& event) } } - if(param_pub_actual_pos) + if(param_pub_actual_pos_) { - if(p_tmcl_int->executeCmd(TMCL_CMD_GAP, "ActualPosition", motor_num, &val)) + if(p_tmcl_interpreter_->executeCmd(TMCL_CMD_GAP, "ActualPosition", motor_number_, &val)) { //converts steps to degrees - if(position_scaler > 0) + if(position_scaler_ > 0) { - tmc_info_msg.position = ((val * ANGULAR_FULL_ROTATION) / position_scaler) * param_add_ratio_pos; + tmc_info_msg_.position = val * (ANGULAR_FULL_ROTATION / (float)position_scaler_) * param_add_ratio_pos_; } - else if(encoder_steps > 0) + else if(encoder_steps_ > 0) { - tmc_info_msg.position = ((val * ANGULAR_FULL_ROTATION) / encoder_steps) * param_add_ratio_pos; + tmc_info_msg_.position = val * (ANGULAR_FULL_ROTATION / (float)encoder_steps_) * param_add_ratio_pos_; } else { - tmc_info_msg.position = val * param_add_ratio_pos; + tmc_info_msg_.position = val * param_add_ratio_pos_; } } else @@ -230,11 +233,11 @@ void BLDCMotor::rosPublishTmcInfo(const ros::TimerEvent& event) } } - if(param_pub_actual_trq) + if(param_pub_actual_trq_) { - if(p_tmcl_int->executeCmd(TMCL_CMD_GAP, "ActualTorque", motor_num, &val)) + if(p_tmcl_interpreter_->executeCmd(TMCL_CMD_GAP, "ActualTorque", motor_number_, &val)) { - tmc_info_msg.torque = val * param_add_ratio_trq; + tmc_info_msg_.torque = val * param_add_ratio_trq_; } else { @@ -242,8 +245,8 @@ void BLDCMotor::rosPublishTmcInfo(const ros::TimerEvent& event) } } - tmc_info_pub.publish(tmc_info_msg); - seq_ctr++; + tmc_info_pub_.publish(tmc_info_msg_); + seq_ctr_++; } /* Initialize Subscriber */ @@ -251,14 +254,14 @@ void BLDCMotor::initSubscriber() { ROS_INFO_STREAM("[BLDCMotor::" << __func__ << "] called"); - if(comm_mode == BLDC_OPENLOOP_MOTOR) + if(comm_mode_ == BLDC_OPENLOOP_MOTOR) { ROS_INFO_STREAM("[" << __func__ << "] CommutationMode : OPENLOOP"); - tmc_cmd_vel_sub = p_nh_->subscribe(param_tmc_cmd_vel_topic, 1000, &BLDCMotor::cmdVelCallback, this); - tmc_cmd_abspos_sub = p_nh_->subscribe(param_tmc_cmd_abspos_topic, 1000, &BLDCMotor::cmdAbsPosCallback, this); - tmc_cmd_relpos_sub = p_nh_->subscribe(param_tmc_cmd_relpos_topic, 1000, &BLDCMotor::cmdRelPosCallback, this); + tmc_cmd_vel_sub_ = p_nh_->subscribe(param_tmc_cmd_vel_topic_, 1000, &BLDCMotor::cmdVelCallback, this); + tmc_cmd_abspos_sub_ = p_nh_->subscribe(param_tmc_cmd_abspos_topic_, 1000, &BLDCMotor::cmdAbsPosCallback, this); + tmc_cmd_relpos_sub_ = p_nh_->subscribe(param_tmc_cmd_relpos_topic_, 1000, &BLDCMotor::cmdRelPosCallback, this); } - else if(comm_mode >= BLDC_CLOSEDLOOP_MOTOR) + else if(comm_mode_ >= BLDC_CLOSEDLOOP_MOTOR) { ROS_INFO_STREAM("[" << __func__ << "] CommutationMode : CLOSEDLOOP"); Motor::initSubscriber(); @@ -273,21 +276,22 @@ void BLDCMotor::cmdVelCallback(const geometry_msgs::Twist& msg) int32_t board_val = 0; //If wheel diameter is set to 0 (or no wheels connected), the input value for linearX is equal to motors rpm - if(param_wheel_diameter == 0) + if(param_wheel_diameter_ == 0) { - board_val = val / param_add_ratio_vel; + board_val = val / param_add_ratio_vel_; } else { //Formula to convert linear value to rpm (unit that the board accepts) - board_val = ((val * SECS_TO_MIN) / (PI * param_wheel_diameter)) / param_add_ratio_vel; + board_val = val * (SECS_TO_MIN / (PI * param_wheel_diameter_)) * (1 / param_add_ratio_vel_); } - ROS_DEBUG_STREAM("[" << __func__ << "] Subscriber callback entered, received: " << val << " board value: " << board_val); + ROS_DEBUG_STREAM("[" << __func__ << "] Subscriber callback entered, received: " << val + << " board value: " << board_val); if(board_val >= 0) { - if(p_tmcl_int->executeCmd(TMCL_CMD_ROR, 0, motor_num, &board_val)) + if(p_tmcl_interpreter_->executeCmd(TMCL_CMD_ROR, 0, motor_number_, &board_val)) { ROS_DEBUG_STREAM("\n[" << __func__ << "] Subscriber callback exited successfully"); } @@ -299,7 +303,7 @@ void BLDCMotor::cmdVelCallback(const geometry_msgs::Twist& msg) else { board_val = abs(board_val); - if(p_tmcl_int->executeCmd(TMCL_CMD_ROL, 0, motor_num, &board_val)) + if(p_tmcl_interpreter_->executeCmd(TMCL_CMD_ROL, 0, motor_number_, &board_val)) { ROS_DEBUG_STREAM("\n[" << __func__ << "] Subscriber callback exited successfully"); } @@ -316,25 +320,26 @@ void BLDCMotor::cmdAbsPosCallback(const std_msgs::Int32 msg) int32_t val = msg.data; //convert input(degrees) to unit - if(position_scaler > 0) + if(position_scaler_ > 0) { - convert_const_deg = (position_scaler / (float) ANGULAR_FULL_ROTATION) / param_add_ratio_pos; + convert_const_deg = ((float)position_scaler_ / ANGULAR_FULL_ROTATION) * (1 / param_add_ratio_pos_); } - else if(encoder_steps > 0) + else if(encoder_steps_ > 0) { - convert_const_deg = (encoder_steps / (float) ANGULAR_FULL_ROTATION) / param_add_ratio_pos; + convert_const_deg = ((float)encoder_steps_ / ANGULAR_FULL_ROTATION) * (1 / param_add_ratio_pos_); } else { //inverting position additional ratio - convert_const_deg = 1 / param_add_ratio_pos; + convert_const_deg = 1 / param_add_ratio_pos_; } unit_val = val * convert_const_deg; - ROS_DEBUG_STREAM("[" << __func__ << "] Subscriber callback entered, received: " << val << " board value: " << unit_val); + ROS_DEBUG_STREAM("[" << __func__ << "] Subscriber callback entered, received: " << val << " board value: " + << unit_val); - if(p_tmcl_int->executeCmd(TMCL_CMD_MVP, 0, motor_num, &unit_val)) + if(p_tmcl_interpreter_->executeCmd(TMCL_CMD_MVP, 0, motor_number_, &unit_val)) { ROS_DEBUG_STREAM("\n[" << __func__ << "] Subscriber callback exited successfully"); } @@ -350,25 +355,26 @@ void BLDCMotor::cmdRelPosCallback(const std_msgs::Int32 msg) int32_t val = msg.data; //convert input(degrees) to unit - if(position_scaler > 0) + if(position_scaler_ > 0) { - convert_const_deg = (position_scaler / (float) ANGULAR_FULL_ROTATION) / param_add_ratio_pos; + convert_const_deg = ((float)position_scaler_ / ANGULAR_FULL_ROTATION) * (1 / param_add_ratio_pos_); } - else if(encoder_steps > 0) + else if(encoder_steps_ > 0) { - convert_const_deg = (encoder_steps / (float) ANGULAR_FULL_ROTATION) / param_add_ratio_pos; + convert_const_deg = ((float)encoder_steps_ / ANGULAR_FULL_ROTATION) * (1 / param_add_ratio_pos_); } else { //inverting position additional ratio - convert_const_deg = 1 / param_add_ratio_pos; + convert_const_deg = 1 / param_add_ratio_pos_; } unit_val = val * convert_const_deg; - ROS_DEBUG_STREAM("[" << __func__ << "] Subscriber callback entered, received: " << val << " board value: " << unit_val); + ROS_DEBUG_STREAM("[" << __func__ << "] Subscriber callback entered, received: " << val << " board value: " + << unit_val); - if(p_tmcl_int->executeCmd(TMCL_CMD_MVP, 1, motor_num, &unit_val)) + if(p_tmcl_interpreter_->executeCmd(TMCL_CMD_MVP, 1, motor_number_, &unit_val)) { ROS_DEBUG_STREAM("\n[" << __func__ << "] Subscriber callback exited successfully"); } diff --git a/src/tmcl_interpreter.cpp b/src/tmcl_interpreter.cpp index 5e4f53c..d3125ad 100644 --- a/src/tmcl_interpreter.cpp +++ b/src/tmcl_interpreter.cpp @@ -9,25 +9,26 @@ //////////////////////////////////////////////////////////////////////////////// /* Constructor */ -TmclInterpreter::TmclInterpreter(uint16_t timeout_ms, uint8_t comm_exec_cmd_retries, std::vector param_ap_name, std::vector param_ap_type) : -timeout_ms(timeout_ms), -comm_exec_cmd_retries(comm_exec_cmd_retries), -param_ap_name(param_ap_name), -param_ap_type(param_ap_type) +TmclInterpreter::TmclInterpreter(uint16_t timeout_ms, uint8_t comm_exec_cmd_retries, + std::vector param_ap_name, std::vector param_ap_type) : + timeout_ms_(timeout_ms), + comm_exec_cmd_retries_(comm_exec_cmd_retries), + param_ap_name_(param_ap_name), + param_ap_type_(param_ap_type) { ROS_DEBUG_STREAM("[TmclInterpreter::" << __func__ << "] called"); - tmcl_interface = TMCL_INTERFACE_CAN; + tmcl_interface_ = TMCL_INTERFACE_CAN; - if(tmcl_interface == TMCL_INTERFACE_CAN) + if(tmcl_interface_ == TMCL_INTERFACE_CAN) { - tmcl_cfg.p_socket_can = nullptr; - tmcl_cfg.interface_name = "can0"; - tmcl_cfg.tx_id = 1; - tmcl_cfg.rx_id = 2; + tmcl_cfg_.p_socket_can = nullptr; + tmcl_cfg_.interface_name = "can0"; + tmcl_cfg_.tx_id = 1; + tmcl_cfg_.rx_id = 2; } - interface_enabled = false; - b_retries_exceeded = false; + interface_enabled_ = false; + b_retries_exceeded_ = false; } /* Destructor */ @@ -35,13 +36,13 @@ TmclInterpreter::~TmclInterpreter() { ROS_DEBUG_STREAM("[TmclInterpreter::" << __func__ << "] called"); - if(tmcl_interface == TMCL_INTERFACE_CAN) + if(tmcl_interface_ == TMCL_INTERFACE_CAN) { - tmcl_cfg.interface_name = ""; - tmcl_cfg.tx_id = 0; - tmcl_cfg.rx_id = 0; + tmcl_cfg_.interface_name = ""; + tmcl_cfg_.tx_id = 0; + tmcl_cfg_.rx_id = 0; } - interface_enabled = false; + interface_enabled_ = false; } /* Reset interface */ @@ -51,14 +52,14 @@ bool TmclInterpreter::resetInterface() bool b_result = false; - if(tmcl_interface == TMCL_INTERFACE_CAN) + if(tmcl_interface_ == TMCL_INTERFACE_CAN) { - tmcl_cfg.p_socket_can = new SocketCAN(); + tmcl_cfg_.p_socket_can = new SocketCAN(); - if(tmcl_cfg.p_socket_can->initialize(tmcl_cfg.interface_name.c_str())) + if(tmcl_cfg_.p_socket_can->initialize(tmcl_cfg_.interface_name.c_str())) { ROS_INFO_STREAM("[" << __func__ <<"] called"); - interface_enabled = true; + interface_enabled_ = true; b_result = true; } } @@ -76,19 +77,19 @@ bool TmclInterpreter::executeCmd(tmcl_cmd_t cmd, uint8_t type, uint8_t motor, in ROS_DEBUG_STREAM("[" << __func__ << "] called"); bool b_result = false; - uint8_t n_retries = comm_exec_cmd_retries; + uint8_t n_retries = comm_exec_cmd_retries_; uint8_t rx_msg[TMCL_MSG_SZ] = {0}; uint32_t rx_msg_id = 0; uint8_t rx_msg_sz = 0; tmcl_msg_t tmcl_msg; - if(interface_enabled) + if(interface_enabled_) { - if(tmcl_interface == TMCL_INTERFACE_CAN) + if(tmcl_interface_ == TMCL_INTERFACE_CAN) { - tmcl_msg.tx_id = tmcl_cfg.tx_id; - tmcl_msg.rx_id = tmcl_cfg.rx_id; + tmcl_msg.tx_id = tmcl_cfg_.tx_id; + tmcl_msg.rx_id = tmcl_cfg_.rx_id; tmcl_msg.cmd = cmd; tmcl_msg.type = type; tmcl_msg.motor = motor; @@ -97,21 +98,25 @@ bool TmclInterpreter::executeCmd(tmcl_cmd_t cmd, uint8_t type, uint8_t motor, in tmcl_msg.value[2] = (*val & 0x0000FF00) >> 8; tmcl_msg.value[3] = (*val & 0x000000FF); // Setting cmd, type, motor, value is always needed every call to execute_cmd() - uint8_t tx_msg[TMCL_MSG_SZ] = {tmcl_msg.cmd, tmcl_msg.type, tmcl_msg.motor, tmcl_msg.value[0], tmcl_msg.value[1], tmcl_msg.value[2], tmcl_msg.value[3]}; + uint8_t tx_msg[TMCL_MSG_SZ] = {tmcl_msg.cmd, tmcl_msg.type, tmcl_msg.motor, tmcl_msg.value[0], + tmcl_msg.value[1], tmcl_msg.value[2], tmcl_msg.value[3]}; auto start_time = std::chrono::system_clock::now(); auto end_time = start_time; while (0 < n_retries) { - ROS_DEBUG("[%s] [T%d] before execute_cmd(), value=%d sending [0x%02x 0x%02x 0x%02x 0x%02x 0x%02x 0x%02x 0x%02x 0x%02x]", __func__, n_retries, - *val, tmcl_msg.tx_id, tmcl_msg.cmd, tmcl_msg.type, tmcl_msg.motor, tmcl_msg.value[0], tmcl_msg.value[1], tmcl_msg.value[2], tmcl_msg.value[3]); + ROS_DEBUG("[%s] [T%d] before execute_cmd(), value=%d sending " + "[0x%02x 0x%02x 0x%02x 0x%02x 0x%02x 0x%02x 0x%02x 0x%02x]", __func__, n_retries, *val, tmcl_msg.tx_id, + tmcl_msg.cmd, tmcl_msg.type, tmcl_msg.motor, tmcl_msg.value[0], tmcl_msg.value[1], tmcl_msg.value[2], + tmcl_msg.value[3]); /* Send TMCL command */ - if(tmcl_cfg.p_socket_can->writeFrame(tmcl_msg.tx_id, tx_msg, TMCL_MSG_SZ)) + if(tmcl_cfg_.p_socket_can->writeFrame(tmcl_msg.tx_id, tx_msg, TMCL_MSG_SZ)) { - while(timeout_ms > std::chrono::duration_cast(end_time - start_time).count()) + while(timeout_ms_ > std::chrono::duration_cast(end_time - start_time).count()) { - if(tmcl_cfg.p_socket_can->framesAvailable() && tmcl_cfg.p_socket_can->readFrame(&rx_msg_id, rx_msg, &rx_msg_sz)) + if(tmcl_cfg_.p_socket_can->framesAvailable() && + tmcl_cfg_.p_socket_can->readFrame(&rx_msg_id, rx_msg, &rx_msg_sz)) { /* A response for the TMCL command is received */ if((rx_msg_id == tmcl_msg.rx_id) && @@ -125,10 +130,13 @@ bool TmclInterpreter::executeCmd(tmcl_cmd_t cmd, uint8_t type, uint8_t motor, in tmcl_msg.value[2] = rx_msg[5]; tmcl_msg.value[3] = rx_msg[6]; - //* - Rx: | [[Reply Address]] | | | | | | | | [[Checksum]] - ROS_DEBUG("\n[%s] [T%d] execute_cmd() success, received [0x%02x 0x%02x 0x%02x 0x%02x 0x%02x 0x%02x 0x%02x]\n", __func__, n_retries, - tmcl_msg.tx_id, tmcl_msg.sts, tmcl_msg.cmd, tmcl_msg.value[0], tmcl_msg.value[1], tmcl_msg.value[2], tmcl_msg.value[3]); - *val = (tmcl_msg.value[0] << 24) + (tmcl_msg.value[1] << 16) + (tmcl_msg.value[2] << 8) + tmcl_msg.value[3]; + //Rx: [Reply Address] | | | | | | | | [Checksum] + ROS_DEBUG("\n[%s] [T%d] execute_cmd() success, received " + "[0x%02x 0x%02x 0x%02x 0x%02x 0x%02x 0x%02x 0x%02x]\n", __func__, n_retries, tmcl_msg.tx_id, + tmcl_msg.sts, tmcl_msg.cmd, tmcl_msg.value[0], tmcl_msg.value[1], tmcl_msg.value[2], + tmcl_msg.value[3]); + *val = (tmcl_msg.value[0] << 24) + (tmcl_msg.value[1] << 16) + (tmcl_msg.value[2] << 8) + + tmcl_msg.value[3]; b_result = true; break; } @@ -149,7 +157,7 @@ bool TmclInterpreter::executeCmd(tmcl_cmd_t cmd, uint8_t type, uint8_t motor, in if(n_retries == 0) { - b_retries_exceeded = true; + b_retries_exceeded_ = true; ROS_ERROR_STREAM("[" << __func__ << "] Retries exceeded"); } } @@ -168,12 +176,12 @@ bool TmclInterpreter::executeCmd(tmcl_cmd_t cmd, std::string type, uint8_t motor uint8_t int_type = 0; uint8_t index = 0; - auto iterator = std::find(param_ap_name.begin(), param_ap_name.end(), type); + auto iterator = std::find(param_ap_name_.begin(), param_ap_name_.end(), type); - if(iterator != param_ap_name.end()) + if(iterator != param_ap_name_.end()) { - index = std::distance(param_ap_name.begin(), iterator); - int_type = param_ap_type[index]; + index = std::distance(param_ap_name_.begin(), iterator); + int_type = param_ap_type_[index]; b_result = executeCmd(cmd, int_type, motor, val); } else @@ -191,20 +199,20 @@ bool TmclInterpreter::shutdownInterface() ROS_INFO_STREAM("[TmclInterpreter::" << __func__ << "] called"); - if(tmcl_interface == TMCL_INTERFACE_CAN) + if(tmcl_interface_ == TMCL_INTERFACE_CAN) { - tmcl_cfg.p_socket_can->deinitialize(); - delete tmcl_cfg.p_socket_can; - tmcl_cfg.p_socket_can = nullptr; - interface_enabled = false; + tmcl_cfg_.p_socket_can->deinitialize(); + delete tmcl_cfg_.p_socket_can; + tmcl_cfg_.p_socket_can = nullptr; + interface_enabled_ = false; b_result = true; } return b_result; } -/* Getter b_retries_exceeded variable */ +/* Getter b_retries_exceeded_ variable */ bool TmclInterpreter::getRetriesExceededStatus() { - return b_retries_exceeded; + return b_retries_exceeded_; } diff --git a/src/tmcl_motor.cpp b/src/tmcl_motor.cpp index d793935..83a3e9b 100644 --- a/src/tmcl_motor.cpp +++ b/src/tmcl_motor.cpp @@ -8,10 +8,12 @@ //////////////////////////////////////////////////////////////////////////////// /* Constructor */ -Motor::Motor(ros::NodeHandle *p_nh, TmclInterpreter* p_tmcl_int, uint8_t motor_num) : -p_nh_ (p_nh), -p_tmcl_int(p_tmcl_int), -motor_num(motor_num) +Motor::Motor(ros::NodeHandle *p_nh, TmclInterpreter* p_tmcl_interpreter, + uint16_t module_number, uint8_t motor_number) : + p_nh_ (p_nh), + p_tmcl_interpreter_(p_tmcl_interpreter), + module_number_(module_number), + motor_number_(motor_number) { ROS_DEBUG_STREAM("[Motor::" << __func__ << "] called"); initParams(); @@ -21,7 +23,7 @@ motor_num(motor_num) Motor::~Motor() { ROS_DEBUG_STREAM("[Motor::" << __func__ << "] called"); - p_tmcl_int = nullptr; + p_tmcl_interpreter_ = nullptr; p_nh_ = nullptr; } @@ -31,7 +33,7 @@ void Motor::init() initPublisher(); initSubscriber(); - ROS_INFO("[%s] Motor %d Initialized!\n", __func__, motor_num); + ROS_INFO("[%s] Motor %d Initialized!\n", __func__, motor_number_); } /* Initialize Parameters */ @@ -40,105 +42,125 @@ void Motor::initParams() ROS_INFO_STREAM("[Motor::" << __func__ << "] called"); - s_node_name = ros::this_node::getName(); + s_node_name_ = ros::this_node::getName(); - const std::string s_en_pub_tmc_info = s_node_name + "/motor"+ std::to_string(motor_num) + "/en_pub_tmc_info"; - if(!p_nh_->getParam(s_en_pub_tmc_info, param_en_pub_tmc_info)) + const std::string s_en_pub_tmc_info = s_node_name_ + "/motor"+ std::to_string(motor_number_) + "/en_pub_tmc_info"; + if(!p_nh_->getParam(s_en_pub_tmc_info, param_en_pub_tmc_info_)) { - param_en_pub_tmc_info = false; - p_nh_->setParam(s_en_pub_tmc_info, param_en_pub_tmc_info); - ROS_WARN_STREAM("[" << __func__ << "] Failed to get en_pub_tmc_info for motor"<< std::to_string(motor_num) <<", setting to default value: " << std::boolalpha << param_en_pub_tmc_info); + param_en_pub_tmc_info_ = false; + p_nh_->setParam(s_en_pub_tmc_info, param_en_pub_tmc_info_); + ROS_WARN_STREAM("[" << __func__ << "] Failed to get en_pub_tmc_info for motor" << std::to_string(motor_number_) + << ", setting to default value: " << std::boolalpha << param_en_pub_tmc_info_); } - const std::string s_pub_actual_vel = s_node_name + "/motor"+ std::to_string(motor_num) + "/pub_actual_vel"; - if(!p_nh_->getParam(s_pub_actual_vel, param_pub_actual_vel)) + const std::string s_pub_actual_vel = s_node_name_ + "/motor"+ std::to_string(motor_number_) + "/pub_actual_vel"; + if(!p_nh_->getParam(s_pub_actual_vel, param_pub_actual_vel_)) { - param_pub_actual_vel = false; - p_nh_->setParam(s_pub_actual_vel, param_pub_actual_vel); - ROS_WARN_STREAM("[" << __func__ << "] Failed to get pub_actual_vel for motor"<< std::to_string(motor_num) <<", setting to default value: " << std::boolalpha << param_pub_actual_vel); + param_pub_actual_vel_ = false; + p_nh_->setParam(s_pub_actual_vel, param_pub_actual_vel_); + ROS_WARN_STREAM("[" << __func__ << "] Failed to get pub_actual_vel for motor" << std::to_string(motor_number_) + << ", setting to default value: " << std::boolalpha << param_pub_actual_vel_); } - const std::string s_pub_actual_pos = s_node_name + "/motor"+ std::to_string(motor_num) + "/pub_actual_pos"; - if(!p_nh_->getParam(s_pub_actual_pos, param_pub_actual_pos)) + const std::string s_pub_actual_pos = s_node_name_ + "/motor"+ std::to_string(motor_number_) + "/pub_actual_pos"; + if(!p_nh_->getParam(s_pub_actual_pos, param_pub_actual_pos_)) { - param_pub_actual_pos = false; - p_nh_->setParam(s_pub_actual_pos, param_pub_actual_pos); - ROS_WARN_STREAM("[" << __func__ << "] Failed to get pub_actual_pos for motor"<< std::to_string(motor_num) <<", setting to default value: " << std::boolalpha << param_pub_actual_pos); + param_pub_actual_pos_ = false; + p_nh_->setParam(s_pub_actual_pos, param_pub_actual_pos_); + ROS_WARN_STREAM("[" << __func__ << "] Failed to get pub_actual_pos for motor" << std::to_string(motor_number_) + << ", setting to default value: " << std::boolalpha << param_pub_actual_pos_); } - const std::string s_pub_actual_trq = s_node_name + "/motor"+ std::to_string(motor_num) + "/pub_actual_trq"; - if(!p_nh_->getParam(s_pub_actual_trq, param_pub_actual_trq)) + const std::string s_pub_actual_trq = s_node_name_ + "/motor"+ std::to_string(motor_number_) + "/pub_actual_trq"; + if(!p_nh_->getParam(s_pub_actual_trq, param_pub_actual_trq_)) { - param_pub_actual_trq = false; - p_nh_->setParam(s_pub_actual_trq, param_pub_actual_trq); - ROS_WARN_STREAM("[" << __func__ << "] Failed to get pub_actual_trq for motor"<< std::to_string(motor_num) <<", setting to default value: " << std::boolalpha << param_pub_actual_trq); + param_pub_actual_trq_ = false; + p_nh_->setParam(s_pub_actual_trq, param_pub_actual_trq_); + ROS_WARN_STREAM("[" << __func__ << "] Failed to get pub_actual_trq for motor" << std::to_string(motor_number_) + << ", setting to default value: " << std::boolalpha << param_pub_actual_trq_); } - const std::string s_tmc_info_topic = s_node_name + "/motor"+ std::to_string(motor_num) + "/tmc_info_topic"; - if(!p_nh_->getParam(s_tmc_info_topic, param_tmc_info_topic)) + const std::string s_tmc_info_topic = s_node_name_ + "/motor"+ std::to_string(motor_number_) + "/tmc_info_topic"; + if(!p_nh_->getParam(s_tmc_info_topic, param_tmc_info_topic_)) { - param_tmc_info_topic = "/tmc_info_" + std::to_string(motor_num); - p_nh_->setParam(s_tmc_info_topic, param_tmc_info_topic); - ROS_WARN_STREAM("[" << __func__ << "] Failed to get tmc_info_topic for motor"<< std::to_string(motor_num) <<", setting to default value: " << param_tmc_info_topic); + param_tmc_info_topic_ = "/tmc_info_" + std::to_string(motor_number_); + p_nh_->setParam(s_tmc_info_topic, param_tmc_info_topic_); + ROS_WARN_STREAM("[" << __func__ << "] Failed to get tmc_info_topic for motor" << std::to_string(motor_number_) + << ", setting to default value: " << param_tmc_info_topic_); } - const std::string s_tmc_cmd_vel_topic = s_node_name + "/motor"+ std::to_string(motor_num) + "/tmc_cmd_vel_topic"; - if(!p_nh_->getParam(s_tmc_cmd_vel_topic, param_tmc_cmd_vel_topic)) + const std::string s_tmc_cmd_vel_topic = s_node_name_ + "/motor"+ std::to_string(motor_number_) + + "/tmc_cmd_vel_topic"; + if(!p_nh_->getParam(s_tmc_cmd_vel_topic, param_tmc_cmd_vel_topic_)) { - param_tmc_cmd_vel_topic = "/cmd_vel_" + std::to_string(motor_num); - p_nh_->setParam(s_tmc_cmd_vel_topic, param_tmc_cmd_vel_topic); - ROS_WARN_STREAM("[" << __func__ << "] Failed to get tmc_cmd_vel_topic for motor"<< std::to_string(motor_num) <<", setting to default value: " << param_tmc_cmd_vel_topic); + param_tmc_cmd_vel_topic_ = "/cmd_vel_" + std::to_string(motor_number_); + p_nh_->setParam(s_tmc_cmd_vel_topic, param_tmc_cmd_vel_topic_); + ROS_WARN_STREAM("[" << __func__ << "] Failed to get tmc_cmd_vel_topic for motor" << std::to_string(motor_number_) + << ", setting to default value: " << param_tmc_cmd_vel_topic_); } - const std::string s_tmc_cmd_abspos_topic = s_node_name + "/motor"+ std::to_string(motor_num) + "/tmc_cmd_abspos_topic"; - if(!p_nh_->getParam(s_tmc_cmd_abspos_topic, param_tmc_cmd_abspos_topic)) + const std::string s_tmc_cmd_abspos_topic = s_node_name_ + "/motor"+ std::to_string(motor_number_) + + "/tmc_cmd_abspos_topic"; + if(!p_nh_->getParam(s_tmc_cmd_abspos_topic, param_tmc_cmd_abspos_topic_)) { - param_tmc_cmd_abspos_topic = "/cmd_abspos_" + std::to_string(motor_num); - p_nh_->setParam(s_tmc_cmd_abspos_topic, param_tmc_cmd_abspos_topic); - ROS_WARN_STREAM("[" << __func__ << "] Failed to get tmc_cmd_abspos_topic for motor"<< std::to_string(motor_num) <<", setting to default value: " << param_tmc_cmd_abspos_topic); + param_tmc_cmd_abspos_topic_ = "/cmd_abspos_" + std::to_string(motor_number_); + p_nh_->setParam(s_tmc_cmd_abspos_topic, param_tmc_cmd_abspos_topic_); + ROS_WARN_STREAM("[" << __func__ << "] Failed to get tmc_cmd_abspos_topic for motor" + << std::to_string(motor_number_) << ", setting to default value: " << param_tmc_cmd_abspos_topic_); } - const std::string s_tmc_cmd_relpos_topic = s_node_name + "/motor"+ std::to_string(motor_num) + "/tmc_cmd_relpos_topic"; - if(!p_nh_->getParam(s_tmc_cmd_relpos_topic, param_tmc_cmd_relpos_topic)) + const std::string s_tmc_cmd_relpos_topic = s_node_name_ + "/motor"+ std::to_string(motor_number_) + + "/tmc_cmd_relpos_topic"; + if(!p_nh_->getParam(s_tmc_cmd_relpos_topic, param_tmc_cmd_relpos_topic_)) { - param_tmc_cmd_relpos_topic = "/cmd_relpos_" + std::to_string(motor_num); - p_nh_->setParam(s_tmc_cmd_relpos_topic, param_tmc_cmd_relpos_topic); - ROS_WARN_STREAM("[" << __func__ << "] Failed to get tmc_cmd_relpos_topic for motor"<< std::to_string(motor_num) <<", setting to default value: " << param_tmc_cmd_relpos_topic); + param_tmc_cmd_relpos_topic_ = "/cmd_relpos_" + std::to_string(motor_number_); + p_nh_->setParam(s_tmc_cmd_relpos_topic, param_tmc_cmd_relpos_topic_); + ROS_WARN_STREAM("[" << __func__ << "] Failed to get tmc_cmd_relpos_topic for motor" + << std::to_string(motor_number_) << ", setting to default value: " << param_tmc_cmd_relpos_topic_); } - const std::string s_tmc_cmd_trq_topic = s_node_name + "/motor"+ std::to_string(motor_num) + "/tmc_cmd_trq_topic"; - if(!p_nh_->getParam(s_tmc_cmd_trq_topic, param_tmc_cmd_trq_topic)) + const std::string s_tmc_cmd_trq_topic = s_node_name_ + "/motor"+ std::to_string(motor_number_) + + "/tmc_cmd_trq_topic"; + if(!p_nh_->getParam(s_tmc_cmd_trq_topic, param_tmc_cmd_trq_topic_)) { - param_tmc_cmd_trq_topic = "/cmd_trq_" + std::to_string(motor_num); - p_nh_->setParam(s_tmc_cmd_trq_topic, param_tmc_cmd_trq_topic); - ROS_WARN_STREAM("[" << __func__ << "] Failed to get tmc_cmd_trq_topic for motor"<< std::to_string(motor_num) <<", setting to default value: " << param_tmc_cmd_trq_topic); + param_tmc_cmd_trq_topic_ = "/cmd_trq_" + std::to_string(motor_number_); + p_nh_->setParam(s_tmc_cmd_trq_topic, param_tmc_cmd_trq_topic_); + ROS_WARN_STREAM("[" << __func__ << "] Failed to get tmc_cmd_trq_topic for motor" << std::to_string(motor_number_) + << ", setting to default value: " << param_tmc_cmd_trq_topic_); } - const std::string s_wheel_diameter = s_node_name + "/motor"+ std::to_string(motor_num) + "/wheel_diameter"; - if(!p_nh_->getParam(s_wheel_diameter, param_wheel_diameter)) + const std::string s_wheel_diameter = s_node_name_ + "/motor"+ std::to_string(motor_number_) + "/wheel_diameter"; + if(!p_nh_->getParam(s_wheel_diameter, param_wheel_diameter_)) { - param_wheel_diameter = 0; - p_nh_->setParam(s_wheel_diameter, param_wheel_diameter); - ROS_WARN_STREAM("[" << __func__ << "] Failed to get wheel_diameter for motor"<< std::to_string(motor_num) <<", setting to default value: " << param_wheel_diameter); + param_wheel_diameter_ = 0; + p_nh_->setParam(s_wheel_diameter, param_wheel_diameter_); + ROS_WARN_STREAM("[" << __func__ << "] Failed to get wheel_diameter for motor" << std::to_string(motor_number_) + << ", setting to default value: " << param_wheel_diameter_); } - const std::string s_additional_ratio_vel = s_node_name + "/motor"+ std::to_string(motor_num) + "/additional_ratio_vel"; - if(!p_nh_->getParam(s_additional_ratio_vel, param_add_ratio_vel)) + const std::string s_additional_ratio_vel = s_node_name_ + "/motor"+ std::to_string(motor_number_) + + "/additional_ratio_vel"; + if(!p_nh_->getParam(s_additional_ratio_vel, param_add_ratio_vel_)) { - param_add_ratio_vel = 1; - p_nh_->setParam(s_additional_ratio_vel, param_add_ratio_vel); - ROS_WARN_STREAM("[" << __func__ << "] Failed to get additional_ratio_vel for motor"<< std::to_string(motor_num) <<", setting to default value: " << param_add_ratio_vel); + param_add_ratio_vel_ = 1; + p_nh_->setParam(s_additional_ratio_vel, param_add_ratio_vel_); + ROS_WARN_STREAM("[" << __func__ << "] Failed to get additional_ratio_vel for motor" + << std::to_string(motor_number_) << ", setting to default value: " << param_add_ratio_vel_); } - const std::string s_additional_ratio_pos = s_node_name + "/motor"+ std::to_string(motor_num) + "/additional_ratio_pos"; - if(!p_nh_->getParam(s_additional_ratio_pos, param_add_ratio_pos)) + const std::string s_additional_ratio_pos = s_node_name_ + "/motor"+ std::to_string(motor_number_) + + "/additional_ratio_pos"; + if(!p_nh_->getParam(s_additional_ratio_pos, param_add_ratio_pos_)) { - param_add_ratio_pos = 1; - p_nh_->setParam(s_additional_ratio_pos, param_add_ratio_pos); - ROS_WARN_STREAM("[" << __func__ << "] Failed to get additional_ratio_pos for motor"<< std::to_string(motor_num) <<", setting to default value: " << param_add_ratio_pos); + param_add_ratio_pos_ = 1; + p_nh_->setParam(s_additional_ratio_pos, param_add_ratio_pos_); + ROS_WARN_STREAM("[" << __func__ << "] Failed to get additional_ratio_pos for motor" + << std::to_string(motor_number_) << ", setting to default value: " << param_add_ratio_pos_); } - const std::string s_additional_ratio_trq = s_node_name + "/motor"+ std::to_string(motor_num) + "/additional_ratio_trq"; - if(!p_nh_->getParam(s_additional_ratio_trq, param_add_ratio_trq)) + const std::string s_additional_ratio_trq = s_node_name_ + "/motor"+ std::to_string(motor_number_) + + "/additional_ratio_trq"; + if(!p_nh_->getParam(s_additional_ratio_trq, param_add_ratio_trq_)) { - param_add_ratio_trq = 1; - p_nh_->setParam(s_additional_ratio_trq, param_add_ratio_trq); - ROS_WARN_STREAM("[" << __func__ << "] Failed to get additional_ratio_trq for motor"<< std::to_string(motor_num) <<", setting to default value: " << param_add_ratio_trq); + param_add_ratio_trq_ = 1; + p_nh_->setParam(s_additional_ratio_trq, param_add_ratio_trq_); + ROS_WARN_STREAM("[" << __func__ << "] Failed to get additional_ratio_trq for motor" + << std::to_string(motor_number_) << ", setting to default value: " << param_add_ratio_trq_); } /* Parameters that are already validated in tmcl_ros.cpp. Only need to get the param value */ - const std::string s_pub_rate_tmc_info= s_node_name + "/pub_rate_tmc_info"; - (void)p_nh_->getParam(s_pub_rate_tmc_info, param_pub_rate_tmc_info); - const std::string s_comm_interface_name= s_node_name + "/comm_interface_name"; - (void)p_nh_->getParam(s_comm_interface_name, param_comm_interface_name); + const std::string s_pub_rate_tmc_info= s_node_name_ + "/pub_rate_tmc_info"; + (void)p_nh_->getParam(s_pub_rate_tmc_info, param_pub_rate_tmc_info_); + const std::string s_comm_interface_name= s_node_name_ + "/comm_interface_name"; + (void)p_nh_->getParam(s_comm_interface_name, param_comm_interface_name_); } /* Initialize Publisher */ @@ -146,14 +168,28 @@ void Motor::initPublisher() { ROS_INFO_STREAM("[Motor::" << __func__ << "] called"); - if(param_en_pub_tmc_info) + // Set frame ID + s_namespace_ = ros::this_node::getNamespace(); + /* Checks if namespace is empty if not, remove "/" */ + if(s_namespace_.compare("/") == 0) { - tmc_info_pub = p_nh_->advertise(param_tmc_info_topic, 1); - seq_ctr = 0; - ros::Rate period(param_pub_rate_tmc_info); - timer_callback = p_nh_->createTimer(ros::Duration(period), &Motor::rosPublishTmcInfo, this); + frame_id_ = "/tmcm" + std::to_string(module_number_) + "_mtr" + std::to_string(motor_number_) + "_frame"; + } + else + { + s_namespace_.erase(s_namespace_.begin()); + frame_id_ = s_namespace_ + "/tmcm" + std::to_string(module_number_) + "_mtr" + std::to_string(motor_number_) + + "_frame"; + } + + if(param_en_pub_tmc_info_) + { + tmc_info_pub_ = p_nh_->advertise(param_tmc_info_topic_, 100); + seq_ctr_ = 0; + ros::Rate period(param_pub_rate_tmc_info_); + timer_callback_ = p_nh_->createTimer(ros::Duration(period), &Motor::rosPublishTmcInfo, this); - if(timer_callback.isValid()) + if(timer_callback_.isValid()) { ROS_INFO_STREAM("[" << __func__ << "] Publisher TimerCallback is created successfully!"); } @@ -169,31 +205,31 @@ void Motor::rosPublishTmcInfo(const ros::TimerEvent& event) { int32_t val = 0; - tmc_info_msg.header.stamp = ros::Time::now(); - tmc_info_msg.header.seq = seq_ctr; - tmc_info_msg.header.frame_id = s_node_name + "/motor" + std::to_string(motor_num) + "/tmcl_frame"; - tmc_info_msg.interface_name = param_comm_interface_name; - tmc_info_msg.motor_num = motor_num; + tmc_info_msg_.header.stamp = ros::Time::now(); + tmc_info_msg_.header.seq = seq_ctr_; + tmc_info_msg_.header.frame_id = frame_id_; + tmc_info_msg_.interface_name = param_comm_interface_name_; + tmc_info_msg_.motor_number = motor_number_; /* Initialize messages to 0 first */ - tmc_info_msg.board_voltage = 0; - tmc_info_msg.status_flag = 0; - tmc_info_msg.velocity = 0; - tmc_info_msg.position = 0; - tmc_info_msg.torque = 0; + tmc_info_msg_.board_voltage = 0; + tmc_info_msg_.status_flag = 0; + tmc_info_msg_.velocity = 0; + tmc_info_msg_.position = 0; + tmc_info_msg_.torque = 0; - if(p_tmcl_int->executeCmd(TMCL_CMD_GAP, "SupplyVoltage", motor_num, &val)) + if(p_tmcl_interpreter_->executeCmd(TMCL_CMD_GAP, "SupplyVoltage", motor_number_, &val)) { - tmc_info_msg.board_voltage = val / 10; //converts mV to V + tmc_info_msg_.board_voltage = val / 10; //converts mV to V } else { ROS_DEBUG_STREAM("[" << __func__ << "] Failed to get SupplyVoltage"); } - if(p_tmcl_int->executeCmd(TMCL_CMD_GAP, "StatusFlags", motor_num, &val)) + if(p_tmcl_interpreter_->executeCmd(TMCL_CMD_GAP, "StatusFlags", motor_number_, &val)) { - tmc_info_msg.status_flag = val; + tmc_info_msg_.status_flag = val; } else { @@ -201,11 +237,11 @@ void Motor::rosPublishTmcInfo(const ros::TimerEvent& event) } /* Velocity, Position, Torque */ - if(param_pub_actual_vel) + if(param_pub_actual_vel_) { - if(p_tmcl_int->executeCmd(TMCL_CMD_GAP, "ActualVelocity", motor_num, &val)) + if(p_tmcl_interpreter_->executeCmd(TMCL_CMD_GAP, "ActualVelocity", motor_number_, &val)) { - tmc_info_msg.velocity = val * param_add_ratio_vel; + tmc_info_msg_.velocity = val * param_add_ratio_vel_; } else { @@ -213,11 +249,11 @@ void Motor::rosPublishTmcInfo(const ros::TimerEvent& event) } } - if(param_pub_actual_pos) + if(param_pub_actual_pos_) { - if(p_tmcl_int->executeCmd(TMCL_CMD_GAP, "ActualPosition", motor_num, &val)) + if(p_tmcl_interpreter_->executeCmd(TMCL_CMD_GAP, "ActualPosition", motor_number_, &val)) { - tmc_info_msg.position = val * param_add_ratio_pos; + tmc_info_msg_.position = val * param_add_ratio_pos_; } else { @@ -225,11 +261,11 @@ void Motor::rosPublishTmcInfo(const ros::TimerEvent& event) } } - if(param_pub_actual_trq) + if(param_pub_actual_trq_) { - if(p_tmcl_int->executeCmd(TMCL_CMD_GAP, "ActualTorque", motor_num, &val)) + if(p_tmcl_interpreter_->executeCmd(TMCL_CMD_GAP, "ActualTorque", motor_number_, &val)) { - tmc_info_msg.torque = val * param_add_ratio_trq; + tmc_info_msg_.torque = val * param_add_ratio_trq_; } else { @@ -237,8 +273,8 @@ void Motor::rosPublishTmcInfo(const ros::TimerEvent& event) } } - tmc_info_pub.publish(tmc_info_msg); - seq_ctr++; + tmc_info_pub_.publish(tmc_info_msg_); + seq_ctr_++; } /* Initialize Subscriber */ @@ -246,10 +282,10 @@ void Motor::initSubscriber() { ROS_INFO_STREAM("[Motor::" << __func__ << "] called"); - tmc_cmd_vel_sub = p_nh_->subscribe(param_tmc_cmd_vel_topic, 1000, &Motor::cmdVelCallback, this); - tmc_cmd_abspos_sub = p_nh_->subscribe(param_tmc_cmd_abspos_topic, 1000, &Motor::cmdAbsPosCallback, this); - tmc_cmd_relpos_sub = p_nh_->subscribe(param_tmc_cmd_relpos_topic, 1000, &Motor::cmdRelPosCallback, this); - tmc_cmd_trq_sub = p_nh_->subscribe(param_tmc_cmd_trq_topic, 1000, &Motor::cmdTrqCallback, this); + tmc_cmd_vel_sub_ = p_nh_->subscribe(param_tmc_cmd_vel_topic_, 1000, &Motor::cmdVelCallback, this); + tmc_cmd_abspos_sub_ = p_nh_->subscribe(param_tmc_cmd_abspos_topic_, 1000, &Motor::cmdAbsPosCallback, this); + tmc_cmd_relpos_sub_ = p_nh_->subscribe(param_tmc_cmd_relpos_topic_, 1000, &Motor::cmdRelPosCallback, this); + tmc_cmd_trq_sub_ = p_nh_->subscribe(param_tmc_cmd_trq_topic_, 1000, &Motor::cmdTrqCallback, this); } /* Subscriber Callback */ @@ -258,13 +294,14 @@ void Motor::cmdVelCallback(const geometry_msgs::Twist& msg) float val = msg.linear.x; int32_t board_val = 0; - board_val = val / param_add_ratio_vel; + board_val = val / param_add_ratio_vel_; - ROS_DEBUG_STREAM("[" << __func__ << "] Subscriber callback entered, received: " << val << " board value: " << board_val); + ROS_DEBUG_STREAM("[" << __func__ << "] Subscriber callback entered, received: " << val << " board value: " + << board_val); if(board_val >= 0) { - if(p_tmcl_int->executeCmd(TMCL_CMD_ROR, 0, motor_num, &board_val)) + if(p_tmcl_interpreter_->executeCmd(TMCL_CMD_ROR, 0, motor_number_, &board_val)) { ROS_DEBUG_STREAM("\n[" << __func__ << "] Subscriber callback exited successfully"); } @@ -276,7 +313,7 @@ void Motor::cmdVelCallback(const geometry_msgs::Twist& msg) else { board_val = abs(board_val); - if(p_tmcl_int->executeCmd(TMCL_CMD_ROL, 0, motor_num, &board_val)) + if(p_tmcl_interpreter_->executeCmd(TMCL_CMD_ROL, 0, motor_number_, &board_val)) { ROS_DEBUG_STREAM("\n[" << __func__ << "] Subscriber callback exited successfully"); } @@ -290,11 +327,12 @@ void Motor::cmdAbsPosCallback(const std_msgs::Int32 msg) { int32_t val = msg.data; - val /= param_add_ratio_pos; + val /= param_add_ratio_pos_; - ROS_DEBUG_STREAM("[" << __func__ << "] Subscriber callback entered, received: " << msg.data << " board value: " << val); + ROS_DEBUG_STREAM("[" << __func__ << "] Subscriber callback entered, received: " << msg.data << " board value: " + << val); - if(p_tmcl_int->executeCmd(TMCL_CMD_MVP, 0, motor_num, &val)) + if(p_tmcl_interpreter_->executeCmd(TMCL_CMD_MVP, 0, motor_number_, &val)) { ROS_DEBUG_STREAM("\n[" << __func__ << "] Subscriber callback exited successfully"); } @@ -307,11 +345,12 @@ void Motor::cmdRelPosCallback(const std_msgs::Int32 msg) { int32_t val = msg.data; - val /= param_add_ratio_pos; + val /= param_add_ratio_pos_; - ROS_DEBUG_STREAM("[" << __func__ << "] Subscriber callback entered, received: " << msg.data << " board value: " << val); + ROS_DEBUG_STREAM("[" << __func__ << "] Subscriber callback entered, received: " << msg.data << " board value: " + << val); - if(p_tmcl_int->executeCmd(TMCL_CMD_MVP, 1, motor_num, &val)) + if(p_tmcl_interpreter_->executeCmd(TMCL_CMD_MVP, 1, motor_number_, &val)) { ROS_DEBUG_STREAM("\n[" << __func__ << "] Subscriber callback exited successfully"); } @@ -324,11 +363,11 @@ void Motor::cmdTrqCallback(const std_msgs::Int32 msg) { int32_t val = msg.data; - val /= param_add_ratio_trq; + val /= param_add_ratio_trq_; ROS_DEBUG_STREAM("[" << __func__ << "] Subscriber callback entered, received: " << val); - if(p_tmcl_int->executeCmd(TMCL_CMD_SAP, "TargetTorque", motor_num, &val)) + if(p_tmcl_interpreter_->executeCmd(TMCL_CMD_SAP, "TargetTorque", motor_number_, &val)) { ROS_DEBUG_STREAM("\n[" << __func__ << "] Subscriber callback exited successfully"); } diff --git a/src/tmcl_ros.cpp b/src/tmcl_ros.cpp index f05b4cf..07012a7 100644 --- a/src/tmcl_ros.cpp +++ b/src/tmcl_ros.cpp @@ -10,8 +10,8 @@ /* Constructor */ TmclROS::TmclROS(ros::NodeHandle* p_nh) : p_nh_ (p_nh), -p_motor(1), -p_tmcl_int(nullptr) +p_motor_(1), +p_tmcl_interpreter_(nullptr) { ROS_DEBUG_STREAM("[TmclROS::" << __func__ << "] called"); } @@ -21,16 +21,16 @@ TmclROS::~TmclROS() { ROS_DEBUG_STREAM("[TmclROS::" << __func__ << "] called"); - for(uint8_t index = 0; index < p_motor.size(); index++) + for(uint8_t index = 0; index < p_motor_.size(); index++) { - delete p_motor[index]; - p_motor[index] = nullptr; + delete p_motor_[index]; + p_motor_[index] = nullptr; } - if(p_tmcl_int != nullptr) + if(p_tmcl_interpreter_ != nullptr) { - delete p_tmcl_int; - p_tmcl_int = nullptr; + delete p_tmcl_interpreter_; + p_tmcl_interpreter_ = nullptr; p_nh_ = nullptr; } } @@ -41,53 +41,53 @@ bool TmclROS::init() bool b_result = false; bool b_autostart_mode = false; int32_t val = 0; - uint16_t module_number = 0; uint8_t instruction = 0; uint8_t firmware_value[TMCL_MSG_VALUE_SZ]; - total_motors = 0; + total_motors_ = 0; ROS_INFO_STREAM("[TmclROS::" << __func__ << "] called"); - s_node_name = ros::this_node::getName(); - s_namespace = ros::this_node::getNamespace(); - ROS_INFO_STREAM("[" << __func__ << "] Namespace: " << s_namespace); - ROS_INFO_STREAM("[" << __func__ << "] Node name: " << s_node_name); + s_node_name_ = ros::this_node::getName(); + s_namespace_ = ros::this_node::getNamespace(); + ROS_INFO_STREAM("[" << __func__ << "] Namespace: " << s_namespace_); + ROS_INFO_STREAM("[" << __func__ << "] Node name: " << s_node_name_); if(validateParams()) { /* Initialize TMCL Interpreter */ - p_tmcl_int= new TmclInterpreter(param_comm_timeout_ms, param_comm_exec_cmd_retries, param_ap_name, param_ap_type); - p_tmcl_int->tmcl_interface = (tmcl_interface_t) param_comm_interface; - p_tmcl_int->tmcl_cfg.interface_name = param_comm_interface_name; - p_tmcl_int->tmcl_cfg.tx_id = param_comm_tx_id; - p_tmcl_int->tmcl_cfg.rx_id = param_comm_rx_id; + p_tmcl_interpreter_= new TmclInterpreter(param_comm_timeout_ms_, param_comm_exec_cmd_retries_, + param_ap_name_, param_ap_type_); + p_tmcl_interpreter_->tmcl_interface_ = (tmcl_interface_t) param_comm_interface_; + p_tmcl_interpreter_->tmcl_cfg_.interface_name = param_comm_interface_name_; + p_tmcl_interpreter_->tmcl_cfg_.tx_id = param_comm_tx_id_; + p_tmcl_interpreter_->tmcl_cfg_.rx_id = param_comm_rx_id_; /* Reset the interface to be used */ - if(p_tmcl_int->resetInterface()) + if(p_tmcl_interpreter_->resetInterface()) { ROS_INFO_STREAM("[" << __func__ << "] resetInterface() success"); /* Try to get FW version first before proceeding */ - if(p_tmcl_int->executeCmd(TMCL_CMD_APPGFWV, 0x01, 0x00, &val)) + if(p_tmcl_interpreter_->executeCmd(TMCL_CMD_APPGFWV, 0x01, 0x00, &val)) { /* Parse value for total motors, motor type and firmware version */ firmware_value[0] = (val & 0xFF000000) >> 24; firmware_value[1] = (val & 0x00FF0000) >> 16; firmware_value[2] = (val & 0x0000FF00) >> 8; firmware_value[3] = (val & 0x000000FF); - module_number = (firmware_value[0] << 8) + (firmware_value[1]); - total_motors = module_number / 1000; - motor_type = (module_number - (total_motors*1000)) / 100; - - ROS_INFO("[%s] Module number : %d", __func__, module_number); + module_number_ = (firmware_value[0] << 8) + (firmware_value[1]); + total_motors_ = module_number_ / 1000; + motor_type_ = (module_number_ - (total_motors_*1000)) / 100; + + ROS_INFO("[%s] Module number : %d", __func__, module_number_); ROS_INFO("[%s] Firmware version : %d.%d", __func__, firmware_value[2], firmware_value[3]); /* Try to get Autostart mode value */ - auto iterator = std::find(param_gp_name.begin(), param_gp_name.end(), "auto start mode"); - if(iterator != param_gp_name.end()) + auto iterator = std::find(param_gp_name_.begin(), param_gp_name_.end(), "auto start mode"); + if(iterator != param_gp_name_.end()) { - instruction = param_gp_type[std::distance(param_gp_name.begin(), iterator)]; - (void) p_tmcl_int->executeCmd(TMCL_CMD_GGP, instruction, 0x00, &val); + instruction = param_gp_type_[std::distance(param_gp_name_.begin(), iterator)]; + (void) p_tmcl_interpreter_->executeCmd(TMCL_CMD_GGP, instruction, 0x00, &val); b_autostart_mode = val; } else @@ -98,8 +98,9 @@ bool TmclROS::init() if(b_autostart_mode) { ROS_INFO_STREAM("[" << __func__ << "] Auto start mode is enabled"); - ROS_INFO_STREAM("[" << __func__ << "] Wait " << 2.0 + param_auto_start_additional_delay << "secs to autostart TMCL program"); - ros::Duration(2.0 + param_auto_start_additional_delay).sleep(); + ROS_INFO_STREAM("[" << __func__ << "] Wait " << 2.0 + param_auto_start_additional_delay_ + << "secs to autostart TMCL program"); + ros::Duration(2.0 + param_auto_start_additional_delay_).sleep(); } else { @@ -134,171 +135,193 @@ bool TmclROS::validateParams() /*================================================================================================================*/ /* Parameters from Autogenerated YAML. Node will exit if any of the parameters is/are missing/broken */ /*================================================================================================================*/ - const std::string s_ap_name = s_node_name + "/AP_name"; - if(!p_nh_->getParam(s_ap_name, param_ap_name)) + const std::string s_ap_name = s_node_name_ + "/AP_name"; + if(!p_nh_->getParam(s_ap_name, param_ap_name_)) { - ROS_ERROR_STREAM("[" << __func__ << "] Failed to get AP_name. Check autogenerated YAML if broken or missing. Exiting!"); + ROS_ERROR_STREAM("[" << __func__ << "] Failed to get AP_name. " + "Check autogenerated YAML if broken or missing. Exiting!"); b_result = false; } - const std::string s_ap_type = s_node_name + "/AP_type"; - if(b_result && !p_nh_->getParam(s_ap_type, param_ap_type)) + const std::string s_ap_type = s_node_name_ + "/AP_type"; + if(b_result && !p_nh_->getParam(s_ap_type, param_ap_type_)) { - ROS_ERROR_STREAM("[" << __func__ << "] Failed to get AP_type. Check autogenerated YAML if broken or missing. Exiting!"); + ROS_ERROR_STREAM("[" << __func__ << "] Failed to get AP_type. " + "Check autogenerated YAML if broken or missing. Exiting!"); b_result = false; } /* Check if AP_name and AP_type vectors have the same length/size */ - if(b_result && (param_ap_name.size() != param_ap_type.size())) + if(b_result && (param_ap_name_.size() != param_ap_type_.size())) { - ROS_ERROR_STREAM("[" << __func__ << "] Vector size mismatch between AP_name and AP_type. Check autogenerated YAML. Exiting!"); + ROS_ERROR_STREAM("[" << __func__ << "] Vector size mismatch between AP_name and AP_type. " + "Check autogenerated YAML. Exiting!"); b_result = false; } - const std::string s_gp_name = s_node_name + "/GP_name"; - if(b_result && !p_nh_->getParam(s_gp_name, param_gp_name)) + const std::string s_gp_name = s_node_name_ + "/GP_name"; + if(b_result && !p_nh_->getParam(s_gp_name, param_gp_name_)) { - ROS_ERROR_STREAM("[" << __func__ << "] Failed to get GP_name. Check autogenerated YAML if broken or missing. Exiting!"); + ROS_ERROR_STREAM("[" << __func__ << "] Failed to get GP_name. " + "Check autogenerated YAML if broken or missing. Exiting!"); b_result = false; } - const std::string s_gp_type = s_node_name + "/GP_type"; - if(b_result && !p_nh_->getParam(s_gp_type, param_gp_type)) + const std::string s_gp_type = s_node_name_ + "/GP_type"; + if(b_result && !p_nh_->getParam(s_gp_type, param_gp_type_)) { - ROS_ERROR_STREAM("[" << __func__ << "] Failed to get GP_type. Check autogenerated YAML if broken or missing. Exiting!"); + ROS_ERROR_STREAM("[" << __func__ << "] Failed to get GP_type. " + "Check autogenerated YAML if broken or missing. Exiting!"); b_result = false; } /* Check if GP_name and GP_type vectors have the same length/size */ - if(b_result && (param_gp_name.size() != param_gp_type.size())) + if(b_result && (param_gp_name_.size() != param_gp_type_.size())) { - ROS_ERROR_STREAM("[" << __func__ << "] Vector size mismatch between GP_name and GP_type. Check autogenerated YAML. Exiting!"); + ROS_ERROR_STREAM("[" << __func__ << "] Vector size mismatch between GP_name and GP_type. " + "Check autogenerated YAML. Exiting!"); b_result = false; } if(b_result) { - /*================================================================================================================*/ + /*==============================================================================================================*/ /*Parameters with no limits */ - /*================================================================================================================*/ - const std::string s_comm_interface = s_node_name + "/comm_interface"; - if(!p_nh_->getParam(s_comm_interface, param_comm_interface)) + /*==============================================================================================================*/ + const std::string s_comm_interface = s_node_name_ + "/comm_interface"; + if(!p_nh_->getParam(s_comm_interface, param_comm_interface_)) { - param_comm_interface = 0; - p_nh_->setParam(s_comm_interface, param_comm_interface); - ROS_WARN_STREAM("[" << __func__ << "] Failed to get comm_interface, setting to default value: " << param_comm_interface); + param_comm_interface_ = 0; + p_nh_->setParam(s_comm_interface, param_comm_interface_); + ROS_WARN_STREAM("[" << __func__ << "] Failed to get comm_interface, setting to default value: " + << param_comm_interface_); } - const std::string s_comm_interface_name = s_node_name + "/comm_interface_name"; - if(!p_nh_->getParam(s_comm_interface_name, param_comm_interface_name)) + const std::string s_comm_interface_name = s_node_name_ + "/comm_interface_name"; + if(!p_nh_->getParam(s_comm_interface_name, param_comm_interface_name_)) { - param_comm_interface_name = "can0"; - p_nh_->setParam(s_comm_interface_name, param_comm_interface_name); - ROS_WARN_STREAM("[" << __func__ << "] Failed to get comm_interface_name, setting to default value: " << param_comm_interface_name); + param_comm_interface_name_ = "can0"; + p_nh_->setParam(s_comm_interface_name, param_comm_interface_name_); + ROS_WARN_STREAM("[" << __func__ << "] Failed to get comm_interface_name, setting to default value: " + << param_comm_interface_name_); } - const std::string s_adhoc_mode= s_node_name + "/adhoc_mode"; - if(!p_nh_->getParam(s_adhoc_mode, param_adhoc_mode)) + const std::string s_adhoc_mode= s_node_name_ + "/adhoc_mode"; + if(!p_nh_->getParam(s_adhoc_mode, param_adhoc_mode_)) { - param_adhoc_mode = false; - p_nh_->setParam(s_adhoc_mode, param_adhoc_mode); - ROS_WARN_STREAM("[" << __func__ << "] Failed to get adhoc_mode, setting to default value: " << param_adhoc_mode); + param_adhoc_mode_ = false; + p_nh_->setParam(s_adhoc_mode, param_adhoc_mode_); + ROS_WARN_STREAM("[" << __func__ << "] Failed to get adhoc_mode, setting to default value: " + << param_adhoc_mode_); } - /*================================================================================================================*/ + /*==============================================================================================================*/ /*Parameters with limits. Will turn values to default if limit exceeds*/ - /*================================================================================================================*/ - const std::string s_comm_tx_id = s_node_name + "/comm_tx_id"; - if(!p_nh_->getParam(s_comm_tx_id, param_comm_tx_id)) + /*==============================================================================================================*/ + const std::string s_comm_tx_id = s_node_name_ + "/comm_tx_id"; + if(!p_nh_->getParam(s_comm_tx_id, param_comm_tx_id_)) { - param_comm_tx_id = TX_ID_DEFAULT; - p_nh_->setParam(s_comm_tx_id, param_comm_tx_id); - ROS_WARN_STREAM("[" << __func__ << "] Failed to get comm_tx_id, setting to default value: "<< param_comm_tx_id); + param_comm_tx_id_ = TX_ID_DEFAULT; + p_nh_->setParam(s_comm_tx_id, param_comm_tx_id_); + ROS_WARN_STREAM("[" << __func__ << "] Failed to get comm_tx_id, setting to default value: " + << param_comm_tx_id_); } else { - if(param_comm_tx_id < 0 || param_comm_tx_id > TXRX_ID_MAX) + if(param_comm_tx_id_ < 0 || param_comm_tx_id_ > TXRX_ID_MAX) { - param_comm_tx_id = TX_ID_DEFAULT; - p_nh_->setParam(s_comm_tx_id, param_comm_tx_id); - ROS_WARN_STREAM("[" << __func__ << "] Set value to comm_tx_id is out of range, setting comm_tx_id value to default: "<< param_comm_tx_id); + param_comm_tx_id_ = TX_ID_DEFAULT; + p_nh_->setParam(s_comm_tx_id, param_comm_tx_id_); + ROS_WARN_STREAM("[" << __func__ << "] Set value to comm_tx_id is out of range, " + "setting comm_tx_id value to default: " << param_comm_tx_id_); } } - const std::string s_comm_rx_id = s_node_name + "/comm_rx_id"; - if(!p_nh_->getParam(s_comm_rx_id, param_comm_rx_id)) + const std::string s_comm_rx_id = s_node_name_ + "/comm_rx_id"; + if(!p_nh_->getParam(s_comm_rx_id, param_comm_rx_id_)) { - param_comm_rx_id = RX_ID_DEFAULT; - p_nh_->setParam(s_comm_rx_id, param_comm_rx_id); - ROS_WARN_STREAM("[" << __func__ << "] Failed to get comm_rx_id, setting to default value: " << param_comm_rx_id); + param_comm_rx_id_ = RX_ID_DEFAULT; + p_nh_->setParam(s_comm_rx_id, param_comm_rx_id_); + ROS_WARN_STREAM("[" << __func__ << "] Failed to get comm_rx_id, setting to default value: " + << param_comm_rx_id_); } else { - if(param_comm_rx_id < 0 || param_comm_rx_id > TXRX_ID_MAX) + if(param_comm_rx_id_ < 0 || param_comm_rx_id_ > TXRX_ID_MAX) { - param_comm_rx_id = RX_ID_DEFAULT; - p_nh_->setParam(s_comm_rx_id, param_comm_rx_id); - ROS_WARN_STREAM("[" << __func__ << "] Set value to comm_rx_id is out of range, setting comm_rx_id value to default: " << param_comm_rx_id); + param_comm_rx_id_ = RX_ID_DEFAULT; + p_nh_->setParam(s_comm_rx_id, param_comm_rx_id_); + ROS_WARN_STREAM("[" << __func__ << "] Set value to comm_rx_id is out of range, " + "setting comm_rx_id value to default: " << param_comm_rx_id_); } } - const std::string s_comm_timeout_ms = s_node_name + "/comm_timeout_ms"; - if(!p_nh_->getParam(s_comm_timeout_ms, param_comm_timeout_ms)) + const std::string s_comm_timeout_ms = s_node_name_ + "/comm_timeout_ms"; + if(!p_nh_->getParam(s_comm_timeout_ms, param_comm_timeout_ms_)) { - param_comm_timeout_ms = TIMEOUT_MS_DEFAULT; - p_nh_->setParam(s_comm_timeout_ms, param_comm_timeout_ms); - ROS_WARN_STREAM("[" << __func__ << "] Failed to get comm_timeout_ms, setting to default value: " << param_comm_timeout_ms); + param_comm_timeout_ms_ = TIMEOUT_MS_DEFAULT; + p_nh_->setParam(s_comm_timeout_ms, param_comm_timeout_ms_); + ROS_WARN_STREAM("[" << __func__ << "] Failed to get comm_timeout_ms, setting to default value: " + << param_comm_timeout_ms_); } else { - if(param_comm_timeout_ms < 0 || param_comm_timeout_ms > TIMEOUT_MS_MAX) + if(param_comm_timeout_ms_ < 0 || param_comm_timeout_ms_ > TIMEOUT_MS_MAX) { - param_comm_timeout_ms = TIMEOUT_MS_DEFAULT; - p_nh_->setParam(s_comm_timeout_ms, param_comm_timeout_ms); - ROS_WARN_STREAM("[" << __func__ << "] Set value to comm_timeout_ms is out of range, setting comm_timeout_ms value to default: " << param_comm_timeout_ms); + param_comm_timeout_ms_ = TIMEOUT_MS_DEFAULT; + p_nh_->setParam(s_comm_timeout_ms, param_comm_timeout_ms_); + ROS_WARN_STREAM("[" << __func__ << "] Set value to comm_timeout_ms is out of range, " + "setting comm_timeout_ms value to default: " << param_comm_timeout_ms_); } } - const std::string s_comm_exec_cmd_retries = s_node_name + "/comm_exec_cmd_retries"; - if(!p_nh_->getParam(s_comm_exec_cmd_retries, param_comm_exec_cmd_retries)) + const std::string s_comm_exec_cmd_retries = s_node_name_ + "/comm_exec_cmd_retries"; + if(!p_nh_->getParam(s_comm_exec_cmd_retries, param_comm_exec_cmd_retries_)) { - param_comm_exec_cmd_retries = EXEC_CMD_RETRIES_DEFAULT; - p_nh_->setParam(s_comm_exec_cmd_retries, param_comm_exec_cmd_retries); - ROS_WARN_STREAM("[" << __func__ << "] Failed to get comm_exec_cmd_retries, setting to default value: " << param_comm_exec_cmd_retries); + param_comm_exec_cmd_retries_ = EXEC_CMD_RETRIES_DEFAULT; + p_nh_->setParam(s_comm_exec_cmd_retries, param_comm_exec_cmd_retries_); + ROS_WARN_STREAM("[" << __func__ << "] Failed to get comm_exec_cmd_retries, setting to default value: " + << param_comm_exec_cmd_retries_); } else { - if(param_comm_exec_cmd_retries < 0 || param_comm_exec_cmd_retries > EXEC_CMD_RETRIES_MAX) + if(param_comm_exec_cmd_retries_ < 0 || param_comm_exec_cmd_retries_ > EXEC_CMD_RETRIES_MAX) { - param_comm_exec_cmd_retries = EXEC_CMD_RETRIES_DEFAULT; - p_nh_->setParam(s_comm_exec_cmd_retries, param_comm_exec_cmd_retries); - ROS_WARN_STREAM("[" << __func__ << "] Set value to comm_exec_cmd_retries is out of range, setting comm_timeout_retry value to default: " << param_comm_exec_cmd_retries); + param_comm_exec_cmd_retries_ = EXEC_CMD_RETRIES_DEFAULT; + p_nh_->setParam(s_comm_exec_cmd_retries, param_comm_exec_cmd_retries_); + ROS_WARN_STREAM("[" << __func__ << "] Set value to comm_exec_cmd_retries is out of range, " + "setting comm_timeout_retry value to default: " << param_comm_exec_cmd_retries_); } } - const std::string s_pub_rate_tmc_info = s_node_name + "/pub_rate_tmc_info"; - if(!p_nh_->getParam(s_pub_rate_tmc_info, param_pub_rate_tmc_info)) + const std::string s_pub_rate_tmc_info = s_node_name_ + "/pub_rate_tmc_info"; + if(!p_nh_->getParam(s_pub_rate_tmc_info, param_pub_rate_tmc_info_)) { - param_pub_rate_tmc_info = PUB_RATE_DEFAULT; - p_nh_->setParam(s_pub_rate_tmc_info, param_pub_rate_tmc_info); - ROS_WARN_STREAM("[" << __func__ << "] Failed to get pub_rate_tmc_info, setting to default value: " << param_pub_rate_tmc_info); + param_pub_rate_tmc_info_ = PUB_RATE_DEFAULT; + p_nh_->setParam(s_pub_rate_tmc_info, param_pub_rate_tmc_info_); + ROS_WARN_STREAM("[" << __func__ << "] Failed to get pub_rate_tmc_info, setting to default value: " + << param_pub_rate_tmc_info_); } else { - if(param_pub_rate_tmc_info < PUB_RATE_DEFAULT || param_pub_rate_tmc_info > PUB_RATE_MAX) + if(param_pub_rate_tmc_info_ < PUB_RATE_MIN || param_pub_rate_tmc_info_ > PUB_RATE_MAX) { - param_pub_rate_tmc_info = PUB_RATE_DEFAULT; - p_nh_->setParam(s_pub_rate_tmc_info, param_pub_rate_tmc_info); - ROS_WARN_STREAM("[" << __func__ << "] Set value to pub_rate_tmc_info is out of range, setting pub_rate_tmc_info value to default: " << param_pub_rate_tmc_info); + param_pub_rate_tmc_info_ = PUB_RATE_DEFAULT; + p_nh_->setParam(s_pub_rate_tmc_info, param_pub_rate_tmc_info_); + ROS_WARN_STREAM("[" << __func__ << "] Set value to pub_rate_tmc_info is out of range, " + "setting pub_rate_tmc_info value to default: " << param_pub_rate_tmc_info_); } } - const std::string s_auto_start_additional_delay = s_node_name + "/auto_start_additional_delay"; - if(!p_nh_->getParam(s_auto_start_additional_delay, param_auto_start_additional_delay)) + const std::string s_auto_start_additional_delay = s_node_name_ + "/auto_start_additional_delay"; + if(!p_nh_->getParam(s_auto_start_additional_delay, param_auto_start_additional_delay_)) { - param_auto_start_additional_delay = AUTO_START_ADDITIONAL_DELAY_DEFAULT; - p_nh_->setParam(s_auto_start_additional_delay, param_auto_start_additional_delay); - ROS_WARN_STREAM("[" << __func__ << "] Failed to get auto_start_additional_delay, setting to default value: " << param_auto_start_additional_delay); + param_auto_start_additional_delay_ = AUTO_START_ADDITIONAL_DELAY_DEFAULT; + p_nh_->setParam(s_auto_start_additional_delay, param_auto_start_additional_delay_); + ROS_WARN_STREAM("[" << __func__ << "] Failed to get auto_start_additional_delay, setting to default value: " + << param_auto_start_additional_delay_); } else { - if(param_auto_start_additional_delay < AUTO_START_ADDITIONAL_DELAY_DEFAULT || param_auto_start_additional_delay > AUTO_START_ADDITIONAL_DELAY_MAX) + if(param_auto_start_additional_delay_ < AUTO_START_ADDITIONAL_DELAY_DEFAULT || + param_auto_start_additional_delay_ > AUTO_START_ADDITIONAL_DELAY_MAX) { - param_auto_start_additional_delay = AUTO_START_ADDITIONAL_DELAY_DEFAULT; - p_nh_->setParam(s_auto_start_additional_delay, param_auto_start_additional_delay); - ROS_WARN_STREAM("[" << __func__ << "] Set value to auto_start_additional_delay is out of range, setting pub_rate_tmc_info value to default: " << param_auto_start_additional_delay); + param_auto_start_additional_delay_ = AUTO_START_ADDITIONAL_DELAY_DEFAULT; + p_nh_->setParam(s_auto_start_additional_delay, param_auto_start_additional_delay_); + ROS_WARN_STREAM("[" << __func__ << "] Set value to auto_start_additional_delay is out of range, " + "setting pub_rate_tmc_info value to default: " << param_auto_start_additional_delay_); } } } @@ -314,67 +337,68 @@ void TmclROS::createMotor() ROS_INFO_STREAM("[TmclROS::" << __func__ << "] called"); - /* Resize p_motor depending on total_motors value */ - p_motor.resize(total_motors, nullptr); + /* Resize p_motor_ depending on total_motors_ value */ + p_motor_.resize(total_motors_, nullptr); /* Special handling for en_motors*/ - const std::string s_en_motors = s_node_name + "/en_motors"; - if(!p_nh_->getParam(s_en_motors, param_en_motors)) + const std::string s_en_motors = s_node_name_ + "/en_motors"; + if(!p_nh_->getParam(s_en_motors, param_en_motors_)) { - for(index = 0; index < total_motors; index++) + for(index = 0; index < total_motors_; index++) { - param_en_motors.push_back(0); + param_en_motors_.push_back(0); } - p_nh_->setParam(s_en_motors, param_en_motors); + p_nh_->setParam(s_en_motors, param_en_motors_); ROS_WARN("[%s] Failed to get en_motors, setting to default value: 0", __func__); } else { - /* Check if en_motors size is equal to total_motors */ - if((param_en_motors.size()) < total_motors) + /* Check if en_motors size is equal to total_motors_ */ + if((param_en_motors_.size()) < total_motors_) { - for(index = param_en_motors.size(); index < total_motors; index++) + for(index = param_en_motors_.size(); index < total_motors_; index++) { - param_en_motors.push_back(0); + param_en_motors_.push_back(0); } ROS_WARN("[%s] Missing indeces for en_motors, setting missing en_motors value to default: 0", __func__); } - else if((param_en_motors.size()) > total_motors) + else if((param_en_motors_.size()) > total_motors_) { - for(index = total_motors; index <= param_en_motors.size(); index++) + for(index = total_motors_; index <= param_en_motors_.size(); index++) { - param_en_motors.erase(param_en_motors.begin() + total_motors, param_en_motors.end()); + param_en_motors_.erase(param_en_motors_.begin() + total_motors_, param_en_motors_.end()); } ROS_WARN("[%s] Indeces exceeded total motors available, deleting unused indeces", __func__); } /* Check each indeces of en_motors if valid */ - for(index = 0; index < param_en_motors.size(); index++) + for(index = 0; index < param_en_motors_.size(); index++) { - if(param_en_motors[index] != 0 && param_en_motors[index] != 1) + if(param_en_motors_[index] != 0 && param_en_motors_[index] != 1) { - param_en_motors[index] = 0; - ROS_WARN("[%s] Set value to en_motors for motor %d is out of range, setting en_motors value to default: %d ", __func__, index, param_en_motors[index]); + param_en_motors_[index] = 0; + ROS_WARN("[%s] Set value to en_motors for motor %d is out of range, setting en_motors value to default: %d " + , __func__, index, param_en_motors_[index]); } } - p_nh_->setParam(s_en_motors, param_en_motors); + p_nh_->setParam(s_en_motors, param_en_motors_); } /* Check for motor type */ - if(param_adhoc_mode) + if(param_adhoc_mode_) { ROS_INFO_STREAM("[" << __func__ << "] Adhoc Mode is enabled\n"); //Generic - for(index = 0; index < total_motors; index++) + for(index = 0; index < total_motors_; index++) { - if(param_en_motors[index]) + if(param_en_motors_[index]) { - p_motor[index] = new Motor(p_nh_, p_tmcl_int, index); - p_motor[index]->init(); + p_motor_[index] = new Motor(p_nh_, p_tmcl_interpreter_, module_number_, index); + p_motor_[index]->init(); } else { - p_motor[index] = nullptr; + p_motor_[index] = nullptr; ROS_WARN("[%s] Motor %d is disabled\n", __func__, index); } } @@ -382,20 +406,20 @@ void TmclROS::createMotor() else { //BLDC - if(motor_type == MOTOR_TYPE_BLDC) + if(motor_type_ == MOTOR_TYPE_BLDC) { ROS_INFO_STREAM("[" << __func__ << "] Detected module for BLDC Motors\n"); - for(index = 0; index < total_motors; index++) + for(index = 0; index < total_motors_; index++) { - if(param_en_motors[index]) + if(param_en_motors_[index]) { - p_motor[index] = new BLDCMotor(p_nh_, p_tmcl_int, index); - p_motor[index]->init(); + p_motor_[index] = new BLDCMotor(p_nh_, p_tmcl_interpreter_, module_number_, index); + p_motor_[index]->init(); } else { - p_motor[index] = nullptr; + p_motor_[index] = nullptr; ROS_WARN("[%s] motor %d is disabled\n", __func__, index); } } @@ -405,16 +429,16 @@ void TmclROS::createMotor() else { ROS_INFO_STREAM("[" << __func__ << "] Detected module for Stepper Motors\n"); - for(index = 0; index < total_motors; index++) + for(index = 0; index < total_motors_; index++) { - if(param_en_motors[index]) + if(param_en_motors_[index]) { - p_motor[index] = new StepperMotor(p_nh_, p_tmcl_int, index); - p_motor[index]->init(); + p_motor_[index] = new StepperMotor(p_nh_, p_tmcl_interpreter_, module_number_, index); + p_motor_[index]->init(); } else { - p_motor[index] = nullptr; + p_motor_[index] = nullptr; ROS_WARN("[%s] motor %d is disabled\n", __func__, index); } } @@ -427,11 +451,17 @@ void TmclROS::initService() { ROS_INFO_STREAM("[TmclROS::" << __func__ << "] called"); - std::string s_custom_cmd_srvname = s_node_name + "/tmcl_custom_cmd"; - std::string s_gap_all_srvname = s_node_name + "/tmcl_gap_all"; - std::string s_ggp_all_srvname = s_node_name + "/tmcl_ggp_all"; + /* Make s_namespace_ empty if namespace is empty */ + if(s_namespace_.compare("/") == 0) + { + s_namespace_ = ""; + } + + std::string s_custom_cmd_srvname = s_namespace_ + "/tmcl_custom_cmd"; + std::string s_gap_all_srvname = s_namespace_ + "/tmcl_gap_all"; + std::string s_ggp_all_srvname = s_namespace_ + "/tmcl_ggp_all"; - custom_cmd_server = p_nh_->advertiseService(s_custom_cmd_srvname, &TmclROS::tmclCustomCMDCallBack, this); + custom_cmd_server_ = p_nh_->advertiseService(s_custom_cmd_srvname, &TmclROS::tmclCustomCMDCallBack, this); if(ros::service::exists(s_custom_cmd_srvname, true)) { ROS_INFO_STREAM("[" << __func__ << "] tmcl_custom_cmd server advertised. Service name: " << s_custom_cmd_srvname); @@ -441,7 +471,7 @@ void TmclROS::initService() ROS_WARN_STREAM("[" << __func__ << "] tmcl_custom_cmd server failed to advertise."); } - gap_all_server = p_nh_->advertiseService(s_gap_all_srvname, &TmclROS::tmclGAPAllCallBack, this); + gap_all_server_ = p_nh_->advertiseService(s_gap_all_srvname, &TmclROS::tmclGAPAllCallBack, this); if(ros::service::exists(s_gap_all_srvname, true)) { ROS_INFO_STREAM("[" << __func__ << "] tmcl_gap_all server advertised. Service name: " << s_gap_all_srvname); @@ -451,7 +481,7 @@ void TmclROS::initService() ROS_WARN_STREAM("[" << __func__ << "] tmcl_gap_all server failed to advertise."); } - ggp_all_server = p_nh_->advertiseService(s_ggp_all_srvname, &TmclROS::tmclGGPAllCallBack, this); + ggp_all_server_ = p_nh_->advertiseService(s_ggp_all_srvname, &TmclROS::tmclGGPAllCallBack, this); if(ros::service::exists(s_ggp_all_srvname, true)) { ROS_INFO_STREAM("[" << __func__ << "] tmcl_ggp_all server advertised. Service name: " << s_ggp_all_srvname); @@ -471,7 +501,8 @@ bool TmclROS::tmclCustomCMDCallBack(tmcl_ros::TmcCustomCmd::Request& req, tmcl_r if(req.instruction == "SAP") { val = req.value; - if(req.motor_num < total_motors && p_tmcl_int->executeCmd(TMCL_CMD_SAP, req.instruction_type, req.motor_num, &val)) + if(req.motor_number < total_motors_ && + p_tmcl_interpreter_->executeCmd(TMCL_CMD_SAP, req.instruction_type, req.motor_number, &val)) { b_result = true; ROS_DEBUG_STREAM("[" << __func__ << "] Service Done. Set value: " << res.output); @@ -483,7 +514,8 @@ bool TmclROS::tmclCustomCMDCallBack(tmcl_ros::TmcCustomCmd::Request& req, tmcl_r } else if(req.instruction == "GAP") { - if(req.motor_num < total_motors && p_tmcl_int->executeCmd(TMCL_CMD_GAP, req.instruction_type, req.motor_num, &val)) + if(req.motor_number < total_motors_ && + p_tmcl_interpreter_->executeCmd(TMCL_CMD_GAP, req.instruction_type, req.motor_number, &val)) { b_result = true; ROS_DEBUG_STREAM("[" << __func__ << "] Service Done. Get value: " << res.output); @@ -496,7 +528,8 @@ bool TmclROS::tmclCustomCMDCallBack(tmcl_ros::TmcCustomCmd::Request& req, tmcl_r else if(req.instruction == "SGP") { val = req.value; - if(req.motor_num < total_motors && p_tmcl_int->executeCmd(TMCL_CMD_SGP, req.instruction_type, req.motor_num, &val)) + if(req.motor_number < total_motors_ && + p_tmcl_interpreter_->executeCmd(TMCL_CMD_SGP, req.instruction_type, req.motor_number, &val)) { b_result = true; ROS_DEBUG_STREAM("[" << __func__ << "] Service Done. Set value: " << res.output); @@ -508,7 +541,8 @@ bool TmclROS::tmclCustomCMDCallBack(tmcl_ros::TmcCustomCmd::Request& req, tmcl_r } else if(req.instruction == "GGP") { - if(req.motor_num < total_motors && p_tmcl_int->executeCmd(TMCL_CMD_GGP, req.instruction_type, req.motor_num, &val)) + if(req.motor_number < total_motors_ && + p_tmcl_interpreter_->executeCmd(TMCL_CMD_GGP, req.instruction_type, req.motor_number, &val)) { b_result = true; ROS_DEBUG_STREAM("[" << __func__ << "] Service Done. Get value: " << res.output); @@ -534,21 +568,21 @@ bool TmclROS::tmclGAPAllCallBack(tmcl_ros::TmcGapGgpAll::Request& req, tmcl_ros: int32_t val = 0; uint8_t index = 0; - if(req.motor_num < total_motors) + if(req.motor_number < total_motors_) { - for(index = 0; index < param_ap_name.size(); index++) + for(index = 0; index < param_ap_name_.size(); index++) { - if(p_tmcl_int->executeCmd(TMCL_CMD_GAP, param_ap_type[index], req.motor_num, &val)) + if(p_tmcl_interpreter_->executeCmd(TMCL_CMD_GAP, param_ap_type_[index], req.motor_number, &val)) { - tmc_param_msg.name = param_ap_name[index]; - tmc_param_msg.value = val; - res.output.push_back(tmc_param_msg); + tmc_param_msg_.name = param_ap_name_[index]; + tmc_param_msg_.value = val; + res.output.push_back(tmc_param_msg_); } else { - tmc_param_msg.name = param_ap_name[index] + ">>> ERROR"; - tmc_param_msg.value = 0; - res.output.push_back(tmc_param_msg); + tmc_param_msg_.name = param_ap_name_[index] + ">>> ERROR"; + tmc_param_msg_.value = 0; + res.output.push_back(tmc_param_msg_); b_result = false; } } @@ -568,21 +602,21 @@ bool TmclROS::tmclGGPAllCallBack(tmcl_ros::TmcGapGgpAll::Request& req, tmcl_ros: int32_t val = 0; uint8_t index = 0; - if(req.motor_num == 0) + if(req.motor_number == 0) { - for(index = 0; index < param_gp_name.size(); index++) + for(index = 0; index < param_gp_name_.size(); index++) { - if(p_tmcl_int->executeCmd(TMCL_CMD_GGP, param_gp_type[index], req.motor_num, &val)) + if(p_tmcl_interpreter_->executeCmd(TMCL_CMD_GGP, param_gp_type_[index], req.motor_number, &val)) { - tmc_param_msg.name = param_gp_name[index]; - tmc_param_msg.value = val; - res.output.push_back(tmc_param_msg); + tmc_param_msg_.name = param_gp_name_[index]; + tmc_param_msg_.value = val; + res.output.push_back(tmc_param_msg_); } else { - tmc_param_msg.name = param_gp_name[index] + ">>> ERROR"; - tmc_param_msg.value = 0; - res.output.push_back(tmc_param_msg); + tmc_param_msg_.name = param_gp_name_[index] + ">>> ERROR"; + tmc_param_msg_.value = 0; + res.output.push_back(tmc_param_msg_); b_result = false; } } @@ -608,9 +642,9 @@ bool TmclROS::deInit() if(!this->getRetriesExceededStatus()) { - for(uint8_t index = 0; index < total_motors; index++) + for(uint8_t index = 0; index < total_motors_; index++) { - if(p_tmcl_int->executeCmd(TMCL_CMD_MST, 0, index , &val)) + if(p_tmcl_interpreter_->executeCmd(TMCL_CMD_MST, 0, index , &val)) { ROS_INFO("[%s] Stopped motor %d before shutting down...",__func__, index); } @@ -626,7 +660,7 @@ bool TmclROS::deInit() } /* Shut down the interface */ - if(p_tmcl_int != nullptr && p_tmcl_int->shutdownInterface()) + if(p_tmcl_interpreter_ != nullptr && p_tmcl_interpreter_->shutdownInterface()) { b_result = true; ROS_INFO_STREAM("[" << __func__ << "] shutdownInterface() success"); @@ -639,14 +673,14 @@ bool TmclROS::deInit() return b_result; } -/* Getter b_retries_exceeded variable */ +/* Getter b_retries_exceeded_ variable */ bool TmclROS::getRetriesExceededStatus() { bool b_result = true; - if(p_tmcl_int != nullptr) + if(p_tmcl_interpreter_ != nullptr) { - b_result = p_tmcl_int->getRetriesExceededStatus(); + b_result = p_tmcl_interpreter_->getRetriesExceededStatus(); } return b_result; diff --git a/src/tmcl_ros_node.cpp b/src/tmcl_ros_node.cpp index 5c5cc63..e147231 100644 --- a/src/tmcl_ros_node.cpp +++ b/src/tmcl_ros_node.cpp @@ -9,6 +9,7 @@ /* Globals */ TmclROS *p_tmc = nullptr; +bool g_shutdown_signal = false; /* Function Prototypes */ void graceful_shutdown(); @@ -34,7 +35,7 @@ void graceful_shutdown() void signal_callback_handler(int signum) { ROS_INFO_STREAM("> Caught signal: " << signum << ". Terminating..."); - graceful_shutdown(); + g_shutdown_signal = true; } /** @@ -57,6 +58,8 @@ int main(int argc, char** argv) { ROS_INFO_STREAM("> Starting tmcl_ros ..."); signal(SIGINT, signal_callback_handler); + signal(SIGTERM, signal_callback_handler); + signal(SIGKILL, signal_callback_handler); ROS_INFO_STREAM("> Initializing tmcl_ros ..."); p_tmc = new TmclROS(&nh); @@ -65,7 +68,7 @@ int main(int argc, char** argv) if(p_tmc->init()) { ROS_INFO_STREAM("> Successfully initialized TMCL Protocol Interpreter.\n\n"); - while(nh.ok() && !p_tmc->getRetriesExceededStatus()) + while(!g_shutdown_signal && nh.ok() && !p_tmc->getRetriesExceededStatus()) { ros::spinOnce(); } diff --git a/src/tmcl_stepper_motor.cpp b/src/tmcl_stepper_motor.cpp index 62cd500..7f7c887 100644 --- a/src/tmcl_stepper_motor.cpp +++ b/src/tmcl_stepper_motor.cpp @@ -8,8 +8,9 @@ //////////////////////////////////////////////////////////////////////////////// /* Constructor */ -StepperMotor::StepperMotor(ros::NodeHandle *p_nh, TmclInterpreter* p_tmcl_int, uint8_t motor_num) : -Motor(p_nh, p_tmcl_int, motor_num) +StepperMotor::StepperMotor(ros::NodeHandle *p_nh, TmclInterpreter* p_tmcl_interpreter, + uint16_t module_number, uint8_t motor_number) : + Motor(p_nh, p_tmcl_interpreter, module_number, motor_number) { ROS_DEBUG_STREAM("[StepperMotor::" << __func__ << "] called"); } @@ -26,67 +27,79 @@ void StepperMotor::init() ROS_INFO_STREAM("[StepperMotor::" << __func__ << "] called"); - if(p_tmcl_int->executeCmd(TMCL_CMD_GAP, "closed loop", motor_num, &val)) + if(p_tmcl_interpreter_->executeCmd(TMCL_CMD_GAP, "closed loop", motor_number_, &val)) { - comm_mode = (stepper_comm_mode_t) val; + comm_mode_ = (stepper_comm_mode_t) val; } else { - comm_mode = STEPPER_OPENLOOP_MOTOR; + comm_mode_ = STEPPER_OPENLOOP_MOTOR; ROS_WARN_STREAM("[" << __func__ << "] \"closed loop\" is not available. Set Commutation Mode to Open loop"); } - if((p_tmcl_int->executeCmd(TMCL_CMD_GAP, "motor full step resolution", motor_num, &val) || - p_tmcl_int->executeCmd(TMCL_CMD_GAP, "fullstep resolution", motor_num, &val))) + if(p_tmcl_interpreter_->executeCmd(TMCL_CMD_GAP, "MotorFullStepResolution", motor_number_, &val) || + p_tmcl_interpreter_->executeCmd(TMCL_CMD_GAP, "motor full step resolution", motor_number_, &val) || + p_tmcl_interpreter_->executeCmd(TMCL_CMD_GAP, "fullstep resolution", motor_number_, &val)) { - motor_fullstep_resolution = val; + motor_fullstep_resolution_ = val; } else { - motor_fullstep_resolution = 0; + motor_fullstep_resolution_ = 0; ROS_WARN_STREAM("[" << __func__ << "] \"motor full step resolution\" is not available"); } - if(p_tmcl_int->executeCmd(TMCL_CMD_GAP, "MicrostepResolution", motor_num, &val)) + if(p_tmcl_interpreter_->executeCmd(TMCL_CMD_GAP, "MicrostepResolution", motor_number_, &val)) { - microstep_resolution = val; - switch (microstep_resolution) + microstep_resolution_ = val; + switch (microstep_resolution_) { case 0: - microstep_resolution = 1; + microstep_resolution_ = 1; break; case 1: - microstep_resolution = 2; + microstep_resolution_ = 2; break; case 2: - microstep_resolution = 4; + microstep_resolution_ = 4; break; case 3: - microstep_resolution = 8; + microstep_resolution_ = 8; break; case 4: - microstep_resolution = 16; + microstep_resolution_ = 16; break; case 5: - microstep_resolution = 32; + microstep_resolution_ = 32; break; case 6: - microstep_resolution = 64; + microstep_resolution_ = 64; break; case 7: - microstep_resolution = 128; + microstep_resolution_ = 128; break; default: - microstep_resolution = 256; + microstep_resolution_ = 256; break; } } else { - microstep_resolution = 0; + microstep_resolution_ = 0; ROS_WARN_STREAM("[" << __func__ << "] \"MicrostepResolution\" is not available"); } + if(p_tmcl_interpreter_->executeCmd(TMCL_CMD_GAP, "relative positioning option", motor_number_, &val)) + { + ROS_INFO_STREAM("[" << __func__ << "] Relative Positioning Option: " << val); + ROS_INFO_STREAM("[" << __func__ << "] NOTE: " << param_tmc_cmd_relpos_topic_ << + " depends on the Relative Positioning Option Axis Parameter"); + ROS_INFO_STREAM(" Refer to datasheet on how to configure."); + } + else + { + ROS_WARN_STREAM("[" << __func__ << "] \"relative positioning option\" is not available"); + } /* Print units of each commands */ - if(param_wheel_diameter == 0 || motor_fullstep_resolution == 0 || microstep_resolution == 0) + if(param_wheel_diameter_ == 0 || motor_fullstep_resolution_ == 0 || microstep_resolution_ == 0) { ROS_INFO_STREAM("[" << __func__ << "] Velocity unit: pps"); } @@ -94,7 +107,7 @@ void StepperMotor::init() { ROS_INFO_STREAM("[" << __func__ << "] Velocity unit: m/s"); } - if(motor_fullstep_resolution == 0 || microstep_resolution == 0) + if(motor_fullstep_resolution_ == 0 || microstep_resolution_ == 0) { ROS_INFO_STREAM("[" << __func__ << "] Position unit: pulses"); } @@ -107,7 +120,7 @@ void StepperMotor::init() initPublisher(); this->initSubscriber(); - ROS_INFO("[%s] Motor %d Initialized!\n", __func__, motor_num); + ROS_INFO("[%s] Motor %d Initialized!\n", __func__, motor_number_); } /* Publisher Callback */ @@ -116,32 +129,26 @@ void StepperMotor::rosPublishTmcInfo(const ros::TimerEvent& event) int32_t val = 0; bool b_drv_statusflag_available = false; - tmc_info_msg.header.stamp = ros::Time::now(); - tmc_info_msg.header.seq = seq_ctr; - tmc_info_msg.header.frame_id = s_node_name + "/motor" + std::to_string(motor_num) + "/tmcl_frame"; - tmc_info_msg.interface_name = param_comm_interface_name; - tmc_info_msg.motor_num = motor_num; + tmc_info_msg_.header.stamp = ros::Time::now(); + tmc_info_msg_.header.seq = seq_ctr_; + tmc_info_msg_.header.frame_id = frame_id_; + tmc_info_msg_.interface_name = param_comm_interface_name_; + tmc_info_msg_.motor_number = motor_number_; /* Initialize messages to 0 first */ - tmc_info_msg.board_voltage = 0; - tmc_info_msg.status_flag = 0; - tmc_info_msg.velocity = 0; - tmc_info_msg.position = 0; - tmc_info_msg.torque = 0; + tmc_info_msg_.board_voltage = 0; + tmc_info_msg_.status_flag = 0; + tmc_info_msg_.velocity = 0; + tmc_info_msg_.position = 0; + tmc_info_msg_.torque = 0; - if(p_tmcl_int->executeCmd(TMCL_CMD_GAP, "SupplyVoltage", motor_num, &val)) - { - tmc_info_msg.board_voltage = val / 10; //converts mV to V - } - else - { - ROS_DEBUG_STREAM("[" << __func__ << "] Failed to get SupplyVoltage"); - } + /* No Board Voltage */ + tmc_info_msg_.board_voltage = NAN; - if(p_tmcl_int->executeCmd(TMCL_CMD_GAP, "driver error flags", motor_num, &val) || - p_tmcl_int->executeCmd(TMCL_CMD_GAP, "DrvStatusFlags", motor_num, &val)) + if(p_tmcl_interpreter_->executeCmd(TMCL_CMD_GAP, "driver error flags", motor_number_, &val) || + p_tmcl_interpreter_->executeCmd(TMCL_CMD_GAP, "DrvStatusFlags", motor_number_, &val)) { - tmc_info_msg.status = "driver error flags: "+ std::to_string(val); + tmc_info_msg_.status = "driver error flags: "+ std::to_string(val); b_drv_statusflag_available = true; } else @@ -149,15 +156,15 @@ void StepperMotor::rosPublishTmcInfo(const ros::TimerEvent& event) ROS_DEBUG_STREAM("[" << __func__ << "] Failed to get driver error flags"); } - if(p_tmcl_int->executeCmd(TMCL_CMD_GAP, "extended error flags", motor_num, &val)) + if(p_tmcl_interpreter_->executeCmd(TMCL_CMD_GAP, "extended error flags", motor_number_, &val)) { if(b_drv_statusflag_available) { - tmc_info_msg.status = tmc_info_msg.status + " | extended error flags: "+ std::to_string(val); + tmc_info_msg_.status = tmc_info_msg_.status + " | extended error flags: "+ std::to_string(val); } else { - tmc_info_msg.status = "extended error flags: " + std::to_string(val); + tmc_info_msg_.status = "extended error flags: " + std::to_string(val); } } else @@ -166,18 +173,19 @@ void StepperMotor::rosPublishTmcInfo(const ros::TimerEvent& event) } /* Velocity, Position, Torque */ - if(param_pub_actual_vel) + if(param_pub_actual_vel_) { - if(p_tmcl_int->executeCmd(TMCL_CMD_GAP, "ActualVelocity", motor_num, &val)) + if(p_tmcl_interpreter_->executeCmd(TMCL_CMD_GAP, "ActualVelocity", motor_number_, &val)) { //converts pps to linear velocity - if(param_wheel_diameter == 0 || microstep_resolution == 0 || motor_fullstep_resolution == 0) + if(param_wheel_diameter_ == 0 || microstep_resolution_ == 0 || motor_fullstep_resolution_ == 0) { - tmc_info_msg.velocity = val * param_add_ratio_vel; + tmc_info_msg_.velocity = val * param_add_ratio_vel_; } else { - tmc_info_msg.velocity = ((val * PI * param_wheel_diameter) / (microstep_resolution * motor_fullstep_resolution)) * param_add_ratio_vel; + tmc_info_msg_.velocity = val * ((PI * param_wheel_diameter_) / + (microstep_resolution_ * (float)motor_fullstep_resolution_)) * param_add_ratio_vel_; } } else @@ -186,18 +194,19 @@ void StepperMotor::rosPublishTmcInfo(const ros::TimerEvent& event) } } - if(param_pub_actual_pos) + if(param_pub_actual_pos_) { - if(p_tmcl_int->executeCmd(TMCL_CMD_GAP, "ActualPosition", motor_num, &val)) + if(p_tmcl_interpreter_->executeCmd(TMCL_CMD_GAP, "ActualPosition", motor_number_, &val)) { //converts pulses to degrees - if(microstep_resolution == 0 || motor_fullstep_resolution == 0) + if(microstep_resolution_ == 0 || motor_fullstep_resolution_ == 0) { - tmc_info_msg.position = val * param_add_ratio_pos; + tmc_info_msg_.position = val * param_add_ratio_pos_; } else { - tmc_info_msg.position = ((val * ANGULAR_FULL_ROTATION) / (microstep_resolution * motor_fullstep_resolution)) * param_add_ratio_pos; + tmc_info_msg_.position = val * (ANGULAR_FULL_ROTATION / + (microstep_resolution_ * (float)motor_fullstep_resolution_)) * param_add_ratio_pos_; } } else @@ -206,11 +215,11 @@ void StepperMotor::rosPublishTmcInfo(const ros::TimerEvent& event) } } - if(param_pub_actual_trq) + if(param_pub_actual_trq_) { - if(p_tmcl_int->executeCmd(TMCL_CMD_GAP, "torque", motor_num, &val)) + if(p_tmcl_interpreter_->executeCmd(TMCL_CMD_GAP, "torque", motor_number_, &val)) { - tmc_info_msg.torque = val * param_add_ratio_trq; + tmc_info_msg_.torque = val * param_add_ratio_trq_; } else { @@ -218,8 +227,8 @@ void StepperMotor::rosPublishTmcInfo(const ros::TimerEvent& event) } } - tmc_info_pub.publish(tmc_info_msg); - seq_ctr++; + tmc_info_pub_.publish(tmc_info_msg_); + seq_ctr_++; } /* Initialize Subscriber */ @@ -227,20 +236,20 @@ void StepperMotor::initSubscriber() { ROS_INFO_STREAM("[StepperMotor::" << __func__ << "] called"); - if(comm_mode == STEPPER_OPENLOOP_MOTOR) + if(comm_mode_ == STEPPER_OPENLOOP_MOTOR) { ROS_INFO_STREAM("[" << __func__ << "] CommutationMode : OPENLOOP"); - tmc_cmd_vel_sub = p_nh_->subscribe(param_tmc_cmd_vel_topic, 1000, &StepperMotor::cmdVelCallback, this); - tmc_cmd_abspos_sub = p_nh_->subscribe(param_tmc_cmd_abspos_topic, 1000, &StepperMotor::cmdAbsPosCallback, this); - tmc_cmd_relpos_sub = p_nh_->subscribe(param_tmc_cmd_relpos_topic, 1000, &StepperMotor::cmdRelPosCallback, this); + tmc_cmd_vel_sub_ = p_nh_->subscribe(param_tmc_cmd_vel_topic_, 1000, &StepperMotor::cmdVelCallback, this); + tmc_cmd_abspos_sub_ = p_nh_->subscribe(param_tmc_cmd_abspos_topic_, 1000, &StepperMotor::cmdAbsPosCallback, this); + tmc_cmd_relpos_sub_ = p_nh_->subscribe(param_tmc_cmd_relpos_topic_, 1000, &StepperMotor::cmdRelPosCallback, this); } - else if(comm_mode == STEPPER_CLOSEDLOOP_MOTOR) + else if(comm_mode_ == STEPPER_CLOSEDLOOP_MOTOR) { ROS_INFO_STREAM("[" << __func__ << "] CommutationMode : CLOSEDLOOP"); - tmc_cmd_vel_sub = p_nh_->subscribe(param_tmc_cmd_vel_topic, 1000, &StepperMotor::cmdVelCallback, this); - tmc_cmd_abspos_sub = p_nh_->subscribe(param_tmc_cmd_abspos_topic, 1000, &StepperMotor::cmdAbsPosCallback, this); - tmc_cmd_relpos_sub = p_nh_->subscribe(param_tmc_cmd_relpos_topic, 1000, &StepperMotor::cmdRelPosCallback, this); - tmc_cmd_trq_sub = p_nh_->subscribe(param_tmc_cmd_trq_topic, 1000, &StepperMotor::cmdTrqCallback, this); + tmc_cmd_vel_sub_ = p_nh_->subscribe(param_tmc_cmd_vel_topic_, 1000, &StepperMotor::cmdVelCallback, this); + tmc_cmd_abspos_sub_ = p_nh_->subscribe(param_tmc_cmd_abspos_topic_, 1000, &StepperMotor::cmdAbsPosCallback, this); + tmc_cmd_relpos_sub_ = p_nh_->subscribe(param_tmc_cmd_relpos_topic_, 1000, &StepperMotor::cmdRelPosCallback, this); + tmc_cmd_trq_sub_ = p_nh_->subscribe(param_tmc_cmd_trq_topic_, 1000, &StepperMotor::cmdTrqCallback, this); } } @@ -251,21 +260,23 @@ void StepperMotor::cmdVelCallback(const geometry_msgs::Twist& msg) int32_t board_val = 0; //If wheel diameter is set to 0 (or no wheels connected), the input value for linearX is equal to motors rpm - if(param_wheel_diameter == 0 || microstep_resolution == 0 || motor_fullstep_resolution == 0) + if(param_wheel_diameter_ == 0 || microstep_resolution_ == 0 || motor_fullstep_resolution_ == 0) { - board_val = val / param_add_ratio_vel; + board_val = val / param_add_ratio_vel_; } else { //Formula to convert linear value to pps (unit that the board accepts) - board_val = ((val * microstep_resolution * motor_fullstep_resolution) / (PI * param_wheel_diameter)) / param_add_ratio_vel; + board_val = val * ((microstep_resolution_ * (float)motor_fullstep_resolution_) / (PI * param_wheel_diameter_)) * + (1 / param_add_ratio_vel_); } - ROS_DEBUG_STREAM("[" << __func__ << "] Subscriber callback entered, received: " << val << " board value: " << board_val); + ROS_DEBUG_STREAM("[" << __func__ << "] Subscriber callback entered, received: " << val << " board value: " + << board_val); if(board_val >= 0) { - if(p_tmcl_int->executeCmd(TMCL_CMD_ROR, 0, motor_num, &board_val)) + if(p_tmcl_interpreter_->executeCmd(TMCL_CMD_ROR, 0, motor_number_, &board_val)) { ROS_DEBUG_STREAM("\n[" << __func__ << "] Subscriber callback exited successfully"); } @@ -277,7 +288,7 @@ void StepperMotor::cmdVelCallback(const geometry_msgs::Twist& msg) else { board_val = abs(board_val); - if(p_tmcl_int->executeCmd(TMCL_CMD_ROL, 0, motor_num, &board_val)) + if(p_tmcl_interpreter_->executeCmd(TMCL_CMD_ROL, 0, motor_number_, &board_val)) { ROS_DEBUG_STREAM("\n[" << __func__ << "] Subscriber callback exited successfully"); } @@ -294,21 +305,23 @@ void StepperMotor::cmdAbsPosCallback(const std_msgs::Int32 msg) int32_t val = msg.data; //convert input(degrees) to unit - if(microstep_resolution > 0 && motor_fullstep_resolution > 0) + if(microstep_resolution_ > 0 && motor_fullstep_resolution_ > 0) { - convert_const_deg = ((microstep_resolution * motor_fullstep_resolution) / (float) ANGULAR_FULL_ROTATION) / param_add_ratio_pos; + convert_const_deg = ((microstep_resolution_ * (float)motor_fullstep_resolution_) / ANGULAR_FULL_ROTATION) * + (1 / param_add_ratio_pos_); } else { //inverting position additional ratio - convert_const_deg = 1 / param_add_ratio_pos; + convert_const_deg = 1 / param_add_ratio_pos_; } unit_val = val * convert_const_deg; - ROS_DEBUG_STREAM("[" << __func__ << "] Subscriber callback entered, received: " << val << " board value: " << unit_val); + ROS_DEBUG_STREAM("[" << __func__ << "] Subscriber callback entered, received: " << val << " board value: " + << unit_val); - if(p_tmcl_int->executeCmd(TMCL_CMD_MVP, 0, motor_num, &unit_val)) + if(p_tmcl_interpreter_->executeCmd(TMCL_CMD_MVP, 0, motor_number_, &unit_val)) { ROS_DEBUG_STREAM("\n[" << __func__ << "] Subscriber callback exited successfully"); } @@ -324,21 +337,23 @@ void StepperMotor::cmdRelPosCallback(const std_msgs::Int32 msg) int32_t val = msg.data; //convert input(degrees) to unit - if(microstep_resolution > 0 && motor_fullstep_resolution > 0) + if(microstep_resolution_ > 0 && motor_fullstep_resolution_ > 0) { - convert_const_deg = ((microstep_resolution * motor_fullstep_resolution) / (float) ANGULAR_FULL_ROTATION) / param_add_ratio_pos; + convert_const_deg = ((microstep_resolution_ * (float)motor_fullstep_resolution_) / ANGULAR_FULL_ROTATION) * + (1 / param_add_ratio_pos_); } else { //inverting position additional ratio - convert_const_deg = 1 / param_add_ratio_pos; + convert_const_deg = 1 / param_add_ratio_pos_; } unit_val = val * convert_const_deg; - ROS_DEBUG_STREAM("[" << __func__ << "] Subscriber callback entered, received: " << val << " board value: " << unit_val); + ROS_DEBUG_STREAM("[" << __func__ << "] Subscriber callback entered, received: " << val << " board value: " + << unit_val); - if(p_tmcl_int->executeCmd(TMCL_CMD_MVP, 1, motor_num, &unit_val)) + if(p_tmcl_interpreter_->executeCmd(TMCL_CMD_MVP, 1, motor_number_, &unit_val)) { ROS_DEBUG_STREAM("\n[" << __func__ << "] Subscriber callback exited successfully"); } @@ -351,11 +366,11 @@ void StepperMotor::cmdTrqCallback(const std_msgs::Int32 msg) { int32_t val = msg.data; - val /= param_add_ratio_trq; + val /= param_add_ratio_trq_; ROS_DEBUG_STREAM("[" << __func__ << "] Subscriber callback entered, received: " << val); - if(p_tmcl_int->executeCmd(TMCL_CMD_SAP, "torque", motor_num, &val)) + if(p_tmcl_interpreter_->executeCmd(TMCL_CMD_SAP, "torque", motor_number_, &val)) { ROS_DEBUG_STREAM("\n[" << __func__ << "] Subscriber callback exited successfully"); } diff --git a/srv/TmcCustomCmd.srv b/srv/TmcCustomCmd.srv index 3a10f8a..f693ab9 100644 --- a/srv/TmcCustomCmd.srv +++ b/srv/TmcCustomCmd.srv @@ -1,6 +1,6 @@ string instruction uint8 instruction_type -uint8 motor_num +uint8 motor_number int32 value --- int32 output diff --git a/srv/TmcGapGgpAll.srv b/srv/TmcGapGgpAll.srv index 6ff3619..94804eb 100644 --- a/srv/TmcGapGgpAll.srv +++ b/srv/TmcGapGgpAll.srv @@ -1,4 +1,4 @@ -uint8 motor_num +uint8 motor_number --- TmcParam[] output bool result \ No newline at end of file