Problem with Ros custom msg

Report crashes, strange behaviour, or apparent bugs
Post Reply
Mildred34
Posts: 19
Joined: 12 May 2023, 16:03

Problem with Ros custom msg

Post 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.

Valenorf
Posts: 21
Joined: 10 May 2017, 21:35

Re: Problem with Ros custom msg

Post 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.

fferri
Posts: 1193
Joined: 09 Sep 2013, 19:28

Re: Problem with Ros custom msg

Post by fferri »

Please post complete code.

Valenorf
Posts: 21
Joined: 10 May 2017, 21:35

Re: Problem with Ros custom msg

Post by Valenorf »

In my case, you can find it here:

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

The scene I'm using is dynamics.ttt

fferri
Posts: 1193
Joined: 09 Sep 2013, 19:28

Re: Problem with Ros custom msg

Post 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

Valenorf
Posts: 21
Joined: 10 May 2017, 21:35

Re: Problem with Ros custom msg

Post 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.

Post Reply