Ask Your Question

ZazAa's profile - activity

2021-05-05 08:47:25 -0600 received badge  Student (source)
2019-12-10 22:29:25 -0600 received badge  Taxonomist
2019-11-13 00:58:42 -0600 received badge  Famous Question (source)
2019-08-29 09:34:17 -0600 received badge  Notable Question (source)
2019-08-29 09:34:17 -0600 received badge  Famous Question (source)
2019-07-19 12:37:59 -0600 received badge  Notable Question (source)
2019-06-19 20:57:09 -0600 received badge  Enthusiast
2019-06-18 02:06:14 -0600 received badge  Popular Question (source)
2019-06-17 17:47:34 -0600 commented question Why I got error "msg does not have header"?

ah my bad, thank you for pointing that out

2019-06-17 15:42:52 -0600 asked a question Why I got error "msg does not have header"?

Why I got error "msg does not have header"? Hi, I try to make a custom message with header to get the timestamp because

2019-06-17 12:37:01 -0600 answered a question Why my publisher node stops when subscriber node start?

The cause to my problem is that my publishing message doesn't have the same row of array as my subscriber's. Hence, the

2019-06-17 12:28:30 -0600 received badge  Famous Question (source)
2019-06-17 12:28:11 -0600 marked best answer How can we actually use Float32MultiArray to publish 2D array using Python?

Hi,

I am frustrated trying to understand the concept of Float32MultiArray. I have been reading the documentations from Float32MultiArray API , MultiArrayLayout and MultiArrayDimesion but I still don't get how to do it.

Code examples are mostly in C++ (which makes me more confuse that I already am) and many of them conclude to just make their own message file. Some suggest to slice and combine the two arrays into one array then publish it. In the subscriber, the array will be then slice and split up accordingly. My array is a 2*4096 so it is hard for me to do that really. Note that I am a amateur programmer. Please help addressing my question regarding this message type so that the future amateur like me could learn better. My specifications is ROS Indigo, Python 2.7.6 and Ubuntu 14.04. Yeah my tools are old.

My list of questions are as follows:

1) How do we publish and subscribe a Float32MultiArray (or any kind of MultiArray) in Python? What is the standard procedure or steps? From what I have read, I don't understand what is stride from MultiArrayDimesion ? Why do people use stride like this: What does this means mat.data[offset + i + dstride1*j] = num?

dstride0 = mat.layout.dim[0].stride
dstride1 = mat.layout.dim[1].stride
offset = mat.layout.data_offset
while not rospy.is_shutdown():
    tmpmat = np.zeros((3,3))
    for i in range(3):
        for j in range(3):
            num = random.randrange(0,10)
            mat.data[offset + i + dstride1*j] = num
            tmpmat[i,j] = num
    pub.publish(mat)
    rospy.loginfo("I'm sending:")
    print tmpmat,"\r\n"
    r.sleep()

2) Can Float32MultiArray publish 2 array at the same time? I found answer from 2010 post saying that ROS doesn't support 2D message publishing. Is ROS supporting it now in 2019?

3) If I were to make my own message, *can I declare 2 or more array in my message? *Would that message type works? Does ROS support that?

4) Is there any *detail guide or video on using this message type apart from API that has so little explanation ? *I really want to understand about this message type.

5) Any suggestion so that I could publish 2*4096 array of signal amplitude and time (nanosec) for signal processing in my subscriber?

I really hope any expert could address my questions. I think it is really related to ROS rather than my homework. The lack of documentation and examples in python really hinder me from understanding and overcoming this issue. Hope the answers to this question would benefit anyone who looking for the same answers.

Thank you in advance.

2019-06-17 12:28:11 -0600 received badge  Scholar (source)
2019-06-14 03:03:32 -0600 received badge  Popular Question (source)
2019-06-13 16:17:31 -0600 commented answer How can we actually use Float32MultiArray to publish 2D array using Python?

How do I say that this question is already answered?

2019-06-13 16:17:13 -0600 commented answer How can we actually use Float32MultiArray to publish 2D array using Python?

@PeteBlackerThe3rd @gvdhoorn thank you so much for detailed explanation for my questions. Everything is clearing up now

2019-06-13 16:16:21 -0600 commented answer How can we actually use Float32MultiArray to publish 2D array using Python?

@PeteBlackerThe3rd @gvdhoorn thank you so much for detailed explanation for my questions. Everything is clearing up now.

2019-06-12 18:12:50 -0600 received badge  Notable Question (source)
2019-06-12 15:30:37 -0600 asked a question How can we actually use Float32MultiArray to publish 2D array using Python?

How can we actually use Float32MultiArray to publish 2D array using Python? Hi, I am frustrated trying to understand t

2019-06-12 13:10:50 -0600 commented answer How to publish a 2 dimensional array of known values

What is stride for? From my reading, it is seems that parameter use when image is involved. What I'm not sending image m

2019-06-12 12:56:00 -0600 commented question Why my publisher node stops when subscriber node start?

Yeah that's the problem. I'm pretty weak in C++. I looking for a python alternative. While I have the chance, can I ask

2019-06-12 12:20:06 -0600 commented question Why my publisher node stops when subscriber node start?

Thank you for your reply. targets is a arrray with 2 rows * 4096 columns of data with raw signal amplitude and time (na

2019-06-12 11:05:29 -0600 received badge  Popular Question (source)
2019-06-12 02:27:51 -0600 commented question Why my publisher node stops when subscriber node start?

ground penetrating radar system

2019-06-11 23:51:32 -0600 commented question Why my publisher node stops when subscriber node start?

The publisher also stop when I use rostopic echo

2019-06-11 23:51:32 -0600 asked a question Why my publisher node stops when subscriber node start?

Why my publisher node stops when subscriber node start? Hi all, I currently working on creating a GPR system based on

2019-06-11 21:54:08 -0600 received badge  Supporter (source)