StoglRobotics / ros_team_workspace

RosTeamWorkspace is a framework for boosting collaboration in teams when developing software for robots using Robot Operating System (ROS1 and ROS2).
https://rtw.stoglrobotics.de
Apache License 2.0
89 stars 18 forks source link

setup-robot-description only supported for ament_cmake pkgs? #207

Open YaraShahin opened 5 months ago

YaraShahin commented 5 months ago

Hello,

When I use setup-robot-description to make a robot bringup package on top of an ament_python package created through create-new-package, the following happens:

  1. error: sed: can't read CMakeLists.txt: No such file or directory
  2. After the process successfully finishes and the workspace is built and sourced, the launch files can't run because of this error: file 'view_my_robot.launch.xml' was not found in the share directory of package '<pkg-name>' which is at '<pkg-path>/share/robot_desc_pkg_py'

I believe these errors happen because:

  1. The first error: In https://github.com/StoglRobotics/ros_team_workspace/blob/master/scripts/setup-robot-description.bash?plain=1#L181, we try to edit CMakeLists.txt regardless of the package type (python ros2 packages don't have CMakeLists.txt).
  2. The second error happens because the targets in setup.py are not updated to include the launch file, which is subsequently not installed during colcon build.

Steps to reproduce (i was using docker rolling ubuntu22):

  1. Setup a new workspace and a new package using create-new-package and choose ament_python as the build type.
  2. browse to the ws root and colcon build && source install/setup.bash && cd src/<pkg-name>
  3. run setup-robot-description my_robot
  4. You should see the CMakeLists.txt error
  5. After the process finishes, repeat step 2.
  6. Try to ros2 launch robot_desc_pkg_py view_my_robot.launch.xml

I'm not sure if this an issue or expected behavior, but as far as I know, we can create robot description packages using ament_python.

On a different note, here a couple of suggestions that would save some debugging:

  1. For docker images, can we add to the Dockerfile instructions to install the most common packages (packages used to build robot_description and bringup and ros2_control) rightaway? i.e. xacro, robot_state_publisher_gui,...
  2. For the documentation regarding how to setup-robot-description or bringup, we could add steps such as to rosdep install, apt-get install (for any missing packages), colcon build, and source install/setup.bash.
destogl commented 4 months ago

Hi @YaraShahin, thanks for your feedback! You are right; we only support CMake packages for the robot description. the right thing to fix this would be to update the documentation to say this explicitly.