hello-robot / stretch_install

Install scripts for the Stretch mobile manipulators from Hello Robot Inc.
Other
7 stars 14 forks source link

Create new workspace bug #64

Closed Artificys closed 5 months ago

Artificys commented 5 months ago

While trying to create a new workspace for ROS2, I kept running into this error:

###########################################
CREATING HUMBLE AMENT WORKSPACE at /home/hello-robot/space_ws
###########################################
...
Setup uncalibrated robot URDF…
update_uncalibrated_urdf.py ERROR: Traceback (most recent call last):
File “/opt/ros/humble/local/lib/python3.10/dist-packages/xacro/init.py”, line 1012, in parse
inp = f = open(filename)
FileNotFoundError: [Errno 2] No such file or directory: ‘/home/hello-robot/space_ws/src/stretch_ros2/stretch_description/urdf/stretch_description.xacro’

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File “/opt/ros/humble/local/lib/python3.10/dist-packages/xacro/init.py”, line 1119, in _process
doc = process_file(input_file_name, **opts)
File “/opt/ros/humble/local/lib/python3.10/dist-packages/xacro/init.py”, line 1096, in process_file
doc = parse(None, input_file_name)
File “/opt/ros/humble/local/lib/python3.10/dist-packages/xacro/init.py”, line 1016, in parse
raise XacroException(e.strerror + ": " + e.filename, exc=e)
xacro.XacroException: No such file or directory: /home/hello-robot/space_ws/src/stretch_ros2/stretch_description/urdf/stretch_description.xacro [Errno 2] No such file or directory: ‘/home/hello-robot/space_ws/src/stretch_ros2/stretch_description/urdf/stretch_description.xacro’

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File “/opt/ros/humble/lib/xacro/xacro”, line 33, in
sys.exit(load_entry_point(‘xacro==2.0.8’, ‘console_scripts’, ‘xacro’)())
File “/opt/ros/humble/local/lib/python3.10/dist-packages/xacro/init.py”, line 1171, in main
_process(input_file_name, vars(opts))
File “/opt/ros/humble/local/lib/python3.10/dist-packages/xacro/init.py”, line 1124, in _process
except xml.parsers.expat.ExpatError as e:
AttributeError: module ‘xml’ has no attribute ‘parsers’

Couldn't figure out why it was happening, but eventually traced it back to _stretch_urdf_rosupdate.py line 62

  if ros_version==2:
      ros_repo_path = '/home/hello-robot/ament_ws/src/stretch_ros2'
      if not os.path.exists(ros_repo_path):
          print("Unable to find stretch_ros2 packages folder in '~/ament_ws/src/'.")
          sys.exit(1)

This block of code initializes ros_repo_path, except it hardcodes the workspace directory and thus copys the URDF files there instead of to whatever new workspace you're trying to create.

Artificys commented 5 months ago

I just realized this should be in the stretch_urdf repo not this one, so I added it there. Sorry!