bdaiinstitute / spot_ros2

ROS 2 driver package for Boston Dynamics' Spot
Other
179 stars 62 forks source link

ModuleNotFoundError: No module named 'aiortc' #134

Closed JacobJBeck closed 1 year ago

JacobJBeck commented 1 year ago

I got this error after following the install instructions and attempting to run.

jacob@razor-crest:~/workspace/ros2_humble $ ros2 launch  spot_driver spot_driver.launch.py 
[INFO] [launch]: All log files can be found below /home/jacob/.ros/log/2023-08-22-14-04-54-735309-razor-crest-733090
[INFO] [launch]: Default logging verbosity is set to INFO
[WARNING] [launch_ros.actions.node]: Parameter file path is not a file: .
[INFO] [spot_ros2-1]: process started with pid [733092]
[INFO] [robot_state_publisher-2]: process started with pid [733094]
[robot_state_publisher-2] 2023-08-22 14:04:54.991 [RTPS_TRANSPORT_SHM Error] Failed init_port fastrtps_port7414: open_and_lock_file failed -> Function open_port_internal
[robot_state_publisher-2] 2023-08-22 14:04:54.991 [RTPS_TRANSPORT_SHM Error] Failed init_port fastrtps_port7415: open_and_lock_file failed -> Function open_port_internal
[robot_state_publisher-2] [INFO] [1692705895.009805692] [robot_state_publisher]: got segment base_link
[robot_state_publisher-2] [INFO] [1692705895.009989031] [robot_state_publisher]: got segment body
[robot_state_publisher-2] [INFO] [1692705895.010013220] [robot_state_publisher]: got segment front_left_hip
[robot_state_publisher-2] [INFO] [1692705895.010027313] [robot_state_publisher]: got segment front_left_lower_leg
[robot_state_publisher-2] [INFO] [1692705895.010038764] [robot_state_publisher]: got segment front_left_upper_leg
[robot_state_publisher-2] [INFO] [1692705895.010049595] [robot_state_publisher]: got segment front_rail
[robot_state_publisher-2] [INFO] [1692705895.010060375] [robot_state_publisher]: got segment front_right_hip
[robot_state_publisher-2] [INFO] [1692705895.010071204] [robot_state_publisher]: got segment front_right_lower_leg
[robot_state_publisher-2] [INFO] [1692705895.010082164] [robot_state_publisher]: got segment front_right_upper_leg
[robot_state_publisher-2] [INFO] [1692705895.010092820] [robot_state_publisher]: got segment rear_left_hip
[robot_state_publisher-2] [INFO] [1692705895.010103729] [robot_state_publisher]: got segment rear_left_lower_leg
[robot_state_publisher-2] [INFO] [1692705895.010114299] [robot_state_publisher]: got segment rear_left_upper_leg
[robot_state_publisher-2] [INFO] [1692705895.010125049] [robot_state_publisher]: got segment rear_rail
[robot_state_publisher-2] [INFO] [1692705895.010135618] [robot_state_publisher]: got segment rear_right_hip
[robot_state_publisher-2] [INFO] [1692705895.010146034] [robot_state_publisher]: got segment rear_right_lower_leg
[robot_state_publisher-2] [INFO] [1692705895.010157065] [robot_state_publisher]: got segment rear_right_upper_leg
[spot_ros2-1] Traceback (most recent call last):
[spot_ros2-1]   File "/home/jacob/workspace/ros2_humble/install/spot_driver/lib/spot_driver/spot_ros2", line 33, in <module>
[spot_ros2-1]     sys.exit(load_entry_point('spot-driver', 'console_scripts', 'spot_ros2')())
[spot_ros2-1]   File "/home/jacob/workspace/ros2_humble/install/spot_driver/lib/spot_driver/spot_ros2", line 25, in importlib_load_entry_point
[spot_ros2-1]     return next(matches).load()
[spot_ros2-1]   File "/usr/lib/python3.10/importlib/metadata/__init__.py", line 171, in load
[spot_ros2-1]     module = import_module(match.group('module'))
[spot_ros2-1]   File "/usr/lib/python3.10/importlib/__init__.py", line 126, in import_module
[spot_ros2-1]     return _bootstrap._gcd_import(name[level:], package, level)
[spot_ros2-1]   File "<frozen importlib._bootstrap>", line 1050, in _gcd_import
[spot_ros2-1]   File "<frozen importlib._bootstrap>", line 1027, in _find_and_load
[spot_ros2-1]   File "<frozen importlib._bootstrap>", line 1006, in _find_and_load_unlocked
[spot_ros2-1]   File "<frozen importlib._bootstrap>", line 688, in _load_unlocked
[spot_ros2-1]   File "<frozen importlib._bootstrap_external>", line 883, in exec_module
[spot_ros2-1]   File "<frozen importlib._bootstrap>", line 241, in _call_with_frames_removed
[spot_ros2-1]   File "/home/jacob/workspace/ros2_humble/build/spot_driver/spot_driver/spot_ros2.py", line 112, in <module>
[spot_ros2-1]     from spot_wrapper.cam_wrapper import SpotCamWrapper
[spot_ros2-1]   File "/home/jacob/workspace/ros2_humble/build/spot_wrapper/spot_wrapper/cam_wrapper.py", line 17, in <module>
[spot_ros2-1]     from aiortc import RTCConfiguration
[spot_ros2-1] ModuleNotFoundError: No module named 'aiortc'
[ERROR] [spot_ros2-1]: process has died [pid 733092, exit code 1, cmd '/home/jacob/workspace/ros2_humble/install/spot_driver/lib/spot_driver/spot_ros2 --ros-args -r __node:=spot_ros2'].

It's easily resolved with pip install aiortc, but that should probably be included somewhere in the install process.

JacobJBeck commented 1 year ago

I notice that spot_wrapper does include a requirements.txt, but it does not include aiortc.

heuristicus commented 1 year ago

Thanks for catching this. I've added a PR to the wrapper which adds aiortc to requirements txt (without specifying a version).

bhung-bdai commented 1 year ago

The specific version we have used prior is 1.5.0, if that helps

bhung-bdai commented 1 year ago

@heuristicus It seems like pip3 install -e . in spot_wrapper isn't installing the requirements.txt as well.

bhung-bdai commented 1 year ago

I've added a PR to spot_ros2 to make the installation process easier. Once that goes in, the directions listed should allow you to install the correct dependencies.

bhung-bdai commented 1 year ago

Issue should be fixed now.