Closed Lau86 closed 11 months ago
Looks like there is an issue with the nodes section. It seems to be yaml issue in the config file. Can't say more without the config file though.
Hi @ipa-cmh im having the same error and using the exact config files from the tutorial "How to create a robot system with ros2_control" (using the humble readthedocs)
What i found very interesting ( pardon my stupidity in advance ) is that i could NOT build the package with the instructions given in point 1
ros2 pkg create --dependencies ros2_canopen lely_core_libraries --build-type ament_cmake {package_name}
To get get to the package to build was to modify the CMakeList.txt file changing the name to:
find_package(canopen_ros2_control REQUIRED)
Any help would be apreciated, I'm trying to use this package to communicate with my robots servo motors "the proper way" but i guess i am condemned to use arduino code like a noob 4eva
// Set synchronous velocity profile
if (input == "set\n"){
Serial.print("received:");
Serial.print(input);
CAN0.sendMsgBuf(0x601, 0, 8, set_sync_control);
CAN0.sendMsgBuf(0x601, 0, 8, set_profile_vel_mode);
BTW you guys are the best ! :heart: would love to contribute to this repo even if only to correct some of the typos or outdated docs (but to scared to do so) :fearful:
Hi @flippybit and @Lau86,
To create a package, please use the following command instead of the one in the documentation:
ros2 pkg create --dependencies canopen lely_core_libraries --build-type ament_cmake {package_name}
Also, to remove TypeError: list indices must be integers or slices, not dict
change the following in bus.yml.
nodes:
joint_1:
node_id: 2
joint_2:
node_id: 3
This will be fixed in #176
Thank you very much for your help !
Hi @ipa-vsp and @Lau86,
First of all thnx @ipa-vsp for pointing me in the right direction and @Lau86 for starting this thread. I dont know if im breaching github etiquette with the following post please correct me if i should open a new issue instead.
I have continued with the "How to create a robot system with ros2_control" (using the humble readthedocs) And have found other potential pitfalls for others following this guide.
At this point you should have built your package and sourced setup.bash file and be ready to launch your newly built package, if following the guide should be called canopen_robot_control_example
The command to do this should look like this:
$ ros2 launch canopen_robot_control_example robot_control.launch.py
It seems like there is a FileNotFoundError:
FileNotFoundError: [Errno 2] No such file or directory: '/home/water/ROS2PORT/canopen_ws/install/canopen_tests/share/canopen_tests/robot_controller/robot_controller.urdf.xacro'
(my path and workspace name will not be the same as yours, in my case my workspace name is called canopen_ws )
/home/water/ROS2PORT/canopen_ws/
install/canopen_tests/share/canopen_tests/robot_controller/robot_controller.urdf.xacro
I modified the robot_control.launch.py of the canopen_robot_control_example package to point it to the correct path into the urdf directory.
def generate_launch_description():
robot_description_content = Command(
[
PathJoinSubstitution([FindExecutable(name="xacro")]),
" ",
PathJoinSubstitution(
[
FindPackageShare("canopen_tests"),
"urdf", #<---- THIS LINE
"robot_controller",
"robot_controller.urdf.xacro",
]
),
]
)
You should now be able to run the canopen_robot_control_example package with:
ros2 launch canopen_robot_control_example robot_control.launch.py
Hurray !! :tada:
@flippybit Many thanks for the review! I would really appreciate a PR if you can do that?
@ipa-cmh Thanx to you! for your awesome ROS2 package I would be honored to do so! Im not sure if ill do it right. But ill give it my best try. :sweat_smile:
@flippybit thanks for your help, we @ipa-vsp merged the your changes with #176. I will close this.
Hello, I'm currently working on creating a robot system with ros2_control. I have followed the instructions in the manual. However, I'm having problems building my package. More specifically, I'm getting the following errors:
Traceback (most recent call last): File "/home/ros2_humble/install/lely_core_libraries/bin/cogen", line 33, in
sys.exit(load_entry_point('cogen==0.2.7', 'console_scripts', 'cogen')())
File "/home/ros2_humble/install/lely_core_libraries/local/lib/python3.10/dist-packages/cogen/cogen.py", line 59, in main
nodes[node_name][entry_name] = defaults[entry_name]
TypeError: list indices must be integers or slices, not dict
gmake[2]: [CMakeFiles/robot_control.dir/build.make:73: robot_control] Error 1
gmake[1]: [CMakeFiles/Makefile2:165: CMakeFiles/robot_control.dir/all] Error 2
gmake: *** [Makefile:146: all] Error 2
Failed <<< canopen_robot_control_example [0.66s, exited with code 2]
(ros2_humble is the name of my workspace)
Have any of you already encountered this error when building this package? If so, could you help me understand the underlying cause of this error and find a solution?
Any help or suggestions would be greatly appreciated. Thank you in advance for your support!