Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Pick and Place tutorial not build nor execute out of the box (Ubuntu 20.04) #1

Open
130s opened this issue Feb 23, 2023 · 3 comments
Open

Comments

@130s
Copy link

130s commented Feb 23, 2023

I came from https://roboticscasual.com/ros-tutorial-how-to-use-opencv-in-a-robot-pick-and-place-task-for-computer-vision/ (Thanks for the tutorial). Find some issues I cannot resolve:

  • ur5_gripper_moveit_config package is mentioned, but the package is not found anywhere on Internet as far as I tried.

    We do that by running the demo_gazebo.launch file of our ur5_gripper_moveit_config package with two additional arguments:

  • On Ubuntu 20.04 building with find_package(OpenCV 3 REQUIRED) fails. find_package(OpenCV 4 REQUIRED) worked. FYI I ran the set of command in a Docker container:
    apt update && apt install -y python3-catkin-tools
    export DIR_CWS=/cws
    export PKGS="opencv_services ur5_pick_and_place_opencv"
    export ROSDISTRO=noetic
    cd && mkdir -p $DIR_CWS/src
    cd $DIR_CWS && source /opt/ros/$ROSDISTRO/setup.bash
    rosdep update && rosdep install --from-paths src --ignore-src -r -y
    catkin config --install && catkin build --no-deps -j6 -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=/opt/kg  $PKGS
    
@130s
Copy link
Author

130s commented Feb 23, 2023

  • ur5_gripper_moveit_config package is mentioned, but the package is not found anywhere on Internet as far as I tried.

Ok found at https://github.com/dairal/ur5_gripper_moveit_config.

@130s 130s changed the title Package mentioned in the tutorial not found Pick and Place tutorial not build nor execute out of the box (Ubuntu 20.04) Feb 23, 2023
@130s
Copy link
Author

130s commented Feb 23, 2023

Then

# roslaunch ur5_gripper_moveit_config demo_gazebo.launch world_name:=$(rospack find ur5_pick_and_place_opencv)/world/simple_pick_and_place_collision robot_spawn_position_z_axis:=1.21
... logging to /root/.ros/log/0cdefeaa-b39b-11ed-a669-c85b766a6139/roslaunch-130s-p50-22175.log
Checking log directory for disk usage. This may take a while.
Press Ctrl-C to interrupt
Done checking log file disk usage. Usage is <1GB.

Traceback (most recent call last):
  File "/opt/ros/noetic/lib/python3/dist-packages/roslaunch/__init__.py", line 347, in main
    p.start()
  File "/opt/ros/noetic/lib/python3/dist-packages/roslaunch/parent.py", line 305, in start
    self._start_infrastructure()
  File "/opt/ros/noetic/lib/python3/dist-packages/roslaunch/parent.py", line 254, in _start_infrastructure
    self._load_config()
  File "/opt/ros/noetic/lib/python3/dist-packages/roslaunch/parent.py", line 156, in _load_config
    self.config = roslaunch.config.load_config_default(self.roslaunch_files, self.port,
  File "/opt/ros/noetic/lib/python3/dist-packages/roslaunch/config.py", line 461, in load_config_default
    loader.load(f, config, argv=args, verbose=verbose)
  File "/opt/ros/noetic/lib/python3/dist-packages/roslaunch/xmlloader.py", line 763, in load
    self._load_launch(launch, ros_config, is_core=core, filename=filename, argv=argv, verbose=verbose)
  File "/opt/ros/noetic/lib/python3/dist-packages/roslaunch/xmlloader.py", line 735, in _load_launch
    self._recurse_load(ros_config, launch.childNodes, self.root_context, None, is_core, verbose)
  File "/opt/ros/noetic/lib/python3/dist-packages/roslaunch/xmlloader.py", line 701, in _recurse_load
    val = self._include_tag(tag, context, ros_config, default_machine, is_core, verbose)
  File "/opt/ros/noetic/lib/python3/dist-packages/roslaunch/xmlloader.py", line 96, in call
    return f(*args, **kwds)
  File "/opt/ros/noetic/lib/python3/dist-packages/roslaunch/xmlloader.py", line 635, in _include_tag
    self._recurse_load(ros_config, launch.childNodes, child_ns, \
  File "/opt/ros/noetic/lib/python3/dist-packages/roslaunch/xmlloader.py", line 681, in _recurse_load
    self._param_tag(tag, context, ros_config, verbose=verbose)
  File "/opt/ros/noetic/lib/python3/dist-packages/roslaunch/xmlloader.py", line 96, in call
    return f(*args, **kwds)
  File "/opt/ros/noetic/lib/python3/dist-packages/roslaunch/xmlloader.py", line 271, in _param_tag
    value = self.param_value(verbose, name, ptype, *vals)
  File "/opt/ros/noetic/lib/python3/dist-packages/roslaunch/loader.py", line 478, in param_value
    with open(textfile, 'r') as f:
FileNotFoundError: [Errno 2] No such file or directory: '/opt/ros/noetic/share/ur_description/urdf/ur5_robotiq85_gripper.urdf.xacro'

I don't find that file anywhere on this host (Docker container).

# find / -iname ur5_robotiq85_gripper.urdf*

Not sure if the content is what the tutorial expects, but I found a file with the same name https://github.com/utecrobotics/ur5/blob/master/ur5_description/urdf/ur5_robotiq85_gripper.urdf.xacro

@130s
Copy link
Author

130s commented Feb 23, 2023

TLDR; I got it at least built and run with tweaks as follows. I leave this up to the blog author how to handle.

  1. Made changes
    $ cd ur5_gripper_moveit_config && git diff
    diff --git a/launch/demo_gazebo.launch b/launch/demo_gazebo.launch
    index 99a1603..9b5a254 100644
    --- a/launch/demo_gazebo.launch
    +++ b/launch/demo_gazebo.launch
    @@ -22,7 +22,7 @@
       <arg name="gazebo_gui" default="true"/>
       <arg name="paused" default="false"/>
       <!-- By default, use the urdf location provided from the package -->
    -  <arg name="urdf_path" default="$(find ur_description)/urdf/ur5_robotiq85_gripper.urdf.xacro"/>
    +  <arg name="urdf_path" default="$(find ur5_description)/urdf/ur5_robotiq85_gripper.urdf.xacro"/>
     
       <arg name="world_name" default="worlds/empty.world"/>
       <arg name="robot_spawn_position_z_axis" default="0.01"/>
    diff --git a/launch/planning_context.launch b/launch/planning_context.launch
    index 0ab4034..7891ea8 100644
    --- a/launch/planning_context.launch
    +++ b/launch/planning_context.launch
    @@ -6,7 +6,7 @@
       <arg name="robot_description" default="robot_description"/>
     
       <!-- Load universal robot description format (URDF) -->
    -  <param if="$(arg load_robot_description)" name="$(arg robot_description)" command="xacro  '$(find ur_description)/urdf/ur5_robotiq85_gripper.urdf.xacro'"/>
    +  <param if="$(arg load_robot_description)" name="$(arg robot_description)" command="xacro  '$(find ur5_description)/urdf/ur5_robotiq85_gripper.urdf.xacro'"/>
     
       <!-- The semantic description that corresponds to the URDF -->
       <param name="$(arg robot_description)_semantic" textfile="$(find ur5_gripper_moveit_config)/config/ur5.srdf" />
    
    $ cd ../opencv_services/ && git diff
    diff --git a/CMakeLists.txt b/CMakeLists.txt
    index 0e494a9..806b9e3 100644
    --- a/CMakeLists.txt
    +++ b/CMakeLists.txt
    @@ -17,7 +17,8 @@ find_package(catkin REQUIRED COMPONENTS
       message_generation
     )
     
    -find_package(OpenCV 3 REQUIRED)
    +#find_package(OpenCV 3 REQUIRED)
    +find_package(OpenCV 4 REQUIRED)
     
     ## Generate services in the 'srv' folder
      add_service_files(
    
  2. For Docker image, add entrypoint.
    # more /entrypoint.sh
    #!/bin/bash
    source /opt/kg/setup.bash
    
  3. Commit a Docker image.
    docker commit --change='ENTRYPOINT ["/entrypoint.sh"]' 7be71e1b791d   ros:noetic-ros-base-focal_dairal-tutorial
    
  4. Execute with rocker
    export DIMG_ROCKER=ros:noetic-ros-base-focal_dairal-tutorial
    
    rocker --x11 --user $DIMG_ROCKER roslaunch ur5_gripper_moveit_config demo_gazebo.launch world_name:=$(rospack find ur5_pick_and_place_opencv)/world/simple_pick_and_place_collision robot_spawn_position_z_axis:=1.21
    

And yet, rocker command exits without showing anything.

In the Docker container that started without rocker, the same roslaunch does seem to start processes (but still fails as GUI can't spawn unless I configure it to spawn outside of the container). So now the problem is on my Docker/rocker config.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant