## 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

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
Posts: 7396
Joined: 14 Dec 2012, 00:25

### Re: Control scene objects in VREP through ROS

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:

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