-
Notifications
You must be signed in to change notification settings - Fork 414
Open
Description
Hi,
I have two ROS (.msg) files, (Point_Array.msg) and (Point.msg).
Point_Array message:
parray = []
Point message
float32 x
float32 y
float32 z
I want to populate the Point_Array message with the Point_message, the Point_Array needs to hold 10 points.
How do I build the message in my js file.
My current function looks like this:
this.Path = new ROSLIB Topic({
ros : this.ros,
name : '/Path'
messageType : 'my_msgs/Point_Array'
});
var final_points = new ROSLIB.Message({
parray : {
Point : {
}
}
})
var tempArray = []
for (var i = 1; i < this.my_data.length-1; i++){
var points = new ROSLIB.Message({
Point : {
x : parseFloat(my_data[i].X)
y : parseFloat(my_data[i].Y)
z : parseFloat(my_data[i].Z)
}
})
tempArray.push(points)
}
final_points = new ROSLIB.Message(tempArray)
this.Path.publish(this.final_points)Can anyone help with this at all?
Metadata
Metadata
Assignees
Labels
No labels