ros-industrial / ros2_canopen

CANopen driver framework for ROS2
https://ros-industrial.github.io/ros2_canopen/manual/rolling/
127 stars 52 forks source link

dcfgen: KeyError: 'DataType' #202

Closed jitaxis closed 9 months ago

jitaxis commented 9 months ago

I am using a KINCO FD124S Servo motor driver. Every time I try to build or specifically generate the dcf file I get the error below. I have attached the EDS file (KINCO-JD-FD.zip)

/home/jtobias/ros2_ws/install/lely_core_libraries/lib/python3.10/site-packages/dcfgen/cli.py:194: UserWarning: DefaultValue overflow in [2010sub0] slave = cls.from_dcf(str(cfg["dcf"]), env, args) Traceback (most recent call last): File "/home/jtobias/ros2_ws/install/lely_core_libraries/bin/dcfgen", line 33, in sys.exit(load_entry_point('dcf-tools==2.3.2', 'console_scripts', 'dcfgen')()) File "/home/jtobias/ros2_ws/install/lely_core_libraries/lib/python3.10/site-packages/dcfgen/cli.py", line 565, in main slave = Slave.from_config(name, cfg[name], options, args) File "/home/jtobias/ros2_ws/install/lely_core_libraries/lib/python3.10/site-packages/dcfgen/cli.py", line 194, in from_config slave = cls.from_dcf(str(cfg["dcf"]), env, args) File "/home/jtobias/ros2_ws/install/lely_core_libraries/lib/python3.10/site-packages/dcfgen/cli.py", line 186, in from_dcf return cls(cfg, env) File "/home/jtobias/ros2_ws/install/lely_core_libraries/lib/python3.10/site-packages/dcfgen/cli.py", line 14, in init super().init(cfg, env) File "/home/jtobias/ros2_ws/install/lely_core_libraries/lib/python3.10/site-packages/dcf/device.py", line 30, in init self[index] = Object(self.cfg, index, self.env) File "/home/jtobias/ros2_ws/install/lely_core_libraries/lib/python3.10/site-packages/dcf/device.py", line 137, in init self[sub_index] = SubObject.from_section( File "/home/jtobias/ros2_ws/install/lely_core_libraries/lib/python3.10/site-packages/dcf/device.py", line 188, in from_section subobj.data_type = DataType(int(section["DataType"], 0)) File "/usr/lib/python3.10/configparser.py", line 1259, in getitem raise KeyError(key) KeyError: 'DataType'

Setup: OS:

Let me know if anything else is required. Any help will be greatly appreciated. Thank you.

jitaxis commented 9 months ago

As the error says there was a DataType error, I found two entries missing the DataType parameter. I actually found the entry through trying to use the canopen python package which told me the exact line the error was on.