Can't add Joint trajectory model plugin manually [closed]

asked 2016-09-21 10:17:17 -0600

rfn123 gravatar image

I've been following this Animate joints tutorial to animate my robot model in Gazebo. It says that a joint trajectory model plugin is used that listenes to the published messages of the publisher. Here is my problem: I don't really know how to embed this plugin in my own robot.

I've tried following this tutorial and this but I'm always stuck with the compiling of the plugin. I'm not sure if I did it correctly, but I copied the gazebo_ros_joint_trajectory.h and gazebo_ros_joint_trajectory.cpp file to my folder and parts of the CMakeLists.txt file.

my CMakeLists.txt file looks like this:


cmake_minimum_required(VERSION 2.8 FATAL_ERROR)

find_package(gazebo REQUIRED)


include_directories(${trajectory_msgs_INCLUDE_DIRS} ${geometry_msgs_INCLUDE_DIRS} ${image_transport_INCLUDE_DIRS} ${tf_INCLUDE_DIRS})
link_directories(${trajectory_msgs_LIBRARY_DIRS} ${geometry_msgs_LIBRARY_DIRS} ${image_transport_LIBRARY_DIRS} ${tf_LIBRARY_DIRS})
set(CMAKE_INSTALL_RPATH "${trajectory_msgs_LIBRARY_DIRS} ${geometry_msgs_LIBRARY_DIRS} ${image_transport_LIBRARY_DIRS} ${tf_LIBRARY_DIRS}")

add_library(gazebo_ros_joint_trajectory SHARED gazebo_ros_joint_trajectory.cpp)
set_target_properties(gazebo_ros_joint_trajectory PROPERTIES COMPILE_FLAGS "${trajectory_msgs_CFLAGS_OTHER} ${geometry_msgs_CFLAGS_OTHER} ${image_transport_CFLAGS_OTHER} ${tf_CFLAGS_OTHER}")
set_target_properties(gazebo_ros_joint_trajectory PROPERTIES LINK_FLAGS "${trajectory_msgs_LDFLAGS_OTHER} ${geometry_msgs_LDFLAGS_OTHER} ${image_transport_LDFLAGS_OTHER} ${tf_LDFLAGS_OTHER}")
target_link_libraries(gazebo_ros_joint_trajectory ${trajectory_msgs_LIBRARIES} ${geometry_msgs_LIBRARIES} ${image_transport_LIBRARIES} ${tf_LIBRARIES})
install (TARGETS gazebo_ros_joint_trajectory DESTINATION ${CMAKE_INSTALL_PREFIX}/lib/${PROJECT_NAME}-${DRC_SIM_VERSION}/plugins/)

cmake ../ according to the tutorial works fine, but I always get an error after the make command:

    Scanning dependencies of target gazebo_ros_joint_trajectory
[ 50%] Building CXX object CMakeFiles/gazebo_ros_joint_trajectory.dir/gazebo_ros_joint_trajectory.cpp.o
In file included from /data/home/rx/gazebo_plugins/gazebo_ros_joint_trajectory.cpp:28:0:
/data/home/rx/gazebo_plugins/gazebo_ros_joint_trajectory.h:44:29: fatal error: physics/physics.h: No such file or directory
    compilation terminated.
    CMakeFiles/gazebo_ros_joint_trajectory.dir/build.make:62: recipe for target 'CMakeFiles/gazebo_ros_joint_trajectory.dir/gazebo_ros_joint_trajectory.cpp.o' failed
    make[2]: *** [CMakeFiles/gazebo_ros_joint_trajectory.dir/gazebo_ros_joint_trajectory.cpp.o] Error 1
    CMakeFiles/Makefile2:67: recipe for target 'CMakeFiles/gazebo_ros_joint_trajectory.dir/all' failed
    make[1]: *** [CMakeFiles/gazebo_ros_joint_trajectory.dir/all] Error 2
Makefile:127: recipe for target 'all' failed
make: *** [all] Error 2

So I'm aware that apparently that header file is missing. But I didn't find it in the source folders of the plugin, so I am really lost now. I'm even doubting that this is the way to include the plugin so that the messages from the publisher is subscribed. It would be really really great if someone could help me out! Thanks in advance.

PS. I am using Ubuntu 16.04 with ROS kinetic installed (so I basically installed Gazebo with ROS)

edit retag flag offensive reopen merge delete

Closed for the following reason question is not relevant or outdated by rfn123
close date 2017-10-20 05:22:01.675690