Hello,

So I looked at the solution to the miniproject for unit 4 and I understand the code. However, I am confused about how they knew to go to msg.ranges[360] or msg.ranges[719]. Where do the values 360 or 719 come from and how did you figure out those values?

Thank you

asked 26 Sep, 17:03

sicalabneu's gravatar image

sicalabneu
0
accept rate: 0%


Hi!

You can see that the ranges has the size of 720.

You can see that with: print len(msg.ranges)

Since there are 720, it goes from 0 to 719, with the middle point of the array being the index 360.

If it's still not clear, just let us know.

permanent link

answered 26 Sep, 21:13

ralves%40theconstructsim.com's gravatar image

ralves@theco... ♦♦
453
accept rate: 53%

So would you just run that in the python script or is there any way you can find that out with the command line?

(27 Sep, 17:40) sicalabneu

Using rostopic echo /topic_name you should be able to see as well, but it would be a bit trick to count the ranges that way. In python would be easier just with the code mentioned in the answer.

(27 Sep, 18:22) ralves@theco... ♦♦

The closes one you can get using only the shell is the command below, but the value is 721: rostopic echo /kobuki/laser/scan -n1| grep ranges | wc --words

(27 Sep, 19:07) ralves@theco... ♦♦

Hello,

where I can see the solution to this MiniProject of unit 4?

permanent link

answered 17 Nov, 14:47

tiagaspe%40teleco.upv.es's gravatar image

tiagaspe@tel...
0
accept rate: 0%

Your answer
toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Question tags:

×1
×1
×1

question asked: 26 Sep, 17:03

question was seen: 238 times

last updated: 17 Nov, 14:47

Related questions

powered by OSQA