UMRT Arm Firmware Library
mks_test.hpp
1 //
2 // Created by Noah on 2024-06-13.
3 //
4 
5 #ifndef UMRT_ARM_FIRMWARE_LIB_MKS_TEST_HPP
6 #define UMRT_ARM_FIRMWARE_LIB_MKS_TEST_HPP
7 
8 #include "MKS_COMMANDS.hpp"
9 #include "mks_stepper_controller.hpp"
10 
11 #include <string>
12 #include <thread>
13 #include <vector>
14 
15 // TODO: Could use some docs
16 class MksTest {
17 public:
18  MksTest(const std::string& can_interface, std::vector<uint16_t>&& motor_ids, const uint8_t norm_factor = 1);
19 
20  void update();
21 
22  void sendTestRoutine();
23 
24 protected:
26  std::thread test_thread;
27  const std::vector<uint16_t> motor_ids;
28 
29  void onSetSpeed(const uint16_t motor, const bool status);
30 
31  void onSendStep(const uint16_t motor, const MksMoveResponse status);
32 
33  void onSeekPosition(const uint16_t motor, const MksMoveResponse status);
34 
35  void onGetPosition(const uint16_t motor, const int32_t position);
36 };
37 
38 
39 #endif //UMRT_ARM_FIRMWARE_LIB_MKS_TEST_HPP
Describes the commands which are available to send MKS SERVO57D/42D/35D/28D stepper motor driver modu...
Abstracts CAN bus communication to MKS SERVO57D/42D/35D/28D stepper motor driver modules.
Definition: mks_stepper_controller.hpp:37
Definition: mks_test.hpp:16
MksMoveResponse
Status code for the response to move commands.
Definition: mks_enums.hpp:21