Control scene objects in VREP through ROS

Typically: "How do I... ", "How can I... " questions
cjndiaye
Posts: 6
Joined: 23 Mar 2017, 16:20

Re: Control scene objects in VREP through ROS

Post by cjndiaye » 23 Aug 2017, 08:37

Hello, yes the object is initially dynamic. I just want to change it in three different positions before it join the box chosen for it.
But in its last position, if I use simSetObjectPosition, the object does not change its position.

Thanks

coppelia
Site Admin
Posts: 7396
Joined: 14 Dec 2012, 00:25

Re: Control scene objects in VREP through ROS

Post by coppelia » 25 Aug 2017, 14:11

Sorry, your question is too specific to your scene. There are many things that could go wrong. Best is to prepare a very simply scene that illustrates the problem, and post it here.

Cheers

slgrajeshwar36172
Posts: 4
Joined: 06 Nov 2019, 04:34
Location: iit patna
Contact:

sim.setJointPosition is not working.can you please help me

Post by slgrajeshwar36172 » 09 Nov 2019, 11:13

Code: Select all

function sysCall_init()
        
    -- Get some handles:
    joint=sim.getObjectHandle('Joint')
   
    
    
    -- Enable an image publisher and subscriber:
    sub=simROS.subscribe('/joint_topic', 'std_msgs/Float64', 'joint_callback')
    simROS.subscriberTreatUInt8ArrayAsString(sub) -- treat uint8 arrays as strings (much faster, tables/arrays are kind of slow in Lua)
   
end

function joint_callback(msg)
    -- Apply the received image to the passive vision sensor that acts as an image container
    print(msg.data)
    --sim.setJointTargetVelocity(joint,msg.data)

    [b]sim.setJointPosition(joint,(math.pi/180) *msg.data)[/b]

end

function sysCall_cleanup()
    simROS.shutdownSubscriber(sub)
end

coppelia
Site Admin
Posts: 7396
Joined: 14 Dec 2012, 00:25

Re: Control scene objects in VREP through ROS

Post by coppelia » 11 Nov 2019, 07:12

What do you want to achieve by just positing code without any question/comment?

Post Reply