Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

have you added the serial package as a dependency to your CMakeLists.txt?

have you added the serial package as a dependency to your CMakeLists.txt?


Edit: you haven't added the serial dependency to your CMakeLists.txt, so the include paths are never updated with it and that's most likely why the header can't be found:

find_package(catkin REQUIRED COMPONENTS
  message_generation
  message_runtime
  roscpp
  rospy
)

Refer to catkin documentation » How to do common tasks » Package format 2 (recommended) » C++ catkin library dependencies for information on how to add Catkin package dependencies, but summarising:

add the serial dependency at the end of the list of COMPONENTS in the find_package(catkin ..) call:

find_package(catkin REQUIRED COMPONENTS
  message_generation
  message_runtime
  roscpp
  rospy
  serial
)

You'll also want to add it to the catkin_package(CATKIN_DEPENDS ..) line.

And you'll need to add it as a depend to your package.xml.

have you added the serial package as a dependency to your CMakeLists.txt?


Edit: you haven't added the serial dependency to your CMakeLists.txt, so the include paths are never updated with it and that's most likely why the header can't be found:

find_package(catkin REQUIRED COMPONENTS
  message_generation
  message_runtime
  roscpp
  rospy
)

Refer to catkin documentation » How to do common tasks » Package format 2 (recommended) » C++ catkin library dependencies for information on how to add Catkin package dependencies, but summarising:

add the serial dependency at the end of the list of COMPONENTS in the find_package(catkin ..) call:

find_package(catkin REQUIRED COMPONENTS
  message_generation
  message_runtime
  roscpp
  rospy
  serial
)

You'll also want to add it to the catkin_package(CATKIN_DEPENDS ..) line.

And you'll need to add it as a depend to your package.xml.


Edit:

I followed your steps but the error still persist, I think the problem is with the configuration file of the serial directory.

so how did you install the serial package?

have you added the serial package as a dependency to your CMakeLists.txt?


Edit: you haven't added the serial dependency to your CMakeLists.txt, so the include paths are never updated with it and that's most likely why the header can't be found:

find_package(catkin REQUIRED COMPONENTS
  message_generation
  message_runtime
  roscpp
  rospy
)

Refer to catkin documentation » How to do common tasks » Package format 2 (recommended) » C++ catkin library dependencies for information on how to add Catkin package dependencies, but summarising:

add the serial dependency at the end of the list of COMPONENTS in the find_package(catkin ..) call:

find_package(catkin REQUIRED COMPONENTS
  message_generation
  message_runtime
  roscpp
  rospy
  serial
)

You'll also want to add it to the catkin_package(CATKIN_DEPENDS ..) line.

And you'll need to add it as a depend to your package.xml.


Edit:

I followed your steps but the error still persist, I think the problem is with the configuration file of the serial directory.

so how did you install the serial package?


Edit 2:

find_package(catkin REQUIRED COMPONENTS
   message_generation
   message_runtime
   roscpp
   rospy
   serial 
)

[..]

include_directories(include)

Your include path doesn't appear to be setup correctly.

As-is, none of the packages you find_package(catkin .. COMPONENTS ..) is present on the include path, leading to the error you see.

You'll want to add ${catkin_INCLUDE_DIRS} to the include_directories(..) statement.

Again, please catkin documentation » How to do common tasks » Package format 2 (recommended) » C++ catkin library dependencies where this is explained and shown.