Error while trying to publish Pose message

Typically: "How do I... ", "How can I... " questions
Post Reply
MoutaENSTA
Posts: 5
Joined: 07 Jul 2020, 13:40

Error while trying to publish Pose message

Post by MoutaENSTA »

Hello everyone,
I was trying to manipulate my robot with ROS2 and while the tutorial script works fine and does publish the "SimulationTime", when i try to publish the robots position i get the following error :

Code: Select all

19: Unsupported message type 'geometry_msgs/Pose'. You may want to add it to meta/interfaces.txt and recompile the ROS2Interface plugin. (in function 'simROS2.createPublisher@simExtROS2Interface')
    stack traceback:
        [C]: in function 'createPublisher'
        [string "Body@childScript"]:19: in function <[string "Body@childScript"]:12>
My code is the following :

Code: Select all

function sysCall_init()
    objectHandle=sim.getObjectAssociatedWithScript(sim.handle_self)
    objectName=sim.getObjectName(objectHandle)
    
    if simROS2 then
        publisher=simROS2.createPublisher('/pos_rob','geometry_msgs/Pose')
    end

function sysCall_actuation()
    if simROS2 then
        objPos = sim.getObjectPosition(objHandle,-1)
        simROS2.publish(publisher,simxGetObjectPose(objectHandle,-1))
    end
end
Thank you for your help.

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

Re: Error while trying to publish Pose message

Post by fferri »

In ROS2 the interface name would be geometry_msgs/msg/Pose

MoutaENSTA
Posts: 5
Joined: 07 Jul 2020, 13:40

Re: Error while trying to publish Pose message

Post by MoutaENSTA »

fferri wrote: 08 Sep 2020, 14:57 In ROS2 the interface name would be geometry_msgs/msg/Pose
Thank you for your reply.
I've tried to write this message type but the error still persists. I was wondering if i need to create my own message type or add the geometry_msgs package but i have no idea how to do that.

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

Re: Error while trying to publish Pose message

Post by fferri »

The plugin already depends on geometry_msgs package.

I don't know what's going on on your machine. Try starting from scratch on a clean workspace.

Post Reply