I have been trying to add a RFID package from the website:
RFIDsensor_Gazebo_plugin - ROS Wiki .
Once I clone the package and try to rebuild the the workspace using catkin_make
, I get an error like this:
I tried renaming it to lowercase but received the same error.
Can anybody help me?
Hi @mamojiz97 ,
I guess your package is dependent on mavros_msgs
. So just download/install mavros_msgs
.
It should be quite simple command: sudo apt install ros-noetic-mavros-msgs
.
Once mavros_msgs
is installed, add mavros_msgs
as your package dependency in CMakeLists.txt
and package.xml
.
Let me know if this fixed your issue.
Regards,
Girish
Hey @girishkumar.kannan
Thanks for replying.
I did as you asked and couldnt solve the issue still.
cmake_minimum_required(VERSION 3.0.2)
project(RFID_tag_plugin)
set(CMAKE_PREFIX_PATH _PATH "/opt/ros/melodic;${CMAKE_MODULE_PATH}")
# add_subdirectory(third_party/yaml-cpp)
## Compile as C++11, supported in ROS Kinetic and newer
# add_compile_options(-std=c++11)
## Find catkin macros and libraries
## if COMPONENTS list like find_package(catkin REQUIRED COMPONENTS xyz)
## is used, also find other catkin packages
find_package(catkin REQUIRED COMPONENTS
gazebo_msgs
geometry_msgs
tf2_ros
mavros_msgs
roscpp
roslib
rospy
sensor_msgs
std_msgs
)
find_package(gazebo REQUIRED)
if(YAMLCPP_STATIC_LIBRARY)
set(YAMLCPP_STATIC libyaml-cpp.a)
endif()
generate_messages(
DEPENDENCIES
std_msgs mavros_msgs # Or other packages containing msgs
)
catkin_package(
INCLUDE_DIRS include
LIBRARIES RFID_tag_plugin
CATKIN_DEPENDS roscpp rospy mavros_msgs
DEPENDS system_lib
)
include_directories(
# include
${catkin_INCLUDE_DIRS}
${GAZEBO_INCLUDE_DIRS}
)
## Declare a C++ library
add_library(RFID_tag_plugin src/tags.cpp)
target_link_libraries(RFID_tag_plugin
${catkin_LIBRARIES}
${GAZEBO_LIBRARIES}
yaml-cpp
)
The above is cmakeLists.text.
<buildtool_depend>catkin</buildtool_depend>
<build_depend>gazebo_msgs</build_depend>
<build_depend>geometry_msgs</build_depend>
<build_depend>mavros_msgs</build_depend>
<build_depend>roscpp</build_depend>
<build_depend>roslib</build_depend>
<build_depend>rospy</build_depend>
<build_depend>sensor_msgs</build_depend>
<build_depend>std_msgs</build_depend>
<build_export_depend>gazebo_msgs</build_export_depend>
<build_export_depend>geometry_msgs</build_export_depend>
<build_export_depend>mavros_msgs</build_export_depend>
<build_export_depend>roscpp</build_export_depend>
<build_export_depend>roslib</build_export_depend>
<build_export_depend>rospy</build_export_depend>
<build_export_depend>sensor_msgs</build_export_depend>
<build_export_depend>std_msgs</build_export_depend>
<exec_depend>gazebo_msgs</exec_depend>
<exec_depend>geometry_msgs</exec_depend>
<exec_depend>mavros_msgs</exec_depend>
<exec_depend>roscpp</exec_depend>
<exec_depend>roslib</exec_depend>
<exec_depend>rospy</exec_depend>
<exec_depend>sensor_msgs</exec_depend>
<exec_depend>std_msgs</exec_depend>
The above is the package.xml
I receive this error:
Hi @mamojiz97 ,
I think you need to install the complete mavros
packages.
Use this command: sudo apt install ros-noetic-mavros*
[Note the asterisk sign at the end].
This will install all mavros
dependent packages.
Then try compiling again and let me know if you still get the same errors.
Regards,
Girish
Hi @girishkumar.kannan
I did like you asked and I still receive the exact same error.
I believe the problem here is that the RFID package that I am cloning is compatible with ROS Melodic and not ROS Noetic.
On ROS wiki page for the package it does say its compatible to ROS Melodic .
Could I use the same for ROS Noetic?
I moved my project to ROS Melodic and added the plugin/package and it worked.
I still want to know if its possible to make use of the package in ROS Noetic etc and how?
Hi @mamojiz97 ,
Glad to know that you have fixed your problem (by changing ROS versions).
To switch your project from Melodic
to Noetic
you need to first go through the contents of the package. It depends on the package and all the files. And wherever you find references to Melodic
you will have to replace those with Noetic
instances.
The best thing to do is to find the same (or similar package) for Noetic
version. Porting a Melodic
package to Noetic
could become time-consuming. It also requires library-level deep knowledge in ROS which is suitable for advanced users who can understand ROS architecture good enough.
You can give it a try (porting versions), but I recommend you to find a Noetic
package.
Regards,
Girish
2 Likes
system
Closed
July 17, 2023, 5:09am
8
This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.