Hello i was trying to read joint angles using ros
First i created a topic in syscall init in a non-threaded child script after playing a bit with controlled with ros scene example
if simROS then
print("<font color='#0F0'>ROS interface was found.</font>@html")
ab1SensorTopicHandler=simROS.advertise('/'..'bc1sensortopic','std_msgs/Float32')
end
then tried to publish on this topic using the following code
function sysCall_sensing()
a = {}
rrhip=sim.getObjectHandle("bc1")
value=sim.getJointPosition(rrhip)
a[1]=value
print(a[1])
print(ab1SensorTopicHandler)
simROS.publish(ab1SensorTopicHandler,value)
end
and i got the following error saying float 32 expected a table
shadowzone wrote: ↑23 Feb 2020, 14:36
Hello i was trying to read joint angles using ros
First i created a topic in syscall init in a non-threaded child script after playing a bit with controlled with ros scene example
if simROS then
print("<font color='#0F0'>ROS interface was found.</font>@html")
ab1SensorTopicHandler=simROS.advertise('/'..'bc1sensortopic','std_msgs/Float32')
end
then tried to publish on this topic using the following code
function sysCall_sensing()
a = {}
rrhip=sim.getObjectHandle("bc1")
value=sim.getJointPosition(rrhip)
a[1]=value
print(a[1])
print(ab1SensorTopicHandler)
simROS.publish(ab1SensorTopicHandler,value)
end
and i got the following error saying float 32 expected a table
function sysCall_sensing()
rrhip=sim.getObjectHandle("bc1")
value=sim.getJointPosition(rrhip)
local msg={}
msg.data=value
simROS.publish(ab1SensorTopicHandler,msg)
end
shadowzone wrote: ↑23 Feb 2020, 14:36
Hello i was trying to read joint angles using ros
First i created a topic in syscall init in a non-threaded child script after playing a bit with controlled with ros scene example
if simROS then
print("<font color='#0F0'>ROS interface was found.</font>@html")
ab1SensorTopicHandler=simROS.advertise('/'..'bc1sensortopic','std_msgs/Float32')
end
then tried to publish on this topic using the following code
function sysCall_sensing()
a = {}
rrhip=sim.getObjectHandle("bc1")
value=sim.getJointPosition(rrhip)
a[1]=value
print(a[1])
print(ab1SensorTopicHandler)
simROS.publish(ab1SensorTopicHandler,value)
end
and i got the following error saying float 32 expected a table
function sysCall_sensing()
rrhip=sim.getObjectHandle("bc1")
value=sim.getJointPosition(rrhip)
local msg={}
msg.data=value
simROS.publish(ab1SensorTopicHandler,msg)
end