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

Revision history [back]

click to hide/show revision 1
initial version
def joyread(data):
foo[0] = 4*data.axes[1]

You are obviously missing the declaration. foo should be a Float32MultiArray, but then you'd rather have to write in foo.data.

def joyread(data): foo[0] = 4*data.axes[1]

4*data.axes[1]

You are obviously missing the declaration. foo should be a Float32MultiArray, but then you'd rather have to write in foo.data. foo.data.

def joyread(data): foo[0] = 4*data.axes[1]

You are missing the declaration. foo should be a Float32MultiArray, but then you'd rather have to write in foo.data.

Something closer to this should work: (I'm not quite sure how the foo.layout has to be initialized)

def joyread(data): 
  foo = Float32MultiArray()
  foo.data.append(4*data.axes[1])
  (...)

def joyread(data): foo[0] = 4*data.axes[1]

You are missing the declaration. foo should be a Float32MultiArray, but then you'd rather have to write in foo.data.

Something closer to this should work: (I'm not quite sure how the foo.layout has to be initialized)

def joyread(data): 
  foo = Float32MultiArray()
  foo.data.append(4*data.axes[1])
  (...)

def joyread(data): foo[0] = 4*data.axes[1]

You are missing the declaration. foo should be a Float32MultiArray, but then you'd rather have to write in foo.data.

Something closer to this should work: (I'm not quite sure how the foo.layout has to be initialized)

def joyread(data): 
  foo = Float32MultiArray()
  foo.data.append(4*data.axes[1])
  (...)