orjano-max / ORJANOS_MASTER_REPO

This is the github repo for orjano's master thesis
1 stars 0 forks source link

Interbotix won't launch without Interbotix Perception #10

Closed orjano-max closed 1 year ago

orjano-max commented 1 year ago

Problem

Interbotix is utilizing a install file for their packages. In this install file, installing Interbotix Perception is a choice. We do not want Interbotix Perception as we don't need it and it is not available on ARM architecture. When trying to launch the interbotix arm without this package installed, the following error message appears:

[INFO] [launch]: All log files can be found below /home/orjan/.ros/log/2023-03-08-09-24-02-709537-orjan-Surface-Laptop-28833
[INFO] [launch]: Default logging verbosity is set to INFO
Task exception was never retrieved
future: <Task finished name='Task-2' coro=<LaunchService._process_one_event() done, defined at /opt/ros/galactic/lib/python3.8/site-packages/launch/launch_service.py:226> exception=InvalidLaunchFileError('py')>
Traceback (most recent call last):
  File "/opt/ros/galactic/lib/python3.8/site-packages/launch/launch_description_sources/any_launch_file_utilities.py", line 53, in get_launch_description_from_any_launch_file
    return loader(launch_file_path)
  File "/opt/ros/galactic/lib/python3.8/site-packages/launch/launch_description_sources/python_launch_file_utilities.py", line 62, in get_launch_description_from_python_launch_file
    launch_file_module = load_python_launch_file_as_module(python_launch_file_path)
  File "/opt/ros/galactic/lib/python3.8/site-packages/launch/launch_description_sources/python_launch_file_utilities.py", line 37, in load_python_launch_file_as_module
    loader.exec_module(mod)
  File "<frozen importlib._bootstrap_external>", line 848, in exec_module
  File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
  File "/home/orjan/git/ORJANOS_MASTER_REPO/install/husky_group/share/husky_group/launch/rviz_moveit_launch.py", line 5, in <module>
    from interbotix_xs_modules.xs_common import (
  File "/home/orjan/interbotix_ws/install/interbotix_xs_modules/lib/python3.8/site-packages/interbotix_xs_modules/__init__.py", line 38, in <module>
    from . import xs_robot
  File "/home/orjan/interbotix_ws/install/interbotix_xs_modules/lib/python3.8/site-packages/interbotix_xs_modules/xs_robot/__init__.py", line 40, in <module>
    from . import locobot
  File "/home/orjan/interbotix_ws/install/interbotix_xs_modules/lib/python3.8/site-packages/interbotix_xs_modules/xs_robot/locobot.py", line 39, in <module>
    from interbotix_perception_modules.armtag import InterbotixArmTagInterface
ModuleNotFoundError: No module named 'interbotix_perception_modules'

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "/opt/ros/galactic/lib/python3.8/site-packages/launch/launch_service.py", line 228, in _process_one_event
    await self.__process_event(next_event)
  File "/opt/ros/galactic/lib/python3.8/site-packages/launch/launch_service.py", line 248, in __process_event
    visit_all_entities_and_collect_futures(entity, self.__context))
  File "/opt/ros/galactic/lib/python3.8/site-packages/launch/utilities/visit_all_entities_and_collect_futures_impl.py", line 45, in visit_all_entities_and_collect_futures
    futures_to_return += visit_all_entities_and_collect_futures(sub_entity, context)
  File "/opt/ros/galactic/lib/python3.8/site-packages/launch/utilities/visit_all_entities_and_collect_futures_impl.py", line 45, in visit_all_entities_and_collect_futures
    futures_to_return += visit_all_entities_and_collect_futures(sub_entity, context)
  File "/opt/ros/galactic/lib/python3.8/site-packages/launch/utilities/visit_all_entities_and_collect_futures_impl.py", line 38, in visit_all_entities_and_collect_futures
    sub_entities = entity.visit(context)
  File "/opt/ros/galactic/lib/python3.8/site-packages/launch/action.py", line 108, in visit
    return self.execute(context)
  File "/opt/ros/galactic/lib/python3.8/site-packages/launch/actions/include_launch_description.py", line 130, in execute
    launch_description = self.__launch_description_source.get_launch_description(context)
  File "/opt/ros/galactic/lib/python3.8/site-packages/launch/launch_description_source.py", line 84, in get_launch_description
    self._get_launch_description(self.__expanded_location)
  File "/opt/ros/galactic/lib/python3.8/site-packages/launch/launch_description_sources/any_launch_description_source.py", line 53, in _get_launch_description
    return get_launch_description_from_any_launch_file(location)
  File "/opt/ros/galactic/lib/python3.8/site-packages/launch/launch_description_sources/any_launch_file_utilities.py", line 56, in get_launch_description_from_any_launch_file
    raise InvalidLaunchFileError(extension, likely_errors=exceptions)
launch.invalid_launch_file_error.InvalidLaunchFileError: Caught exception when trying to load file of format [py]: No module named 'interbotix_perception_modules'
orjano-max commented 1 year ago

Solution

This has to be done on ARM computer(jetson), but could also be one on AMD computer if you don't want interbotix perception Open the file: _interbotix_ws/src/interbotix_ros_toolboxes/interbotix_xs_toolbox/interbotix_xs_modules/interbotix_xs_modules/xsrobot/init.py Comment out the lines with "locobot". It should go from this:

from . import arm
from . import core
from . import gripper
# from . import hexapod
from . import locobot
from . import mr_descriptions
from . import turret

__all__ = [
    'arm',
    'core',
    'gripper',
    # 'hexapod',
    'locobot',
    'mr_descriptions',
    'turret',
]

To this:

from . import arm
from . import core
from . import gripper
# from . import hexapod
# from . import locobot
from . import mr_descriptions
from . import turret

__all__ = [
    'arm',
    'core',
    'gripper',
    # 'hexapod',
    # 'locobot',
    'mr_descriptions',
    'turret',
]