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

Issue running default.launch #3

Closed
gy2256 opened this issue Nov 1, 2021 · 1 comment
Closed

Issue running default.launch #3

gy2256 opened this issue Nov 1, 2021 · 1 comment

Comments

@gy2256
Copy link

gy2256 commented Nov 1, 2021

First of all, thanks for providing this tool and the documentation is well written. Here is my development environment:

OS: Ubuntu 20.04
ROS: Noetic
XPlane: Xplane 10

I have followed the steps compile the workspace and finally get to the section Running XPlaneROS.

After setting up the

1. Open X-Plane 11 (X-Plane 11/X-Plane_x86_64).
2. Select New Flight.
3. In the LOCATION panel, set the location to Butler airport (ID : KBTP) with Runway 26.
4. Click Start Flight.

and I try to start the xplane ros
roslaunch xplane_ros default.launch

I get the following error:

auto-starting new master
process[master]: started with pid [33264]
ROS_MASTER_URI=http://localhost:11311

setting /run_id to 5eab2ac8-3af8-11ec-852e-ffe475eea05a
process[rosout-1]: started with pid [33274]
started core service [/rosout]
process[xplane_wrapper-2]: started with pid [33277]
process[ned_to_viz-3]: started with pid [33282]
process[xp_rosplane_viz-4]: started with pid [33283]
process[rviz-5]: started with pid [33284]
Traceback (most recent call last):
  File "/home/xv/xplane_ros_ws/devel/lib/xplane_ros/xplane_ros_wrapper.py", line 15, in <module>
    exec(compile(fh.read(), python_script, 'exec'), context)
  File "/home/xv/xplane_ros_ws/src/xplane_ros/scripts/xplane_ros_wrapper.py", line 5, in <module>
    from state_reader import StateReader
ModuleNotFoundError: No module named 'state_reader'

I am not sure if it's a Python problem or ROS workspace problem. The python script state_reader is located in the same folder scripts with xplane_ros_wrapper.py, but it cannot find the state_reader.py. So I edited the CMakeLists.txt file within xplane_ros package, by adding a line

catkin_install_python(PROGRAMS 
    scripts/xplane_ros_wrapper.py 
    scripts/state_reader.py # <- include state_reader.py 
    scripts/takeoff.py
    scripts/roll_hold.py
    scripts/ned_to_viz.py
    scripts/rosplane_tuner.py
    scripts/rosplane_path_viz.py
    DESTINATION ${CATKIN_PACKAGE_BIN_DESTINATION}
)

However, I am still not able to import the StateReader class, a new error message is shown below

setting /run_id to a9d84630-3aed-11ec-852e-ffe475eea05a
process[rosout-1]: started with pid [7073]
started core service [/rosout]
process[xplane_wrapper-2]: started with pid [7076]
process[ned_to_viz-3]: started with pid [7077]
process[xp_rosplane_viz-4]: started with pid [7078]
process[rviz-5]: started with pid [7083]
Traceback (most recent call last):
  File "/home/xv/xplane_ros_ws/devel/lib/xplane_ros/xplane_ros_wrapper.py", line 15, in <module>
    exec(compile(fh.read(), python_script, 'exec'), context)
  File "/home/xv/xplane_ros_ws/src/xplane_ros/scripts/xplane_ros_wrapper.py", line 5, in <module>
    from state_reader import StateReader
ImportError: cannot import name 'StateReader' from 'state_reader' (/home/xv/xplane_ros_ws/devel/.private/xplane_ros/lib/xplane_ros/state_reader.py)
[xplane_wrapper-2] process has died [pid 7076, exit code 1, cmd /home/xv/xplane_ros_ws/devel/lib/xplane_ros/xplane_ros_wrapper.py __name:=xplane_wrapper __log:=/home/xv/.ros/log/a9d84630-3aed-11ec-852e-ffe475eea05a/xplane_wrapper-2.log].
log file: /home/xv/.ros/log/a9d84630-3aed-11ec-852e-ffe475eea05a/xplane_wrapper-2*.log
[ WARN] [1635755298.803719113]: Invalid argument passed to canTransform argument source_frame in tf2 frame_ids cannot be empty
@gy2256
Copy link
Author

gy2256 commented Nov 4, 2021

OK. I have solved the problem by manually append /src/xplane_ros/scripts into PYTHONPATH by doing

PYTHONPATH=$PYTHONPATH:~/xplane_ros_ws/src/xplane_ros/scripts
export PYTHONPATH

@gy2256 gy2256 closed this as completed Nov 4, 2021
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