我是ros+python的新手,我正试图从pythonros节点发布一个一维数组。我用的是Int32MultiArray,但我不懂multiarray中布局的概念。有人能给我解释一下吗?或者有其他发布数组的方法吗?
谢谢。#!/usr/bin/env python
import roslib
roslib.load_manifest('test_drone')
import numpy
import rospy
import sys
import serial
from std_msgs.msg import String,Int32,Int32MultiArray,MultiArrayLayout,MultiArrayDimension
from rospy.numpy_msg import numpy_msg
from rospy_tutorials.msg import Floats
#port = "dev/ttyS0"
#baud = 115200
#ser = serial.Serial()
#ser.port = port
#ser.baudrate = baud
################################################################################################
def main(args):
pub=rospy.Publisher('sonar_vals',Int32MultiArray,queue_size = 10)
rospy.init_node('ca_serial'