Page 1 of 1

Problem with Ros custom msg

Posted: 06 Jun 2023, 17:17
by Mildred34
Hello,

I add geometry_msgs/msg/Pose and geometry_msgs/msg/Point to interfaces.txt then I recompile the ros2 plugin.

On my ubuntu Computer when I do:

Code: Select all

    Pose={}
    pos={}
    pos.x=objPos[1]
    pos.y=objPos[2]
    pos.z=objPos[3]
    
    ori={}
    ori.x=objOri[1]
    ori.y=objOri[2]
    ori.z=objOri[3]
    ori.w=objOri[4]
    
    Pose.orientation=ori
    Pose.position=pos
        
    if simROS2 then
        simROS2.publish(publisher,ori)
    end
I received the following error:

Code: Select all

in simROS2.publish@simExtROS2: read in arg 1 (publisherHandle): expected string
stack traceback:
    [C]: in function 'simROS2-typecheck.publish'
    [string "/IRB140[1]/robotiq2@childScript"]:80: in function 'sysCall_sensing'
But on WSL2, it's working with the same setup. It's working.
I'm working with export LIBGL_ALWAYS_SOFTWARE=1 since it looks like CoppeliaSim doesn't like my Nvidia graphic card.

It's the same on WSL2 though.

Re: Problem with Ros custom msg

Posted: 06 Jun 2023, 20:43
by Valenorf
On the same line, i obtain:
in simROS2.createPublisher@simExtROS2: Unsupported message type 'sensor_msgs/msg/LaserScan'. You may want to add it to meta/interfaces.txt and recompile the ROS2Interface plugin.
Of course, I added the above messages to the interface.txt file. Everything was fine with the old repo simExtROS2 (now renamed simROS2) and Coppelia 4.4.

Re: Problem with Ros custom msg

Posted: 07 Jun 2023, 09:46
by fferri
Please post complete code.

Re: Problem with Ros custom msg

Posted: 07 Jun 2023, 10:59
by Valenorf
In my case, you can find it here:

https://github.com/giulioturrisi/Differ ... simulation

The scene I'm using is dynamics.ttt

Re: Problem with Ros custom msg

Posted: 07 Jun 2023, 14:56
by fferri
Not sure where to look at since your scene doesn't contain the code you initially posted.
And you can't get two different errors in the same script.
Try to focus only on one problem at once

Re: Problem with Ros custom msg

Posted: 07 Jun 2023, 15:56
by Valenorf
Sorry, i'm not the original author of the post, and I thought that this error was related to the one that I obtain due to simROS2. I will create an additional post.