picardi...@studenti.uniroma1.it
unread,Feb 5, 2013, 12:27:07 PM2/5/13Sign in to reply to author
Sign in to forward
You do not have permission to delete messages in this group
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to rosbrid...@googlegroups.com
Hi I have the following operation of subscribe:
var rosmessage1 = {op: 'subscribe', topic: '/odom', type: 'nav_msgs/Odometry'}
rossocket.send(JSON.stringify(rosmessage1))
rossocket.onmessage = function(msg1) {console.log(msg1.data)}
that write in the console a message of type:
{"topic": "/odom", "msg": {"twist": {"twist": {"linear": {"y": 0.0, "x": 0.0, "z": 0.0}, "angular": {"y": 0.0, "x": 0.0, "z": 0.0}}, "covariance": [0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0]}, "header": {"stamp": {"secs": 7151, "nsecs": 300000000}, "frame_id": "odom", "seq": 71512}, "pose": {"pose": {"position": {"y": -5.4224745353603776e-15, "x": 1.900000000000032, "z": 0.0}, "orientation": {"y": 0.0, "x": 0.0, "z": 0.0, "w": 1.0}}, "covariance": [0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0]}, "child_frame_id": ""}, "op": "publish"}
from this i have to find the information of y and x positons. I tried with msg.data.msg.pose.pose.position.x but the console says me that msg.data.msg is undefined. Does knwown anyone what i have to do?
Thank you.
Chiara