ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question
1

Qt - Cannot run PX4 .launch file

asked 2020-05-10 18:56:34 -0500

magnus gravatar image

Recently adopted the ROS plugin for Qt Creator for its use in profiling ROS nodes. However, it seems like the build/run settings cannot be set up to launch anything related to PX4. Is it possible? An example is when I set the Run tab up to roslaunch local_planner local_planner_stereo.launch that are part of the PX4 object avoidance. It builds fine but then fails on Resource not found: px4 I can run

. ~/Firmware/Tools/setup_gazebo.bash ~/Firmware ~/Firmware/build/px4_sitl_default
export ROS_PACKAGE_PATH=${ROS_PACKAGE_PATH}:~/Firmware
export GAZEBO_MODEL_PATH=${GAZEBO_MODEL_PATH}:~/catkin_ws/src/avoidance/sim/models

In the terminal window that popped up, then launch it successfully, but by then I have lost the profiling attachments. I'd be happy to provide any further details if asked.

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
1

answered 2020-05-11 00:53:29 -0500

magnus gravatar image

Found a solution. Since the ROS plugin for Qt creator sources the /catkin_ws/devel/setup.bash, some of those environment variables from that process seem to override the ones that point to PX4. However by appending the above snippet to to the /catkin_ws/devel/setup.bash file, it now correctly assigns the environment variables.

This is the resulting setup.bash file

#!/usr/bin/env bash
# generated from catkin/cmake/templates/setup.bash.in

CATKIN_SHELL=bash

# source setup.sh from same directory as this file
_CATKIN_SETUP_DIR=$(builtin cd "`dirname "${BASH_SOURCE[0]}"`" > /dev/null && pwd)
. "$_CATKIN_SETUP_DIR/setup.sh"

. ~/Firmware/Tools/setup_gazebo.bash ~/Firmware ~/Firmware/build/px4_sitl_default
export ROS_PACKAGE_PATH=${ROS_PACKAGE_PATH}:~/Firmware
export GAZEBO_MODEL_PATH=${GAZEBO_MODEL_PATH}:~/catkin_ws/src/avoidance/avoidance/sim/models
edit flag offensive delete link more

Question Tools

1 follower

Stats

Asked: 2020-05-10 18:56:34 -0500

Seen: 1,087 times

Last updated: May 11 '20