CoppeliaRobotics / simROS2

ROS 2 Interface for CoppeliaSim
Other
31 stars 16 forks source link

Plugin for ROS Eloquent #7

Closed Tahir-Rasheed-437 closed 3 years ago

Tahir-Rasheed-437 commented 4 years ago

hey guys, Sorry for giving it as a new issue. Its not really an issue in the Interface. I have used simExtROS2Interface successfully for foxy. But I have some issues with foxy over Ros1 bridge ( and i am not sure when it will be solved) and Dashing is now too old. So i wana give a try to eloquent as it suits me for the time being. i tried to give a shot for generating the plugin for ROS eloquent but it failed to build. I guess it only supports foxy. Any tips on how i can build it for eloquent or any other way i can get the plugin for eloquent?

Thank you

METEORITENMAX commented 4 years ago

Hello Tahir, i also wanted to use the simExtROS2Interface with eloquent and had some issues. It would be helpful to know which system you are using and which error you get with:

VERBOSE=1 MAKEFLAGS=-j1 colcon build --symlink-install --event-handlers console_direct+ --parallel-workers 1

Here is my solution:

I am using Ubuntu 18.04.

  1. The first problem is the CMake version installed by apt on 18.04 is 3.10.2 but you need 3.16 or higher. Kitware offers a ppa for apt: https://blog.kitware.com/ubuntu-cmake-repository-now-available/ .

  2. Next error:

    CMake Error at CMakeLists.txt:144 (ament_export_targets):
    Unknown CMake command "ament_export_targets".

Navigate to the CMakeLists.txt line 144 and change ament_export_targets to ament_export_interfaces.

  1. Then
    
    coppelia_ros2_ws/src/sim_ros2_interface/include/sim_ros2_interface/sim_ros2_interface.h:15:10: fatal error: image_transport/image_transport.hpp: No such file or directory
    #include <image_transport/image_transport.hpp>
Open sim_ros2_interface.cpp and sim_ros2_interface.h and change all occurrences of `#include <image_transport/image_transport.hpp>` to `#include <image_transport/image_transport.h>`

If you try this you should get a similar output otherwise the package image_transport is missing.

$ locate image_transport.h /opt/ros/eloquent/include/image_transport/image_transport.h


4. One more,

In file included from ~/coppelia_ros2_ws/src/sim_ros2_interface/src/sim_ros2_interface.cpp:479:0: ~/coppelia_ros2_ws/build/sim_ros2_interface/generated/actcli_cancelLastGoal.cpp: In member function ‘void Plugin::cancelLastGoal(cancelLastGoal_in, cancelLastGoal_out)’: /home/max/coppelia_ros2_ws/build/sim_ros2_interface/generated/actcli_cancelLastGoal.cpp:6:86: error: ‘rclcpp::FutureReturnCode’ has not been declared if(rclcpp::spin_until_future_complete(node, cancel_result_future) != rclcpp::FutureReturnCode::SUCCESS)


Navigate to the templates folder and open _actcli_cancelLastGoal.cpp_.
In line 10 change **rclcpp::FutureReturnCode::SUCCESS** to **rclcpp::executor::FutureReturnCode::SUCCESS**

Then the _colcon build_ finished, the ROS2Interface load succeeded when starting CoppeliaSim and the _ros2InterfaceTopicPublisherAndSubscriber_ example works for me.

I hope this helps you.
fferri commented 3 years ago

Closing as ROS2 Eloquent is EOL