Ask Your Question
0

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. http://docs.ros.org/indigo/api/sensor...

if i write this code.

self.remoteMsg.header.stamp = rospy.Time.now()-self.time_start
            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
1

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.

Try:

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

Comments

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

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

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

1 follower

Stats

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

Seen: 303 times

Last updated: Jun 15 '15