sbgisen / vesc

VESC Interface for ROS
Apache License 2.0
41 stars 33 forks source link

Hardware interface not loading for Foxy #79

Open AJBuilder opened 1 year ago

AJBuilder commented 1 year ago

Abstract

I'm working on porting to Foxy and I can't load hardware interface plugin. Keep getting a CreateClassException.

[ros2_control_node-2] terminate called after throwing an instance of 'pluginlib::CreateClassException' [ros2_control_node-2] what(): MultiLibraryClassLoader: Could not create class of type vesc_hw_interface::VescHwInterface

I've modified the interface implementations to work with Foxy.

How to Reproduce the Bug

Plugin export .xml:

<?xml version="1.0"?>
<library path="vesc_hw_interface">
  <class name="vesc_hw_interface/VescHwInterface" type="vesc_hw_interface::VescHwInterface" base_class_type="hardware_interface::ActuatorInterface">
    <description>
      plugin of VESC hardware interface
    </description>
  </class>
</library>

Urdf tag:

<ros2_control name="Vesc" type="actuator">
    <hardware>
        <plugin>vesc_hw_interface/VescHwInterface</plugin>
        <param name="port">/dev/ttyACM0</param>
        <param name="gear_ratio">1</param>
        <param name="velocity">1</param>

    </hardware>
    <joint name="left_front_motor">
        <command_interface name="velocity">
            <param name="min">-10</param>
            <param name="max">10</param>
        </command_interface>
        <state_interface name="position" />
        <state_interface name="velocity" />
        <state_interface name="effort" />
    </joint>
  </ros2_control>

Suggestion

I'm fairly convinced this isn't my urdf, and I don't recall touching anything regarding naming and exporting for the plugin.

I'm working on migrating to ros2 Foxy, so I've been modifying the interface implementations.

Can anyone point me in the right direction? Is this a interface implementation issue? I struggled to find anything useful regarding CreateClassException and the error message isn't useful.

jsupratman13 commented 1 year ago

It would be great if you could show us your working branch. Otherwise, the best we could say is to check the documentation.