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:
thomason 2025-09-02 18:46:18 +09:00 committed by GitHub
parent 878bd85a8c
commit f66394bd90
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 4 additions and 1 deletions

View File

@ -28,6 +28,9 @@ public:
OpenArm(const std::string& can_interface, bool enable_fd = false);
~OpenArm() = default;
std::string can_interface() const noexcept { return can_interface_; }
bool can_fd_enabled() const noexcept { return enable_fd_; }
// Component initialization
void init_arm_motors(const std::vector<damiao_motor::MotorType>& motor_types,
const std::vector<uint32_t>& send_can_ids,

View File

@ -55,7 +55,7 @@ void DMDeviceCollection::set_zero_all() {
}
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();
CANPacket refresh_packet = CanPacketEncoder::create_refresh_command(motor);
send_command_to_device(dm_device, refresh_packet);