GithubHelp home page GithubHelp logo

coppeliarobotics / simros2 Goto Github PK

View Code? Open in Web Editor NEW
27.0 3.0 14.0 1.49 MB

ROS 2 Interface for CoppeliaSim

License: Other

CMake 4.64% C++ 86.08% Lua 4.82% Python 3.19% C 1.27%
coppeliasim-plugin coppeliasim-plugin-simstubsgen

simros2's Introduction

ROS2 Interface plugin for CoppeliaSim

Supported ROS2 versions:

  • Humble Hawksbill

Compiling

NOTE: the directory containing all files (i.e. package.xml etc) must be called sim_ros2_interface, otherwise build will fail.

  1. Install required packages for simStubsGen: see simStubsGen's README
  2. Checkout
$ git clone https://github.com/CoppeliaRobotics/simROS2.git sim_ros2_interface
$ cd sim_ros2_interface
$ git checkout coppeliasim-v4.5.0-rev0

NOTE: replace coppeliasim-v4.5.0-rev0 with the actual CoppeliaSim version you have.

  1. Edit meta/interfaces.txt if you need to include more ROS interfaces. You need to specify the fully qualified interface, e.g. geometry_msgs/msg/Twist rather than Twist. If an interface uses non-primitive types (i.e. other interfaces), then those should be added as well.
  2. Compile
$ colcon build --symlink-install

Note: if you are reporting a compile error, please use this command to build:

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

Add --cmake-args -DCMAKE_BUILD_TYPE=Debug if you are encountering a runtime error (e.g. crash, unexpected behavior, etc...).

Note: gcc can fail compile the plugin when a large number of interfaces is compiled in. Use clang in that case, i.e.:

sudo apt install clang
export CXX=clang++
colcon build ...

simros2's People

Contributors

ccpjboss avatar coppelia avatar fferri avatar lordty avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

simros2's Issues

Plugin for ROS Eloquent

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

Simulator stops sending messages

I still can't reproduce the error, but it happens quite frequently. I'm trying to use Coppelia to simulate a NAV2 environment with SLAM. After some time closing and starting the nodes to check the bringup scripts and configuration, it tells me that it (some node) can't find some transforms (which should be published by coppelia). If I try to use ros2 topic echo /clock or ros2 topic echo /tf I get no results. Debugging tells me that simROS2.publish and simROS2.sendTransforms are being called.

Nevertheless, RVIZ (which was left open all the time) still displays the correct simulation time, and it pauses if I pause the simulation. Why does rviz have still access to the topics? Why new nodes can't see them?

Edit: rqt, which was also left open, still shows the /sim_ros2_interface and topics if I hit "refresh". But if I open a new instance, the topics don't appear.

Environment

  • Manjaro Linux 2023-01-05
  • CoppeliaSim V4.4.0
  • ROS2 humble

error: cannot initialize a parameter of type 'simBool *' (aka 'unsigned char *') with an lvalue of type 'bool *'

I'm getting the following error when i'm trying to compile the plugin in ubuntu 22.04:

Starting >>> sim_ros2_interface
[Processing: sim_ros2_interface]                             
[Processing: sim_ros2_interface]ros2_interface:build 90% - 1min 0.2s]
[Processing: sim_ros2_interface]                                       
[Processing: sim_ros2_interface]                                       
[Processing: sim_ros2_interface]                                       
--- stderr: sim_ros2_interface                                         
/home/krisv/Documentos/CoppeliaSim_Edu_V4_4_0_rev0_Ubuntu22_04/programming/libPlugin/simPlusPlus/Lib.cpp:281:49: error: cannot initialize a parameter of type 'simBool *' (aka 'unsigned char *') with an lvalue of type 'bool *'
    int ret = simGetStackBoolValue(stackHandle, boolValue);
                                                ^~~~~~~~~
/home/krisv/Documentos/CoppeliaSim_Edu_V4_4_0_rev0_Ubuntu22_04/programming/libPlugin/simPlusPlus/Lib.cpp:584:36: error: cannot initialize a parameter of type 'simFloat *' (aka 'float *') with an rvalue of type 'double *'
    if(simGetFloatParam(parameter, &ret) == -1)
                                   ^~~~
/home/krisv/Documentos/CoppeliaSim_Edu_V4_4_0_rev0_Ubuntu22_04/programming/libPlugin/simPlusPlus/Lib.cpp:646:58: error: cannot initialize a parameter of type 'simFloat *' (aka 'float *') with an rvalue of type 'double *'
    if(simGetObjectFloatParam(objectHandle, parameterID, &ret) == -1)
                                                         ^~~~
/home/krisv/Documentos/CoppeliaSim_Edu_V4_4_0_rev0_Ubuntu22_04/programming/libPlugin/simPlusPlus/Lib.cpp:773:25: error: cannot initialize a parameter of type 'const simChar *' (aka 'const char *') with an lvalue of type 'void *'
    if(simReleaseBuffer(buffer) == -1)
                        ^~~~~~
/home/krisv/Documentos/CoppeliaSim_Edu_V4_4_0_rev0_Ubuntu22_04/programming/libPlugin/simPlusPlus/Lib.cpp:814:65: error: cannot initialize a parameter of type 'simFloat *' (aka 'float *') with an rvalue of type 'std::array<double, 12>::pointer' (aka 'double *')
    if(simGetObjectMatrix(objectHandle, relativeToObjectHandle, ret.data()) == -1)
                                                                ^~~~~~~~~~
/home/krisv/Documentos/CoppeliaSim_Edu_V4_4_0_rev0_Ubuntu22_04/programming/libPlugin/simPlusPlus/Lib.cpp:821:65: error: cannot initialize a parameter of type 'const simFloat *' (aka 'const float *') with an rvalue of type 'std::array<double, 12>::const_pointer' (aka 'const double *')
    if(simSetObjectMatrix(objectHandle, relativeToObjectHandle, matrix.data()) == -1)
                                                                ^~~~~~~~~~~~~
/home/krisv/Documentos/CoppeliaSim_Edu_V4_4_0_rev0_Ubuntu22_04/programming/libPlugin/simPlusPlus/Lib.cpp:846:70: error: cannot initialize a parameter of type 'simFloat *' (aka 'float *') with an rvalue of type 'std::array<double, 3>::pointer' (aka 'double *')
    if(simGetObjectOrientation(objectHandle, relativeToObjectHandle, ret.data()) == -1)
                                                                     ^~~~~~~~~~
/home/krisv/Documentos/CoppeliaSim_Edu_V4_4_0_rev0_Ubuntu22_04/programming/libPlugin/simPlusPlus/Lib.cpp:853:70: error: cannot initialize a parameter of type 'const simFloat *' (aka 'const float *') with an rvalue of type 'std::array<double, 3>::const_pointer' (aka 'const double *')
    if(simSetObjectOrientation(objectHandle, relativeToObjectHandle, eulerAngles.data()) == -1)
                                                                     ^~~~~~~~~~~~~~~~~~
/home/krisv/Documentos/CoppeliaSim_Edu_V4_4_0_rev0_Ubuntu22_04/programming/libPlugin/simPlusPlus/Lib.cpp:874:67: error: cannot initialize a parameter of type 'simFloat *' (aka 'float *') with an rvalue of type 'std::array<double, 3>::pointer' (aka 'double *')
    if(simGetObjectPosition(objectHandle, relativeToObjectHandle, ret.data()) == -1)
                                                                  ^~~~~~~~~~
/home/krisv/Documentos/CoppeliaSim_Edu_V4_4_0_rev0_Ubuntu22_04/programming/libPlugin/simPlusPlus/Lib.cpp:881:67: error: cannot initialize a parameter of type 'const simFloat *' (aka 'const float *') with an rvalue of type 'std::array<double, 3>::const_pointer' (aka 'const double *')
    if(simSetObjectPosition(objectHandle, relativeToObjectHandle, position.data()) == -1)
                                                                  ^~~~~~~~~~~~~~~
/home/krisv/Documentos/CoppeliaSim_Edu_V4_4_0_rev0_Ubuntu22_04/programming/libPlugin/simPlusPlus/Lib.cpp:888:69: error: cannot initialize a parameter of type 'simFloat *' (aka 'float *') with an rvalue of type 'std::array<double, 4>::pointer' (aka 'double *')
    if(simGetObjectQuaternion(objectHandle, relativeToObjectHandle, ret.data()) == -1)
                                                                    ^~~~~~~~~~
/home/krisv/Documentos/CoppeliaSim_Edu_V4_4_0_rev0_Ubuntu22_04/programming/libPlugin/simPlusPlus/Lib.cpp:895:69: error: cannot initialize a parameter of type 'const simFloat *' (aka 'const float *') with an rvalue of type 'std::array<double, 4>::const_pointer' (aka 'const double *')
    if(simSetObjectQuaternion(objectHandle, relativeToObjectHandle, quaternion.data()) == -1)
                                                                    ^~~~~~~~~~~~~~~~~
/home/krisv/Documentos/CoppeliaSim_Edu_V4_4_0_rev0_Ubuntu22_04/programming/libPlugin/simPlusPlus/Lib.cpp:918:43: error: cannot initialize a parameter of type 'simFloat *' (aka 'float *') with an rvalue of type 'std::array<double, 3>::pointer' (aka 'double *')
    if(simGetObjectVelocity(objectHandle, lin.data(), ang.data()) == -1)
                                          ^~~~~~~~~~
/home/krisv/Documentos/CoppeliaSim_Edu_V4_4_0_rev0_Ubuntu22_04/programming/libPlugin/simPlusPlus/Lib.cpp:952:22: error: cannot initialize a parameter of type 'const simChar *' (aka 'const char *') with an lvalue of type 'int *'
    simReleaseBuffer(returnedBuff);
                     ^~~~~~~~~~~~
14 errors generated.
gmake[2]: *** [CMakeFiles/simExtROS2.dir/build.make:157: CMakeFiles/simExtROS2.dir/home/krisv/Documentos/CoppeliaSim_Edu_V4_4_0_rev0_Ubuntu22_04/programming/libPlugin/simPlusPlus/Lib.cpp.o] Error 1
gmake[2]: *** Se espera a que terminen otras tareas....
/home/krisv/Documentos/rob2023/ros2_coppe/src/sim_ros2_interface/src/sim_ros2_interface.cpp:787:27: warning: object backing the pointer will be destroyed at the end of the full-expression [-Wdangling-gsl]
            auto &param = params_client->get_parameters({in->name}).front();
                          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/home/krisv/Documentos/rob2023/ros2_coppe/src/sim_ros2_interface/src/sim_ros2_interface.cpp:798:27: warning: object backing the pointer will be destroyed at the end of the full-expression [-Wdangling-gsl]
            auto &param = params_client->get_parameters({in->name}).front();
                          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/home/krisv/Documentos/rob2023/ros2_coppe/src/sim_ros2_interface/src/sim_ros2_interface.cpp:809:27: warning: object backing the pointer will be destroyed at the end of the full-expression [-Wdangling-gsl]
            auto &param = params_client->get_parameters({in->name}).front();
                          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/home/krisv/Documentos/rob2023/ros2_coppe/src/sim_ros2_interface/src/sim_ros2_interface.cpp:820:27: warning: object backing the pointer will be destroyed at the end of the full-expression [-Wdangling-gsl]
            auto &param = params_client->get_parameters({in->name}).front();
                          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
4 warnings generated.
gmake[1]: *** [CMakeFiles/Makefile2:164: CMakeFiles/simExtROS2.dir/all] Error 2
gmake: *** [Makefile:146: all] Error 2
---
Failed   <<< sim_ros2_interface [2min 31s, exited with code 2]

Summary: 0 packages finished [2min 31s]
  1 package failed: sim_ros2_interface
  1 package had stderr output: sim_ros2_interface

libPlugin/README.md no longer exists

Looks like the readme needs to be updated. The libPlugin readme linked no longer exists. I was going to figure out how to install libPlugin and then do a pull request to update simExtROS2Interface readme with new instructions but ran out of time. Note I am trying to install ROS2 interface for foxy, ubuntu Focal. Can we document the install method in this readme or update the link?

https://github.com/CoppeliaRobotics/simExtROS2Interface/blob/master/external/libPlugin/README.md

Reference to libPlugin in the readme

Hi, the readme of this repository refers to the documentation of libPlugin, but that does not exist anymore. The new repository include.git does not have a readme...
So it is not clear which are the dependencies to be installed in step 1

calling simROS2.advertiseService causes crashing with "undefined symbol:_ZN22rosidl_typesupport_cpp31get_service_type_support_handleIN8std_srvs3srv5EmptyEEEPK29rosidl_service_type_support_tv"

When creating a ROS2 service in a non-threaded script:

service = simROS2.advertiseService('coppelia_node/service', 'std_srvs/Empty', 'service_callback')

the simulator crashes with the following error message:

libsimExtROS2Interface.so: undefined symbol:_ZN22rosidl_typesupport_cpp31get_service_type_support_handleIN8std_srvs3srv5EmptyEEEPK29rosidl_service_type_support_tv

I am using CoppeliaSim Pro V4.0.0. (rev. 4) with ROS2 Eloquent Elusor on Ubuntu 18.04. The ROS2 plugin for the simulator loads properly since I've been able to communicate in publisher-subscriber manner with no issues - only services lead to crashing. The same problem occurs when calling simROS2.createService.

Related topic on CoppeliaSim forum

Unknown CMake command "coppeliasim_add_plugin".

Starting >>> sim_ros2_interface
--- stderr: sim_ros2_interface
CMake Error at CMakeLists.txt:86 (coppeliasim_add_plugin):
Unknown CMake command "coppeliasim_add_plugin".


Failed <<< sim_ros2_interface [3.04s, exited with code 1]

Summary: 0 packages finished [3.17s]
1 package failed: sim_ros2_interface
1 package had stderr output: sim_ros2_interface

Interface for sensor_msgs/msg/CameraInfo needs also sensor_msgs/msg/RegionOfInterest

This is more a feature request than an issue.

I'm running Ubuntu 22.04 LTS with ROS2 humble.

When adding sensor_msgs/msg/CameraInfo message to meta/interface.txt build fails:

$ colcon build --symlink-install --packages-select sim_ros2_interface
Starting >>> sim_ros2_interface
[Processing: sim_ros2_interface]                             
[Processing: sim_ros2_interface]                                     
[Processing: sim_ros2_interface]                                       
[Processing: sim_ros2_interface]                                       
[Processing: sim_ros2_interface]                                       
[Processing: sim_ros2_interface]                                       
[Processing: sim_ros2_interface]                                       
[Processing: sim_ros2_interface]                                       
[Processing: sim_ros2_interface]                                       
[Processing: sim_ros2_interface]                                       
[Processing: sim_ros2_interface]                                       
[Processing: sim_ros2_interface]                                       
--- stderr: sim_ros2_interface                                         
/home/fspindle/colcon_ws/build/sim_ros2_interface/generated/callbacks.cpp: In function ‘void write__sensor_msgs__msg__CameraInfo(const CameraInfo&, int, const ROS2WriteOptions*)’:
/home/fspindle/colcon_ws/build/sim_ros2_interface/generated/callbacks.cpp:1457:13: error: ‘write__sensor_msgs__msg__RegionOfInterest’ was not declared in this scope; did you mean ‘DEPRECATED__sensor_msgs__msg__RegionOfInterest’?
 1457 |             write__sensor_msgs__msg__RegionOfInterest(msg.roi, stack, opt);
      |             ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      |             DEPRECATED__sensor_msgs__msg__RegionOfInterest
/home/fspindle/colcon_ws/build/sim_ros2_interface/generated/callbacks.cpp: In function ‘void read__sensor_msgs__msg__CameraInfo(int, sensor_msgs::msg::CameraInfo*, const ROS2ReadOptions*)’:
/home/fspindle/colcon_ws/build/sim_ros2_interface/generated/callbacks.cpp:1673:25: error: ‘read__sensor_msgs__msg__RegionOfInterest’ was not declared in this scope; did you mean ‘DEPRECATED__sensor_msgs__msg__RegionOfInterest’?
 1673 |                         read__sensor_msgs__msg__RegionOfInterest(stack, &(msg->roi), opt);
      |                         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      |                         DEPRECATED__sensor_msgs__msg__RegionOfInterest
gmake[2]: *** [CMakeFiles/simExtROS2.dir/build.make:227: CMakeFiles/simExtROS2.dir/generated/callbacks.cpp.o] Error 1
gmake[2]: *** Waiting for unfinished jobs....
gmake[1]: *** [CMakeFiles/Makefile2:164: CMakeFiles/simExtROS2.dir/all] Error 2
gmake: *** [Makefile:146: all] Error 2
---
Failed   <<< sim_ros2_interface [6min 27s, exited with code 2]

Summary: 0 packages finished [6min 27s]
  1 package failed: sim_ros2_interface
  1 package had stderr output: sim_ros2_interface

The trick is to add also sensor_msgs/msg/RegionOfInterest to meta/interface.txt the make the build succeed.

I didn't investigate so far, but as an end user, it could be interesting that in your mechanism you find a way to add automatically the dependencies of a given message.

I have a Compile ERROR

Hello
I'm following the official tutrials, but have a error.
When I compile this project

colcon build
Starting >>> ros2_bubble_rob
Starting >>> sim_ros2_interface
Finished <<< ros2_bubble_rob [0.83s]
[Processing: sim_ros2_interface]
[Processing: sim_ros2_interface]
--- stderr: sim_ros2_interface
Traceback (most recent call last):
File "/home/maxiaoyu/workspace/coppeliasim_workspace/ros2_workspace/src/sim_ros2_interface/tools/parse_messages_and_services.py", line 253, in
pickle.dump(data, f)
_pickle.PicklingError: Can't pickle <class 'parse_messages_and_services.MsgInfo'>: it's not the same object as parse_messages_and_services.MsgInfo
make[2]: *** [ros-msg-srv-defs.pickle] Error 1
make[2]: *** Deleting file 'ros-msg-srv-defs.pickle'
make[1]: *** [CMakeFiles/generate_ros_code.dir/all] Error 2
make: *** [all] Error 2

Failed <<< sim_ros2_interface [ Exited with code 2 ]

Summary: 1 package finished [1min 15s]
1 package failed: sim_ros2_interface
1 package had stderr output: sim_ros2_interface

So, does anyone know how to resolve this?

Cheers

"Colcon Build --symlink-install" Broke on latest commit

Error:
--- stderr: sim_ros2_interface /home/afoster2/Documents/sim_ros2_interface/src/ros_msg_builtin_io.cpp: In function ‘void read__bool(int, bool*, const ROS2ReadOptions*)’: /home/afoster2/Documents/sim_ros2_interface/src/ros_msg_builtin_io.cpp:19:38: error: cannot convert ‘bool*’ to ‘simBool*’ {aka ‘unsigned char*’} 19 | if(sim::getStackBoolValue(stack, &v) == 1) | ^~ | | | bool* In file included from /home/afoster2/Documents/sim_ros2_interface/build/sim_ros2_interface/generated/stubs.h:4, from /home/afoster2/Documents/sim_ros2_interface/src/ros_msg_builtin_io.cpp:4: /home/afoster2/Documents/CoppeliaSim_Edu_V4_4_0_rev0_Ubuntu20_04/programming/libPlugin/simPlusPlus/Lib.h:124:59: note: initializing argument 2 of ‘simInt sim::getStackBoolValue(simInt, simBool*)’ 124 | simInt getStackBoolValue(simInt stackHandle, simBool *boolValue); | ~~~~~~~~~^~~~~~~~~ gmake[2]: *** [CMakeFiles/simExtROS2.dir/build.make:213: CMakeFiles/simExtROS2.dir/src/ros_msg_builtin_io.cpp.o] Error 1 gmake[1]: *** [CMakeFiles/Makefile2:164: CMakeFiles/simExtROS2.dir/all] Error 2 gmake: *** [Makefile:146: all] Error 2

simExtROS2 on ROS2 Galactic

ROS2: Galactic
OS: Ubuntu 20.04

Hello! I was trying to install this in my ROS2 Galactic, but always get this error when trying to build this package. Is this a known issue?

/home/ccpjboss/ros2_coppeliatest/build/sim_ros2_interface/generated/cli_call.cpp: In member function ‘void Plugin::call(call_in*, call_out*)’:
/home/ccpjboss/ros2_coppeliatest/build/sim_ros2_interface/generated/cli_call.cpp:8:25: error: ‘rclcpp::executor’ has not been declared
    8 |                 rclcpp::executor::FutureReturnCode::SUCCESS)
      |                         ^~~~~~~~
/home/ccpjboss/ros2_coppeliatest/build/sim_ros2_interface/generated/cli_call.cpp:25:25: error: ‘rclcpp::executor’ has not been declared
   25 |                 rclcpp::executor::FutureReturnCode::SUCCESS)
      |                         ^~~~~~~~
/home/ccpjboss/ros2_coppeliatest/build/sim_ros2_interface/generated/cli_call.cpp:42:25: error: ‘rclcpp::executor’ has not been declared
   42 |                 rclcpp::executor::FutureReturnCode::SUCCESS)
      |                         ^~~~~~~~
/home/ccpjboss/ros2_coppeliatest/build/sim_ros2_interface/generated/cli_call.cpp:59:25: error: ‘rclcpp::executor’ has not been declared
   59 |                 rclcpp::executor::FutureReturnCode::SUCCESS)
      |                         ^~~~~~~~
In file included from /home/ccpjboss/ros2_coppeliatest/src/sim_ros2_interface/src/sim_ros2_interface.cpp:446:
/home/ccpjboss/ros2_coppeliatest/build/sim_ros2_interface/generated/actcli_sendGoal.cpp: In member function ‘void Plugin::sendGoal(sendGoal_in*, sendGoal_out*)’:
/home/ccpjboss/ros2_coppeliatest/build/sim_ros2_interface/generated/actcli_sendGoal.cpp:43:96: error: ‘rclcpp::executor’ has not been declared
   43 |         out->success = rclcpp::spin_until_future_complete(node, goal_handle_future) == rclcpp::executor::FutureReturnCode::SUCCESS;

If I go check the given file /home/ccpjboss/ros2_coppeliatest/build/sim_ros2_interface/generated/cli_call.cpp I see have this:

    else if(actionClientProxy->actionType == "example_interfaces/action/Fibonacci")
    {
        auto cli = boost::any_cast< std::shared_ptr< rclcpp_action::Client<example_interfaces::action::Fibonacci> > >(actionClientProxy->action_client);
        if(!cli->wait_for_action_server(std::chrono::seconds(5)))
            throw sim::exception("action server not available after wait");
        example_interfaces::action::Fibonacci::Goal goal_msg;
        read__example_interfaces__action__Fibonacci__Goal(in->_.stackID, &goal_msg, &(actionClientProxy->rd_opt));
        auto send_goal_options = rclcpp_action::Client<example_interfaces::action::Fibonacci>::SendGoalOptions();
        send_goal_options.goal_response_callback = [=] (std::shared_future< std::shared_ptr< rclcpp_action::ClientGoalHandle<example_interfaces::action::Fibonacci> > > future) -> void
        {
            actionGoalResponseCallback_in in1;
            actionGoalResponseCallback_out out1;
            auto goal_handle = future.get();
            in1.goalID = goal_handle ? goalUUIDtoString(goal_handle->get_goal_id()) : "";
            in1.accepted = !!goal_handle;
            actionGoalResponseCallback(actionClientProxy->goalResponseCallback.scriptId, actionClientProxy->goalResponseCallback.name.c_str(), &in1, &out1);
        };
        send_goal_options.feedback_callback = [=] (rclcpp_action::ClientGoalHandle<example_interfaces::action::Fibonacci>::SharedPtr goal_handle, const std::shared_ptr<const example_interfaces::action::Fibonacci::Feedback> feedback) -> void
        {
            ros_action_callback__example_interfaces__action__Fibonacci__Feedback(actionClientProxy->feedbackCallback.scriptId, actionClientProxy->feedbackCallback.name.c_str(), goal_handle->get_goal_id(), feedback.get(), actionClientProxy);
        };
        send_goal_options.result_callback = [=] (const rclcpp_action::ClientGoalHandle<example_interfaces::action::Fibonacci>::WrappedResult &result) -> void
        {
            int lua_code;
            switch(result.code)
            {
            case rclcpp_action::ResultCode::SUCCEEDED:
                lua_code = sim_ros2_action_result_code_succeeded;
                break;
            case rclcpp_action::ResultCode::ABORTED:
                lua_code = sim_ros2_action_result_code_aborted;
                break;
            case rclcpp_action::ResultCode::CANCELED:
                lua_code = sim_ros2_action_result_code_canceled;
                break;
            default:
                lua_code = sim_ros2_action_result_code_unknown;
                break;
            }
            ros_action_callback__example_interfaces__action__Fibonacci__Result(actionClientProxy->resultCallback.scriptId, actionClientProxy->resultCallback.name.c_str(), result.goal_id, lua_code, result.result, actionClientProxy);
        };
        auto goal_handle_future = cli->async_send_goal(goal_msg, send_goal_options);
        out->success = rclcpp::spin_until_future_complete(node, goal_handle_future) == rclcpp::executor::FutureReturnCode::SUCCESS;
        rclcpp_action::ClientGoalHandle<example_interfaces::action::Fibonacci>::SharedPtr goal_handle = goal_handle_future.get();
        actionClientProxy->last_goal_handle = goal_handle;
    }

std_msgs/msg/Float64MultiArray problem

Hi, when adding std_msgs/msg/Float64MultiArray inside interfaces.txt an error appear during compilation:

/home/ros2_ws/build/sim_ros2_interface/generated/callbacks.cpp: In function ‘void write__std_msgs__msg__Float64MultiArray(const Float64MultiArray&, int, const ROS2WriteOptions*)’:
/home/ros2_ws/build/sim_ros2_interface/generated/callbacks.cpp:2739:13: error: ‘write__std_msgs__msg__MultiArrayLayout’ was not declared in this scope; did you mean ‘DEPRECATED__std_msgs__msg__MultiArrayLayout’?
 2739 |             write__std_msgs__msg__MultiArrayLayout(msg.layout, stack, opt);
      |             ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      |             DEPRECATED__std_msgs__msg__MultiArrayLayout
/home/ros2_ws/build/sim_ros2_interface/generated/callbacks.cpp: In function ‘void read__std_msgs__msg__Float64MultiArray(int, std_msgs::msg::Float64MultiArray*, const ROS2ReadOptions*)’:
/home/ros2_ws/build/sim_ros2_interface/generated/callbacks.cpp:2800:25: error: ‘read__std_msgs__msg__MultiArrayLayout’ was not declared in this scope; did you mean ‘DEPRECATED__std_msgs__msg__MultiArrayLayout’?
 2800 |                         read__std_msgs__msg__MultiArrayLayout(stack, &(msg->layout), opt);
      |                         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      |                         DEPRECATED__std_msgs__msg__MultiArrayLayout
gmake[2]: *** [CMakeFiles/simExtROS2.dir/build.make:227: CMakeFiles/simExtROS2.dir/generated/callbacks.cpp.o] Error 1
gmake[2]: *** Waiting for unfinished jobs....
gmake[1]: *** [CMakeFiles/Makefile2:164: CMakeFiles/simExtROS2.dir/all] Error 2
gmake: *** [Makefile:146: all] Error 2

I'm using ubuntu 22.04 and ros2 humble.

Thanks!

Compiling for/with ROS2 Crystal

Hi,

I would like to know whether it is somehow possible to compile the plugin for ROS2 Crystal instead of ROS2 Dashing or if I can at least compile it with ROS2 Dashing and then use it to communicate with ROS2 Crystal. I have a system I cannot update and would love to use the plug-in.

Regards

Nick

Plugin fails to load

Hi there. It looks like simExtROS2Interface was fixed for foxy in May (6431eb59034a783c00ca0f4844167fda24058cb1). I hoped that compiling from the latest commit at the time of writing would yield an .so file that would be compatible with both foxy, and coppeliasim 4.0 (albeit with a few adjustments here and there, eg updating repos in $COPPELIA_SIM_ROOT_DIR/programming/). Alas, this is not the case. The plugin doesn't load, despite all the dependencies being found. I have pasted the output of libLoadErrorCheck.sh at bottom, and some basic system info is below.

Do you have any idea what might be going on?

My system is running:
kernel: 5.4.0-37-generic
OS: Ubuntu 20.04 LTS
CoppeliaSim Version: 4.0.0
ROS2 Version: foxy

To build the repo, I pulled the latest commits from include and libPlugin

./libLoadErrorCheck.sh        linux-vdso.so.1 (0x00007ffd30bef000)
       libstd_srvs__rosidl_typesupport_cpp.so =>
/opt/ros/foxy/lib/libstd_srvs__rosidl_typesupport_cpp.so
(0x00007f053c499000)
       libexample_interfaces__rosidl_typesupport_cpp.so =>
/opt/ros/foxy/lib/libexample_interfaces__rosidl_typesupport_cpp.so
(0x00007f053c486000)
       libimage_transport.so => /opt/ros/foxy/lib/libimage_transport.so
(0x00007f053c37a000)
       librclcpp.so => /opt/ros/foxy/lib/librclcpp.so (0x00007f053c1ae000)
       libsensor_msgs__rosidl_typesupport_cpp.so =>
/opt/ros/foxy/lib/libsensor_msgs__rosidl_typesupport_cpp.so
(0x00007f053c1a1000)
       librcutils.so => /opt/ros/foxy/lib/librcutils.so (0x00007f053c189000)
       libdl.so.2 => /lib/x86_64-linux-gnu/libdl.so.2 (0x00007f053c13e000)
       libtf2_ros.so => /opt/ros/foxy/lib/libtf2_ros.so (0x00007f053c0bb000)
       libtf2_msgs__rosidl_typesupport_cpp.so =>
/opt/ros/foxy/lib/libtf2_msgs__rosidl_typesupport_cpp.so
(0x00007f053c0b2000)
       librclcpp_action.so => /opt/ros/foxy/lib/librclcpp_action.so
(0x00007f053c093000)
       librcl_action.so => /opt/ros/foxy/lib/librcl_action.so
(0x00007f053c080000)
       liblibstatistics_collector.so =>
/opt/ros/foxy/lib/liblibstatistics_collector.so (0x00007f053c077000)
       librcl.so => /opt/ros/foxy/lib/librcl.so (0x00007f053c03d000)
       libstatistics_msgs__rosidl_typesupport_cpp.so =>
/opt/ros/foxy/lib/libstatistics_msgs__rosidl_typesupport_cpp.so
(0x00007f053c038000)
       libtracetools.so => /opt/ros/foxy/lib/libtracetools.so
(0x00007f053c033000)
       libgeometry_msgs__rosidl_typesupport_cpp.so =>
/opt/ros/foxy/lib/libgeometry_msgs__rosidl_typesupport_cpp.so
(0x00007f053c027000)
       libstd_msgs__rosidl_typesupport_cpp.so =>
/opt/ros/foxy/lib/libstd_msgs__rosidl_typesupport_cpp.so
(0x00007f053c01b000)
       libbuiltin_interfaces__rosidl_typesupport_cpp.so =>
/opt/ros/foxy/lib/libbuiltin_interfaces__rosidl_typesupport_cpp.so
(0x00007f053c014000)
       libstdc++.so.6 => /usr/lib/x86_64-linux-gnu/libstdc++.so.6
(0x00007f053be33000)
       libgcc_s.so.1 => /lib/x86_64-linux-gnu/libgcc_s.so.1 (0x00007f053be18000)
       libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007f053bc26000)
       /lib64/ld-linux-x86-64.so.2 (0x00007f053ded0000)
       librosidl_typesupport_cpp.so =>
/opt/ros/foxy/lib/librosidl_typesupport_cpp.so (0x00007f053bc1f000)
       libaction_msgs__rosidl_typesupport_cpp.so =>
/opt/ros/foxy/lib/libaction_msgs__rosidl_typesupport_cpp.so
(0x00007f053bc19000)
       libmessage_filters.so => /opt/ros/foxy/lib/libmessage_filters.so
(0x00007f053bc12000)
       libament_index_cpp.so => /opt/ros/foxy/lib/libament_index_cpp.so
(0x00007f053bc06000)
       libclass_loader.so => /opt/ros/foxy/lib/libclass_loader.so
(0x00007f053bbf0000)
       libconsole_bridge.so.0.5 => /opt/ros/foxy/lib/libconsole_bridge.so.0.5
(0x00007f053bbea000)
       libtinyxml2.so.6 => /usr/lib/x86_64-linux-gnu/libtinyxml2.so.6
(0x00007f053bbd3000)
       librcpputils.so => /opt/ros/foxy/lib/librcpputils.so (0x00007f053bbca000)
       librcl_yaml_param_parser.so =>
/opt/ros/foxy/lib/librcl_yaml_param_parser.so (0x00007f053bbbf000)
       librosgraph_msgs__rosidl_typesupport_cpp.so =>
/opt/ros/foxy/lib/librosgraph_msgs__rosidl_typesupport_cpp.so
(0x00007f053bbba000)
       librcl_interfaces__rosidl_typesupport_cpp.so =>
/opt/ros/foxy/lib/librcl_interfaces__rosidl_typesupport_cpp.so
(0x00007f053bbae000)
       librmw_implementation.so => /opt/ros/foxy/lib/librmw_implementation.so
(0x00007f053bba2000)
       librmw.so => /opt/ros/foxy/lib/librmw.so (0x00007f053bb99000)
       libpthread.so.0 => /lib/x86_64-linux-gnu/libpthread.so.0
(0x00007f053bb76000)
       libm.so.6 => /lib/x86_64-linux-gnu/libm.so.6 (0x00007f053ba25000)
       libtf2.so => /opt/ros/foxy/lib/libtf2.so (0x00007f053b9fe000)
       librcl_interfaces__rosidl_typesupport_c.so =>
/opt/ros/foxy/lib/librcl_interfaces__rosidl_typesupport_c.so
(0x00007f053b9f3000)
       librcl_logging_spdlog.so => /opt/ros/foxy/lib/librcl_logging_spdlog.so
(0x00007f053b9eb000)
       librcl_interfaces__rosidl_generator_c.so =>
/opt/ros/foxy/lib/librcl_interfaces__rosidl_generator_c.so
(0x00007f053b9d9000)
       librosidl_runtime_c.so => /opt/ros/foxy/lib/librosidl_runtime_c.so
(0x00007f053b9ce000)
       libyaml.so => /opt/ros/foxy/lib/libyaml.so (0x00007f053b9ab000)
       librosidl_typesupport_c.so => /opt/ros/foxy/lib/librosidl_typesupport_c.so
(0x00007f053b9a4000)
       libspdlog.so.1 => /usr/lib/x86_64-linux-gnu/libspdlog.so.1
(0x00007f053b8fb000)
       libbuiltin_interfaces__rosidl_generator_c.so =>
/opt/ros/foxy/lib/libbuiltin_interfaces__rosidl_generator_c.so
(0x00007f053b8f4000)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.