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

error: gazebo_ros/node.hpp: No such file or directory #66

Open
Efesendil opened this issue Apr 23, 2022 · 6 comments
Open

error: gazebo_ros/node.hpp: No such file or directory #66

Efesendil opened this issue Apr 23, 2022 · 6 comments

Comments

@Efesendil
Copy link

Hello sir, I'm having this error when i compile with colcon build, i can't solve the problem. Should I have to modify my cmake ?

cmake in Tello_gazebo:

cmake_minimum_required(VERSION 3.5)
project(tello_gazebo)

#=============

Setup

#=============

Default to C99

if (NOT CMAKE_C_STANDARD)
set(CMAKE_C_STANDARD 99)
endif ()

Default to C++14

if (NOT CMAKE_CXX_STANDARD)
set(CMAKE_CXX_STANDARD 14)
endif ()

Emulate colcon

if ($ENV{CLION_IDE})
message("Running inside CLion")
set(tello_msgs_DIR "${PROJECT_SOURCE_DIR}/../../../install/tello_msgs/share/tello_msgs/cmake")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DRUN_INSIDE_CLION")
endif ()

Find packages

find_package(ament_cmake REQUIRED)
find_package(gazebo REQUIRED) # Note uppercase variables in /usr/lib/x86_64-linux-gnu/cmake/gazebo/gazebo-config.cmake
find_package(gazebo_dev REQUIRED)
find_package(gazebo_ros REQUIRED)
find_package(geometry_msgs REQUIRED)
find_package(rclcpp REQUIRED)
find_package(sensor_msgs REQUIRED)
find_package(std_msgs REQUIRED)
find_package(tello_msgs REQUIRED)

Local includes

include_directories(
include
${gazebo_ros_INCLUDE_DIRS}
${geometry_msgs_INCLUDE_DIRS}
${std_msgs_INCLUDE_DIRS}
${tello_msgs_INCLUDE_DIRS}
)

#=============

Tello Gazebo plugin

#=============

add_library(
TelloPlugin SHARED
src/tello_plugin.cpp
)

ament_target_dependencies(
TelloPlugin
gazebo_dev
gazebo_ros
geometry_msgs
rclcpp
std_msgs
tello_msgs
)

#=============

Install

#=============

Install targets

install(
TARGETS TelloPlugin
ARCHIVE DESTINATION lib
LIBRARY DESTINATION lib
RUNTIME DESTINATION bin
)

Install world and launch files

install(
DIRECTORY models worlds launch
DESTINATION share/${PROJECT_NAME}
)

Install Python scripts

install(
PROGRAMS src/inject_entity.py
DESTINATION lib/${PROJECT_NAME}
)

#=============

Run ament macros

#=============

ament_package()

@clydemcqueen
Copy link
Owner

Hi, which version of ROS2? Which branch of tello_ros?

@Efesendil
Copy link
Author

ROS2 foxy, and /tello_ws/src/tello_ros/tello_gazebo

@clydemcqueen
Copy link
Owner

Try sudo apt install ros-foxy-gazebo-ros*

@Efesendil
Copy link
Author

Hello again sir, I have successfully compiled the workspace, thank you. But i can't use ros2 launch:
And ros2 run doesn't work also. It is a simple question but I can't find anything about it, you have any idea about it ?

~$ ros2 launch tello_gazebo simple_launch.py
usage: ros2 [-h] Call ros2 <command> -h for more detailed usage. ...
ros2: error: argument Call ros2 <command> -h for more detailed usage.: invalid choice: 'launch' (choose from 'control', 'daemon', 'extension_points', 'extensions', 'node', 'param', 'pkg', 'run', 'service')

@clydemcqueen clydemcqueen changed the title /home/parallels/tello_ws/src/tello_ros/tello_gazebo/src/tello_plugin.cpp:6:10: fatal error: gazebo_ros/node.hpp: No such file or directory 6 | #include "gazebo_ros/node.hpp" error: gazebo_ros/node.hpp: No such file or directory Apr 24, 2022
@clydemcqueen
Copy link
Owner

It seems that your ROS2 Foxy install is somehow incomplete. The typical way to install Foxy is sudo apt install ros-foxy-desktop. That should add the "launch" verb the ros2 CLI.

You may be able to fix this by running sudo apt install ros-foxy-launch*.

If you are still running into problems you might benefit from uninstalling Foxy and starting over.

If you're new to ROS2 you may enjoy the tutorials: https://docs.ros.org/en/foxy/Tutorials.html

@Efesendil
Copy link
Author

Thank you, programs are running without any problem after these commands !! I just have few questions.

  1. Im using a virtual machine (parallels), I have connected to drone wifi from my main system but i guess it doesnt connect from ubuntu. How can i figure it out ?

  2. what im exactly trying is to connect ros2 to matlab, so i need to see published and subscribed topics. I didnt find odometry messages and i cant see message descriptions when i type, ex : ros2 topic echo /cmd_vel. Do you know why?

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

2 participants