PX4 / PX4-Autopilot

PX4 Autopilot Software
https://px4.io
BSD 3-Clause "New" or "Revised" License
8.5k stars 13.51k forks source link

Resource not found: px4 ROS path [0] .. #20437

Closed JomondLim closed 4 months ago

JomondLim commented 2 years ago

After following the offboard control example (python), when running roslaunch offboard_py start_offb.launch, i received this error despite adding the extra few lines to the bashrc as instructed in the tutorial: Resource not found: px4 ROS path [0]=/opt/ros/melodic/share/ros ROS path [1]=/home/ubuntu/catkin_ws/src/mavlink ROS path [2]=/home/ubuntu/catkin_ws/src/mavros/libmavconn ROS path [3]=/home/ubuntu/catkin_ws/src/mavros/mavros_msgs ROS path [4]=/home/ubuntu/catkin_ws/src/mavros/mavros ROS path [5]=/home/ubuntu/catkin_ws/src/mavros/mavros_extras ROS path [6]=/home/ubuntu/catkin_ws/src/offboard_py ROS path [7]=/home/ubuntu/catkin_ws/src/mavros/test_mavros ROS path [8]=/opt/ros/melodic/share The traceback for the exception was written to the log file

This is what my .bashrc file is looking like:

source /opt/ros/melodic/setup.bash source ~/PX4-Autopilot/Tools/simulation/gazebo/setup_gazebo.bash ~/PX4-Autopilot ~/PX4-Autopilot/build/px4_sitl_default source /home/ubuntu/catkin_ws/devel/setup.bash export ROS_PACKAGE_PATH=$ROS_PACKAGE_PATH:~/PX4-Autopilot export ROS_PACKAGE_PATH=$ROS_PACKAGE_PATH:~/PX4-Autopilot/Tools/simulation/gazebo/sitl_gazebo export GAZEBO_MODEL_PATH=$GAZEBO_MODEL_PATH:~/PX4-Autopilot/Tools/simulation/gazebo/sitl_gazebo export GAZEBO_PLUGIN_PATH=$GAZEBO_PLUGIN_PATH:/usr/lib/aarch64-linux-gnu/gazebo-9/plugins

Would appreciate if someone helps with this issue. Thanks in advance

Jaeyoung-Lim commented 2 years ago

@JomondLim Are you sure your PX4 autopilot source exists in the path /PX4-Autopilot ?

You can check with

ls /PX4-Autopilot
JomondLim commented 2 years ago

@Jaeyoung-Lim

Hi thanks for the reply,

When we ran ls PX4-Autopilot, we received CMakeLists.txt LICENSE cmake posix-configs CODE_OF_CONDUCT.md Makefile eclipse.cproject src CONTRIBUTING.md README.md eclipse.project test CTestConfig.cmake ROMFS integrationtests test_data Documentation Tools launch validation Firmware.sublime-project appveyor.yml msg Jenkinsfile boards package.xml Kconfig build platform

Correct me if i'm wrong, but isn't src PX4 Autopilot's source?

stevenchangg commented 2 years ago

Hi @JomondLim

Currently I am facing the same issue as you :( Have u figured out the solution to it ? Would mean a lot as I have been struggling with this issue for a week @Jaeyoung-Lim Thank you

FrancSerra commented 1 year ago

I'm currently facing the exact same problem. DId you guys managed to fix this? @stevenchangg @JomondLim. I really need help on this. Thank you very much

beniaminopozzan commented 1 year ago

@FrancSerra are you referring to this script? https://docs.px4.io/main/en/ros/mavros_offboard_python.html#launching-your-script

FrancSerra commented 1 year ago

@FrancSerra are you referring to this script? https://docs.px4.io/main/en/ros/mavros_offboard_python.html#launching-your-script

Yes indeed I am

beniaminopozzan commented 1 year ago

ok, then try to use

source ~/PX4-Autopilot/Tools/simulation/gazebo-classic/setup_gazebo.bash ~/PX4-Autopilot ~/PX4-Autopilot/build/px4_sitl_default
export ROS_PACKAGE_PATH=$ROS_PACKAGE_PATH:~/PX4-Autopilot
export ROS_PACKAGE_PATH=$ROS_PACKAGE_PATH:~/PX4-Autopilot/Tools/simulation/gazebo-classic/sitl_gazebo-classic

instead of

source ~/PX4-Autopilot/Tools/simulation/gazebo/setup_gazebo.bash ~/PX4-Autopilot ~/PX4-Autopilot/build/px4_sitl_default
export ROS_PACKAGE_PATH=$ROS_PACKAGE_PATH:~/PX4-Autopilot
export ROS_PACKAGE_PATH=$ROS_PACKAGE_PATH:~/PX4-Autopilot/Tools/simulation/gazebo/sitl_gazebo
export GAZEBO_PLUGIN_PATH=$GAZEBO_PLUGIN_PATH:/usr/lib/x86_64-linux-gnu/gazebo-9/plugins

the reason is the sitl_gazebo has been renamed sitl_gazebo-classic and it is now located in Tools/simulation/gazebo-classic/sitl_gazebo-classic

pranavc2255 commented 1 year ago

ok, then try to use

source ~/PX4-Autopilot/Tools/simulation/gazebo-classic/setup_gazebo.bash ~/PX4-Autopilot ~/PX4-Autopilot/build/px4_sitl_default
export ROS_PACKAGE_PATH=$ROS_PACKAGE_PATH:~/PX4-Autopilot
export ROS_PACKAGE_PATH=$ROS_PACKAGE_PATH:~/PX4-Autopilot/Tools/simulation/gazebo-classic/sitl_gazebo-classic

instead of

source ~/PX4-Autopilot/Tools/simulation/gazebo/setup_gazebo.bash ~/PX4-Autopilot ~/PX4-Autopilot/build/px4_sitl_default
export ROS_PACKAGE_PATH=$ROS_PACKAGE_PATH:~/PX4-Autopilot
export ROS_PACKAGE_PATH=$ROS_PACKAGE_PATH:~/PX4-Autopilot/Tools/simulation/gazebo/sitl_gazebo
export GAZEBO_PLUGIN_PATH=$GAZEBO_PLUGIN_PATH:/usr/lib/x86_64-linux-gnu/gazebo-9/plugins

the reason is the sitl_gazebo has been renamed sitl_gazebo-classic and it is now located in Tools/simulation/gazebo-classic/sitl_gazebo-classic

Did anyone solve this issue?

I am still getting the same error, even changing to gazebo-classic?

pranavc2255 commented 1 year ago

I'm currently facing the exact same problem. DId you guys managed to fix this? @stevenchangg @JomondLim. I really need help on this. Thank you very much

Did you solve my friend?

Jaeyoung-Lim commented 1 year ago

@pranavc2255 High chance that your change to gazebo-classic was incomplete. Please share what you actually did

mgrallos commented 1 year ago

I'm getting the same error and I'm new to PX4. what if I use this for simulation "make -j8 px4_sitl_default gazebo " and not gazebo-classic? Also, I don't see a "simulation" folder inside my /PX4-Autopilot/Tools directory.

beniaminopozzan commented 1 year ago

@mgrallos please share which PX4 version / commit / tag you are currently using.

mgrallos commented 1 year ago

@mgrallos please share which PX4 version / commit / tag you are currently using. it says v1.12.3

image

mgrallos commented 1 year ago

here's the inside my PX4-Autopilot/Tools directory image

beniaminopozzan commented 1 year ago

@mgrallos , you are working with version 1.12 then, please follow the gazebo simulation documentation for that version https://docs.px4.io/v1.12/en/simulation/gazebo.html

MyriadsR commented 4 months ago

ok, then try to use

source ~/PX4-Autopilot/Tools/simulation/gazebo-classic/setup_gazebo.bash ~/PX4-Autopilot ~/PX4-Autopilot/build/px4_sitl_default
export ROS_PACKAGE_PATH=$ROS_PACKAGE_PATH:~/PX4-Autopilot
export ROS_PACKAGE_PATH=$ROS_PACKAGE_PATH:~/PX4-Autopilot/Tools/simulation/gazebo-classic/sitl_gazebo-classic

instead of

source ~/PX4-Autopilot/Tools/simulation/gazebo/setup_gazebo.bash ~/PX4-Autopilot ~/PX4-Autopilot/build/px4_sitl_default
export ROS_PACKAGE_PATH=$ROS_PACKAGE_PATH:~/PX4-Autopilot
export ROS_PACKAGE_PATH=$ROS_PACKAGE_PATH:~/PX4-Autopilot/Tools/simulation/gazebo/sitl_gazebo
export GAZEBO_PLUGIN_PATH=$GAZEBO_PLUGIN_PATH:/usr/lib/x86_64-linux-gnu/gazebo-9/plugins

the reason is the sitl_gazebo has been renamed sitl_gazebo-classic and it is now located in Tools/simulation/gazebo-classic/sitl_gazebo-classic

Did anyone solve this issue?

I am still getting the same error, even changing to gazebo-classic?

This really works!!!! Thank you!