Hello I am subscribing to a topic, where another node publishes Float32MultiArrays to it. This multiarray has information about objects I detect through a camera, this means that the first number in the matrix is a ID of the object and the other properties are: position, rotation, scale and shear. I am only interested in the ID and therefore I only want to check this number. I have just taken the most important things out of the code. Due to the fact that I can't find that much documentation on Float32MultiArray, I want to hear if any of you know the syntax for it.
import rospy
from std_msgs.msg import Float32MultiArray
def callback(data):
rospy.loginfo(data.data[1][1])
class GoForward():
def __init__(self):
# initiliaze
rospy.init_node('GoForward', anonymous=False)
rospy.Subscriber("objects", Float32MultiArray, callback)
if __name__ == '__main__':
try:
GoForward()
except:
rospy.loginfo("GoForward node terminated.")