You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug
It seems, in my current set up, that the bus.yml won't compile if I simply list the slave robot joints (so without a nodes section) as follow:
options:
dcf_path: "@BUS_CONFIG_PATH@"
master:
node_id: 1
driver: "ros2_canopen::MasterDriver"
package: "canopen_master_driver"
sync_period: 10000
joint_1:
node_id: 2
dcf: "cia402_slave.eds"
driver: "ros2_canopen::Cia402Driver"
package: "canopen_402_driver"
period: 10
position_mode: 1
revision_number: 0
sdo:
- {index: 0x60C2, sub_index: 1, value: 50} # Set interpolation time for cyclic modes to 50 ms
- {index: 0x60C2, sub_index: 2, value: -3} # Set base 10-3s
- {index: 0x6081, sub_index: 0, value: 1000}
- {index: 0x6083, sub_index: 0, value: 2000}
- {index: 0x6060, sub_index: 0, value: 7}
tpdo: # TPDO needed statusword, actual velocity, actual position, mode of operation
1:
enabled: true
cob_id: "auto"
transmission: 0x01
mapping:
- {index: 0x6041, sub_index: 0} # status word
- {index: 0x6061, sub_index: 0} # mode of operation display
2:
enabled: true
cob_id: "auto"
transmission: 0x01
mapping:
- {index: 0x6064, sub_index: 0} # position actual value
- {index: 0x606c, sub_index: 0} # velocity actual position
rpdo: # RPDO needed controlword, target position, target velocity, mode of operation
1:
enabled: true
cob_id: "auto"
mapping:
- {index: 0x6040, sub_index: 0} # controlword
- {index: 0x6060, sub_index: 0} # mode of operation
2:
enabled: true
cob_id: "auto"
mapping:
- {index: 0x607A, sub_index: 0} # target position
#- {index: 0x60FF, sub_index: 0} # target velocity
joint_2:
node_id: 3
dcf: "cia402_slave.eds"
driver: "ros2_canopen::Cia402Driver"
package: "canopen_402_driver"
period: 10
position_mode: 1
revision_number: 0
switching_state: 2
sdo:
- {index: 0x60C2, sub_index: 1, value: 50} # Set interpolation time for cyclic modes to 50 ms
- {index: 0x60C2, sub_index: 2, value: -3} # Set base 10-3s
- {index: 0x6081, sub_index: 0, value: 1000}
- {index: 0x6083, sub_index: 0, value: 2000}
- {index: 0x6060, sub_index: 0, value: 7}
tpdo: # TPDO needed statusword, actual velocity, actual position, mode of operation
1:
enabled: true
cob_id: "auto"
transmission: 0x01
mapping:
- {index: 0x6041, sub_index: 0} # status word
- {index: 0x6061, sub_index: 0} # mode of operation display
2:
enabled: true
cob_id: "auto"
transmission: 0x01
mapping:
- {index: 0x6064, sub_index: 0} # position actual value
- {index: 0x606c, sub_index: 0} # velocity actual position
rpdo: # RPDO needed controlword, target position, target velocity, mode of operation
1:
enabled: true
cob_id: "auto"
mapping:
- {index: 0x6040, sub_index: 0} # controlword
- {index: 0x6060, sub_index: 0} # mode of operation
2:
enabled: true
cob_id: "auto"
mapping:
- {index: 0x607A, sub_index: 0} # target position
#- {index: 0x60FF, sub_index: 0} # target velocity
But if I add an indentation level on the joints and add the 'nodes' section, in that case it compiles:
Logs
The only log is when I colcon build my config package, the bus.yml doesn't get parsed and the 'preprocessed_bus.yml' is not created.
So I get an error of type:
sed: can't read /home/ros2_ws_canopen/build/lab_canopen_config/config/bus/preprocessed_bus.yml: No such file or directory
gmake[2]: *** [CMakeFiles/bus.dir/build.make:74: bus] Error 2
gmake[1]: *** [CMakeFiles/Makefile2:165: CMakeFiles/bus.dir/all] Error 2
gmake: *** [Makefile:146: all] Error 2
Setup:
OS: Ubuntu 22.04
ROS-Distro: Humble
Branch/Commit: Humble
Additional context
I am using ros2_canopen with ros2_control.
The bus.yml I used is as presented above, a copy of the bus.yml in ros2_canopen>canopen_tests>config>robot_control.
The text was updated successfully, but these errors were encountered:
If you really want to do this you could modify cogen.pyhere to handle the case where you don't specify the nodes section, but I just think that's what's expected of the interface at this time.
You can use defaults to specify all the common stuff between the two and just have a short nodes section that names them and captures their differences:
defaults:
dcf: "cia402_slave.eds"driver: "ros2_canopen::Cia402Driver"package: "canopen_402_driver"period: 10position_mode: 1revision_number: 0sdo:
- {index: 0x60C2, sub_index: 1, value: 50} # Set interpolation time for cyclic modes to 50 ms
- {index: 0x60C2, sub_index: 2, value: -3} # Set base 10-3s
- {index: 0x6081, sub_index: 0, value: 1000}
- {index: 0x6083, sub_index: 0, value: 2000}
- {index: 0x6060, sub_index: 0, value: 7}tpdo: # TPDO needed statusword, actual velocity, actual position, mode of operation1:
enabled: truecob_id: "auto"transmission: 0x01mapping:
- {index: 0x6041, sub_index: 0} # status word
- {index: 0x6061, sub_index: 0} # mode of operation display2:
enabled: truecob_id: "auto"transmission: 0x01mapping:
- {index: 0x6064, sub_index: 0} # position actual value
- {index: 0x606c, sub_index: 0} # velocity actual positionrpdo: # RPDO needed controlword, target position, target velocity, mode of operation1:
enabled: truecob_id: "auto"mapping:
- {index: 0x6040, sub_index: 0} # controlword
- {index: 0x6060, sub_index: 0} # mode of operation2:
enabled: truecob_id: "auto"mapping:
- {index: 0x607A, sub_index: 0} # target position#- {index: 0x60FF, sub_index: 0} # target velocitynodes:
joint_1:
node_id: 2joint_2:
node_id: 3switching_state: 2
The bus.yml I used is as presented above, a copy of the bus.yml in ros2_canopen>canopen_tests>config>robot_control.
Describe the bug
It seems, in my current set up, that the bus.yml won't compile if I simply list the slave robot joints (so without a nodes section) as follow:
But if I add an indentation level on the joints and add the 'nodes' section, in that case it compiles:
Logs
The only log is when I colcon build my config package, the bus.yml doesn't get parsed and the 'preprocessed_bus.yml' is not created.
So I get an error of type:
Setup:
Additional context
I am using ros2_canopen with ros2_control.
The bus.yml I used is as presented above, a copy of the bus.yml in ros2_canopen>canopen_tests>config>robot_control.
The text was updated successfully, but these errors were encountered: