Hello,
I am having some issues to pass a variable value from ROS.
First I created a topic with which I communicate, but I don't know how provocate a change in the variable.
The receipt of the variable have to be programmed in Vrep or in ROS?
Thanks!
Change a value from ros in vrep
Re: Change a value from ros in vrep
Have a look at how a ROS publisher and subscriber are handled in V-REP, by looking at the demo scene scenes/rosInterfaceTopicPublisherAndSubscriber.ttt.
Simple subscriber example:
on the other end you have another ROS node publishing a message of type std_msgs/Float32 on the topic /mytopic
Simple subscriber example:
Code: Select all
function cb(msg)
sim.addStatusBarMessage('Received data: '..msg.data)
end
-- in sysCall_init / sim_childscriptcall_initialization:
sub = simROS.subscribe('/mytopic', 'std_msgs/Float32', 'cb')