ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question

How can i order axes[] in Joy message ?

asked 2015-06-14 03:26:49 -0500

Thanabadee gravatar image

Question is how can i order axes of this msg.

if i write this code.

self.remoteMsg.header.stamp =
            self.remoteMsg.buttons = {d[0],d[1],d[2],d[3],d[4],d[5]}
            print 'r1:', str(d[0])[:4] ,'r2:' , str(d[1])[:4] ,'r3:' , str(d[2])[:4] ,'r4:' , str(d[3])[:4] ,'r5:' , str(d[4])[:4] ,'r6:' , str(d[5])[:4]

It seem to correct order when it print out screen , but not when it on topic. Sorry for my bad english skill. Thank you advanced. :D

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted

answered 2015-06-14 10:57:07 -0500

ahendrix gravatar image

It looks like you're assigning a map into a message that should actually be an array.


self.remoteMsg.buttons = d[0:6]
edit flag offensive delete link more


Oh .. it work. Thx u very much :D

Thanabadee gravatar image Thanabadee  ( 2015-06-15 04:43:06 -0500 )edit

Question Tools

1 follower


Asked: 2015-06-14 03:23:30 -0500

Seen: 381 times

Last updated: Jun 15 '15