Closed ros2torial closed 1 year ago
Hi, Your problem is probably caused by not using xacro and using its description tag
<robot name="gpio" xmlns:xacro="http://ros.org/wiki/xacro">
which needs to be interpreted first. Try with
robot_description_content = Command(
[
PathJoinSubstitution([FindExecutable(name='xacro')]),
' ',
PathJoinSubstitution(
[FindPackageShare('gpio_control'), 'urdf', 'gpio_ros2_control.urdf']
),
]
)
robot_description = {'robot_description': robot_description_content}
Thanks @mcbed , it worked.
Actually previously it was xacro only. there was some issue so i changed it to urdf as the file was simple so it should have worked. I even removed xmlns:xacro="http://ros.org/wiki/xacro" part but the normal urdf launch didn't work. Anyways the above method worked.
Thanks again!!
This didn't work for me when i tried it because the code expects anything defined under "gpios" to also be defined under command_interfaces, you will get an error because "gpio1" is not defined. It doesn't work correctly for me when trying to mix state_interfaces and command_interfaces.
This could be because the code is undergoing changes, thought I would leave a comment in case someone else finds this and attempts to use this as reference.
Hi, Can you please provide a example urdf, controller and launch file for getting started with the GPIO controller.
I am having EK1100 EtherCAT Coupler, EL1008 and EL2008 module and trying to create a gpio control using this repo and gpio_controllers package mentioned in the doc.
I created this urdf file
and this controller file
and the launch file
After running the control launch file i get this error
[INFO] [ros2_control_node-1]: process started with pid [18083] [INFO] [spawner-2]: process started with pid [18085] [ros2_control_node-1] terminate called after throwing an instance of 'std::runtime_error' [ros2_control_node-1] what(): invalid URDF passed in to robot parser [ERROR] [ros2_control_node-1]: process has died [pid 18083, exit code -6