i3drobotics / phase_rtabmap_ros2

0 stars 0 forks source link

Error on Launch #11

Closed Rob-Otics closed 1 year ago

Rob-Otics commented 1 year ago

Won't start when trying to launch

ugv@ugv-meditel:~/dev_ws$ ros2 launch phase_rtabmap_foxy phase_rtabmap_launch.py 
[INFO] [launch]: All log files can be found below /home/ugv/.ros/log/2023-03-03-12-56-28-535635-ugv-meditel-40845
[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/foxy/lib/python3.8/site-packages/launch/launch_service.py:226> exception=FileNotFoundError(2, 'No such file or directory')>
Traceback (most recent call last):
  File "/opt/ros/foxy/lib/python3.8/site-packages/launch/launch_service.py", line 228, in _process_one_event
    await self.__process_event(next_event)
  File "/opt/ros/foxy/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/foxy/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/foxy/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/foxy/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)
  [Previous line repeated 1 more time]
  File "/opt/ros/foxy/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/foxy/lib/python3.8/site-packages/launch/action.py", line 108, in visit
    return self.execute(context)
  File "/opt/ros/foxy/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/foxy/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/foxy/lib/python3.8/site-packages/launch/launch_description_sources/python_launch_description_source.py", line 51, in _get_launch_description
    return get_launch_description_from_python_launch_file(location)
  File "/opt/ros/foxy/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/foxy/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 844, in exec_module
  File "<frozen importlib._bootstrap_external>", line 980, in get_code
  File "<frozen importlib._bootstrap_external>", line 1037, in get_data
FileNotFoundError: [Errno 2] No such file or directory: 'stereo_image_proc.launch.py'
Task exception was never retrieved
future: <Task finished name='Task-8' coro=<LaunchService._process_one_event() done, defined at /opt/ros/foxy/lib/python3.8/site-packages/launch/launch_service.py:226> exception=RuntimeError('Signal event received before subprocess transport available.')>
Traceback (most recent call last):
  File "/opt/ros/foxy/lib/python3.8/site-packages/launch/launch_service.py", line 228, in _process_one_event
    await self.__process_event(next_event)
  File "/opt/ros/foxy/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/foxy/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/foxy/lib/python3.8/site-packages/launch/action.py", line 108, in visit
    return self.execute(context)
  File "/opt/ros/foxy/lib/python3.8/site-packages/launch/actions/opaque_function.py", line 75, in execute
    return self.__function(context, *self.__args, **self.__kwargs)
  File "/opt/ros/foxy/lib/python3.8/site-packages/launch/actions/execute_process.py", line 443, in __on_signal_process_event
    raise RuntimeError('Signal event received before subprocess transport available.')
RuntimeError: Signal event received before subprocess transport available.
[INFO] [phase_camera-1]: process started with pid [40847]
[phase_camera-1] RuntimeError: module compiled against API version 0x10 but this version of numpy is 0xd
[phase_camera-1] RuntimeError: module compiled against API version 0x10 but this version of numpy is 0xd
[phase_camera-1] RuntimeError: module compiled against API version 0x10 but this version of numpy is 0xd
[phase_camera-1] ImportError: numpy.core.multiarray failed to import
[phase_camera-1] 
[phase_camera-1] The above exception was the direct cause of the following exception:
[phase_camera-1] 
[phase_camera-1] SystemError: <built-in method __contains__ of dict object at 0x7fc13ec45e80> returned a result with an error set
[phase_camera-1] 
[phase_camera-1] The above exception was the direct cause of the following exception:
[phase_camera-1] 
[phase_camera-1] Traceback (most recent call last):
[phase_camera-1]   File "/home/ugv/dev_ws/install/phase_rtabmap_foxy/lib/phase_rtabmap_foxy/phase_camera", line 11, in <module>
[phase_camera-1]     load_entry_point('phase-rtabmap-foxy==0.0.0', 'console_scripts', 'phase_camera')()
[phase_camera-1]   File "/usr/lib/python3/dist-packages/pkg_resources/__init__.py", line 490, in load_entry_point
[phase_camera-1]     return get_distribution(dist).load_entry_point(group, name)
[phase_camera-1]   File "/usr/lib/python3/dist-packages/pkg_resources/__init__.py", line 2854, in load_entry_point
[phase_camera-1]     return ep.load()
[phase_camera-1]   File "/usr/lib/python3/dist-packages/pkg_resources/__init__.py", line 2445, in load
[phase_camera-1]     return self.resolve()
[phase_camera-1]   File "/usr/lib/python3/dist-packages/pkg_resources/__init__.py", line 2451, in resolve
[phase_camera-1]     module = __import__(self.module_name, fromlist=['__name__'], level=0)
[phase_camera-1]   File "/home/ugv/dev_ws/install/phase_rtabmap_foxy/lib/python3.8/site-packages/phase_rtabmap_foxy/phase_pub.py", line 22, in <module>
[phase_camera-1]     import phase.pyphase as phase
[phase_camera-1]   File "/home/ugv/.local/lib/python3.8/site-packages/phase/__init__.py", line 58, in <module>
[phase_camera-1]     check_phase_version(phase_version)
[phase_camera-1]   File "/home/ugv/.local/lib/python3.8/site-packages/phase/__init__.py", line 41, in check_phase_version
[phase_camera-1]     from phase.pyphase import getAPIVersionString
[phase_camera-1] ImportError: initialization failed
[ERROR] [phase_camera-1]: process has died [pid 40847, exit code 1, cmd '/home/ugv/dev_ws/install/phase_rtabmap_foxy/lib/phase_rtabmap_foxy/phase_camera --left_serial 23638717 --right_serial 23638711 --camera_name Basler acA2440-35uc --device_type phobos --interface_type usb --exposure 25000 --ros-args -r __node:=phase_pub'].
kinyipchan913 commented 1 year ago

I think pyphase in not installed. Please go to https://github.com/i3drobotics/pyphase/releases/tag/v0.3.0 Download phase-0.3.0-cp38-cp38-linux_x86_64.whl

sudo apt install -y libavcodec-dev libavformat-dev libswscale-dev sudo apt install -y libgl-dev liblapack-dev libblas-dev libgtk2.0-dev sudo apt install -y libgstreamer1.0-0 libgstreamer-plugins-base1.0-0 sudo apt install -y zlib1g libstdc++6 sudo apt install -y libc6 libgcc1

cd into the directory of download file pip install ./phase-0.3.0-cp38-cp38-linux_x86_64.whl

Rob-Otics commented 1 year ago

pyphase was installed as the first step as per the instructions and we've just double checked and reinstalled, still the same error

kinyipchan913 commented 1 year ago

I am trying to reproduce the error. I see the error FileNotFoundError: [Errno 2] No such file or directory: 'stereo_image_proc.launch.py' The file should be in dev_ws/install/phase_rtabmap_foxy/share and can you check if the file 'stereo_image_proc.launch.py' is there? is .install/setup.bash is sourced

Rob-Otics commented 1 year ago

FIle exists on our machine in that location and the .install/setup.bash is sourced

kinyipchan913 commented 1 year ago

Let me chop it in smaller step to see if the camera is publishing by running the camera publish launch cd ~/dev_ws/install/phase_rtabmap_foxy/share/phase_rtabmap_foxy/ ros2 launch phase_camera_launch.py

kinyipchan913 commented 1 year ago

Can you help me to debug the issue? cd ~/dev_ws/src sudo rm -rf phase_rtabmap_foxy cd ~/dev_ws git clone https://github.com/i3drobotics/phase_rtabmap_foxy.git src/phase_rtabmap_foxy colcon build --packages-select phase_rtabmap_foxy . install/setup.bash cd ~/dev_ws/install/phase_rtabmap_foxy/share/phase_rtabmap_foxy/ ros2 launch phase_rtabmap_launch.py

Can you copy and paste the line after [INFO] [launch]: Default logging verbosity is set to INFO between Current path in the terminal? Thanks

Rob-Otics commented 1 year ago
*********************Current path********************
/home/ugv/dev_ws/src/install/phase_rtabmap_foxy/share/phase_rtabmap_foxy
*********************Current path********************

Task exception was never retrieved
future: <Task finished name='Task-2' coro=<LaunchService._process_one_event() done, defined at /opt/ros/foxy/lib/python3.8/site-packages/launch/launch_service.py:226> exception=FileNotFoundError(2, 'No such file or directory')>
Traceback (most recent call last):
  File "/opt/ros/foxy/lib/python3.8/site-packages/launch/launch_service.py", line 228, in _process_one_event
    await self.__process_event(next_event)
  File "/opt/ros/foxy/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/foxy/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/foxy/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/foxy/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)
  [Previous line repeated 1 more time]
  File "/opt/ros/foxy/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/foxy/lib/python3.8/site-packages/launch/action.py", line 108, in visit
    return self.execute(context)
  File "/opt/ros/foxy/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/foxy/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/foxy/lib/python3.8/site-packages/launch/launch_description_sources/python_launch_description_source.py", line 51, in _get_launch_description
    return get_launch_description_from_python_launch_file(location)
  File "/opt/ros/foxy/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/foxy/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 844, in exec_module
  File "<frozen importlib._bootstrap_external>", line 980, in get_code
  File "<frozen importlib._bootstrap_external>", line 1037, in get_data
FileNotFoundError: [Errno 2] No such file or directory: 'stereo_image_proc.launch.py'
Task exception was never retrieved
future: <Task finished name='Task-8' coro=<LaunchService._process_one_event() done, defined at /opt/ros/foxy/lib/python3.8/site-packages/launch/launch_service.py:226> exception=RuntimeError('Signal event received before subprocess transport available.')>
Traceback (most recent call last):
  File "/opt/ros/foxy/lib/python3.8/site-packages/launch/launch_service.py", line 228, in _process_one_event
    await self.__process_event(next_event)
  File "/opt/ros/foxy/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/foxy/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/foxy/lib/python3.8/site-packages/launch/action.py", line 108, in visit
    return self.execute(context)
  File "/opt/ros/foxy/lib/python3.8/site-packages/launch/actions/opaque_function.py", line 75, in execute
    return self.__function(context, *self.__args, **self.__kwargs)
  File "/opt/ros/foxy/lib/python3.8/site-packages/launch/actions/execute_process.py", line 443, in __on_signal_process_event
    raise RuntimeError('Signal event received before subprocess transport available.')
RuntimeError: Signal event received before subprocess transport available.
[INFO] [phase_camera-1]: process started with pid [6042]
[phase_camera-1] RuntimeError: module compiled against API version 0x10 but this version of numpy is 0xd
[phase_camera-1] RuntimeError: module compiled against API version 0x10 but this version of numpy is 0xd
[phase_camera-1] RuntimeError: module compiled against API version 0x10 but this version of numpy is 0xd
[phase_camera-1] ImportError: numpy.core.multiarray failed to import
[phase_camera-1] 
[phase_camera-1] The above exception was the direct cause of the following exception:
[phase_camera-1] 
[phase_camera-1] SystemError: <built-in method __contains__ of dict object at 0x7f57ddf21e40> returned a result with an error set
[phase_camera-1] 
[phase_camera-1] The above exception was the direct cause of the following exception:
[phase_camera-1] 
[phase_camera-1] Traceback (most recent call last):
[phase_camera-1]   File "/home/ugv/dev_ws/src/install/phase_rtabmap_foxy/lib/phase_rtabmap_foxy/phase_camera", line 11, in <module>
[phase_camera-1]     load_entry_point('phase-rtabmap-foxy==0.0.0', 'console_scripts', 'phase_camera')()
[phase_camera-1]   File "/usr/lib/python3/dist-packages/pkg_resources/__init__.py", line 490, in load_entry_point
[phase_camera-1]     return get_distribution(dist).load_entry_point(group, name)
[phase_camera-1]   File "/usr/lib/python3/dist-packages/pkg_resources/__init__.py", line 2854, in load_entry_point
[phase_camera-1]     return ep.load()
[phase_camera-1]   File "/usr/lib/python3/dist-packages/pkg_resources/__init__.py", line 2445, in load
[phase_camera-1]     return self.resolve()
[phase_camera-1]   File "/usr/lib/python3/dist-packages/pkg_resources/__init__.py", line 2451, in resolve
[phase_camera-1]     module = __import__(self.module_name, fromlist=['__name__'], level=0)
[phase_camera-1]   File "/home/ugv/dev_ws/src/install/phase_rtabmap_foxy/lib/python3.8/site-packages/phase_rtabmap_foxy/phase_pub.py", line 22, in <module>
[phase_camera-1]     import phase.pyphase as phase
[phase_camera-1]   File "/home/ugv/.local/lib/python3.8/site-packages/phase/__init__.py", line 58, in <module>
[phase_camera-1]     check_phase_version(phase_version)
[phase_camera-1]   File "/home/ugv/.local/lib/python3.8/site-packages/phase/__init__.py", line 41, in check_phase_version
[phase_camera-1]     from phase.pyphase import getAPIVersionString
[phase_camera-1] ImportError: initialization failed
[ERROR] [phase_camera-1]: process has died [pid 6042, exit code 1, cmd '/home/ugv/dev_ws/src/install/phase_rtabmap_foxy/lib/phase_rtabmap_foxy/phase_camera --left_serial 23638717 --right_serial 23638711 --camera_name Basler acA2440-35uc --device_type phobos --interface_type usb --exposure 25000 --ros-args -r __node:=phase_pub'].
kinyipchan913 commented 1 year ago

can you try to cd into the folder as follow and try those command?

cd ~/dev_ws/src . install/setup.bash cd ~/dev_ws/src/install/phase_rtabmap_foxy/share/phase_rtabmap_foxy/ ros2 launch phase_rtabmap_launch.py

Rob-Otics commented 1 year ago

Hi Yip,

There is no install directory within the src folder, this is because colcon build is done within the top level workspace directory. In this case, ~/dev_ws . Once you've sourced a ROS2 workspace you can run the following command from anywhere ros2 launch <package-name> <launch-file> which is what we have been doing.

We believe the issue maybe towards the bottom of the log around the version of numpy used. We will try upgrade the version and check that once we can get back on the pc.

kinyipchan913 commented 1 year ago

Hi Rob, Actually I have reproduced the extra same error on my side. I have deleted the stereo_image_proc.launch.py file from the same directory runs phase_rtabmap_launch.py. In the setup.py, I put all the launch files in the colcon build and created a "Share" folder. As in install/phase_rtabmap_foxy/share/phase_rtabmap_foxy. I am looking at the error

FileNotFoundError: [Errno 2] No such file or directory: 'stereo_image_proc.launch.py'

So maybe you can try to put the launch.py of stereo_image_proc.launch.py, phase_rtabmap_launch.py, and rtabmap.launch.py together in the same folder and try to run phase_rtabmap_launch.py.

kinyipchan913 commented 1 year ago

And numpy error as well, I have not reproduced that and I think you are right to look at the numpy version as well. I checked my computer runs numpy 1.23.4

Rob-Otics commented 1 year ago

Just tried upgrading numpy, we get this error.

pip install numpy --upgrade
Collecting numpy
  Downloading numpy-1.24.2-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (17.3 MB)
     |████████████████████████████████| 17.3 MB 7.1 MB/s 
ERROR: pyphase 1.0.1 has requirement numpy==1.19.1, but you'll have numpy 1.24.2 which is incompatible.
Installing collected packages: numpy
  Attempting uninstall: numpy
    Found existing installation: numpy 1.19.1
    Uninstalling numpy-1.19.1:
      Successfully uninstalled numpy-1.19.1
Successfully installed numpy-1.24.2

Because of this line - ERROR: pyphase 1.0.1 has requirement numpy==1.19.1, but you'll have numpy 1.24.2 which is incompatible. - I am going to revert back to 1.19.1

kinyipchan913 commented 1 year ago

Hi Rob, Actually I have reproduced the extra same error on my side. I have deleted the stereo_image_proc.launch.py file from the same directory runs phase_rtabmap_launch.py. In the setup.py, I put all the launch files in the colcon build and created a "Share" folder. As in install/phase_rtabmap_foxy/share/phase_rtabmap_foxy. I am looking at the error

FileNotFoundError: [Errno 2] No such file or directory: 'stereo_image_proc.launch.py'

So maybe you can try to put the launch.py of stereo_image_proc.launch.py, phase_rtabmap_launch.py, and rtabmap.launch.py together in the same folder and try to run phase_rtabmap_launch.py.

I have found the solution, seems this is the reason. If you run ugv@ugv-meditel:~/dev_ws$ ros2 launch phase_rtabmap_foxy phase_rtabmap_launch.py in dev_ws, copy the stereo_image_proc.launch.py, and rtabmap.launch.py from dev_ws/install/phase_rtabmap_foxy/share/phase_rtabmap_foxy to dev_ws.

See if it runs, on my side I think a way to store and get those launch.py in a programmed location.

kinyipchan913 commented 1 year ago

Hi Rob, I updated the code, please remove the old folder can clone the new package.

cd dev_ws sudo rm -rf src/phase_rtabmap_foxy git clone https://github.com/i3drobotics/phase_rtabmap_foxy.git src/phase_rtabmap_foxy colcon build . install/setup.bash ros2 launch phase_rtabmap_foxy phase_rtabmap_launch.py

Rob-Otics commented 1 year ago

Latest update seems to have it launching successfully, no camera appears in the RVIZ window, will open new issue with the ROS log.