ROS Publisher

Report crashes, strange behaviour, or apparent bugs
Post Reply
hakim
Posts: 14
Joined: 14 Sep 2015, 23:29

ROS Publisher

Post by hakim »

Hi.
I have a little problem with my simulator:
Lua API call error: [string "SCRIPT Quadricopter"]:83: Topic could not be published. (simExtROS_enablePublisher)
and the Lua script is as follows:

Code: Select all

frontCam=simGetObjectHandle('Quadricopter_frontCamera') topicName=simExtROS_enablePublisher('front_cam',1,simros_strmcmd_get_vision_sensor_image,f,-1,'')
and I have another publisher in the same Lua script and it is working just fine

Code: Select all

d=simGetObjectHandle('Quadricopter_base')
 topicName1=simExtROS_enablePublisher('drone_pose',1,simros_strmcmd_get_object_pose,d,-1,'')
and another problem with the ros subscriber

Code: Select all

Lua API call error: [string "SCRIPT Quadricopter"]:159: One of the function's argument type is not correct. (simSetObjectOrientation)
I've created a subscriber in the lua script as follows:

Code: Select all

subscriberID=simExtROS_enableSubscriber('cmd_deplace',1,simros_strmcmd_set_object_pose,d,1,'')
and in order to use the parameters published by my ros node:

Code: Select all

if (subscriberID == -1)then
			simSetObjectPosition(targetObj,sim_handle_parent,{0,0,0})
			simSetObjectOrientation(targetObj,sim_handle_parent,{0,0,0})
        else
			simSetObjectPosition(targetObj,sim_handle_parent,{'cmd_deplace.pose.position.x','cmd_deplace.pose.position.y','cmd_deplace.pose.position.z'})
			simSetObjectOrientation(targetObj,sim_handle_parent,{'cmd_deplace.pose.orientation.x','cmd_deplace.pose.orientation.y','cmd_deplace.pose.orientation.z'})
		end
	end
Any help is welcomed
THX

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

Re: ROS Publisher

Post by coppelia »

Please do not double-post. See your other question answered here.

Cheers

Post Reply