Add getters for fd_enabled and can_interface for openarm class (#27)
This is used for more detailed logging so that users can troubleshoot more easily. --------- Co-authored-by: Yue Yin <yue_yin@reazon.jp>
This commit is contained in:
parent
878bd85a8c
commit
f66394bd90
@ -28,6 +28,9 @@ public:
|
|||||||
OpenArm(const std::string& can_interface, bool enable_fd = false);
|
OpenArm(const std::string& can_interface, bool enable_fd = false);
|
||||||
~OpenArm() = default;
|
~OpenArm() = default;
|
||||||
|
|
||||||
|
std::string can_interface() const noexcept { return can_interface_; }
|
||||||
|
bool can_fd_enabled() const noexcept { return enable_fd_; }
|
||||||
|
|
||||||
// Component initialization
|
// Component initialization
|
||||||
void init_arm_motors(const std::vector<damiao_motor::MotorType>& motor_types,
|
void init_arm_motors(const std::vector<damiao_motor::MotorType>& motor_types,
|
||||||
const std::vector<uint32_t>& send_can_ids,
|
const std::vector<uint32_t>& send_can_ids,
|
||||||
|
|||||||
@ -55,7 +55,7 @@ void DMDeviceCollection::set_zero_all() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void DMDeviceCollection::refresh_one(int i) {
|
void DMDeviceCollection::refresh_one(int i) {
|
||||||
auto dm_device = get_dm_devices()[i];
|
auto dm_device = get_dm_devices().at(i);
|
||||||
auto& motor = dm_device->get_motor();
|
auto& motor = dm_device->get_motor();
|
||||||
CANPacket refresh_packet = CanPacketEncoder::create_refresh_command(motor);
|
CANPacket refresh_packet = CanPacketEncoder::create_refresh_command(motor);
|
||||||
send_command_to_device(dm_device, refresh_packet);
|
send_command_to_device(dm_device, refresh_packet);
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user