Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use of Malloc #3

Open
mjs513 opened this issue Apr 10, 2015 · 2 comments
Open

Use of Malloc #3

mjs513 opened this issue Apr 10, 2015 · 2 comments

Comments

@mjs513
Copy link

mjs513 commented Apr 10, 2015

Hi Carlos

Thanks for your work. Easiest to understand implementation of VFH that I have seen. Now to the question. Prior to your changes I had this almost working on a Teensy 3.1 or Due board. Ran into a couple of issues one of which was I was not sure what the output was suppose to look like and second is there a way of not using malloc in the implementation. I am not a C programmer, learning by trial and error here. So I would appreciate any help you could avoid to give me here with an example output and what I could do with malloc.

thanks
Mike

PS. Can't wait to see what you do with VFH+ and VFH*

@agarie
Copy link
Owner

agarie commented Apr 15, 2015

Hey @mjs513, thanks for posting this issue (and for the 'easiest to understand implementation' part!) and I'm sorry for the late response. I'm a bit overwhelmed at work right now.

What problems are you having right now? How are you trying to compile the code? :)

@mjs513
Copy link
Author

mjs513 commented Apr 19, 2015

Hi Carlos
Sorry for the delay in responding but things are pretty busy around here as well. Anyway back to problem at hand. I did a little more experimenting and think the issue that there is just not enough memory on the Arduino Mega. I ran several cases and it would always return 90 deg or just hang. I then loaded it on a Arduino Due and it ran ok but am getting some strange results:

setting up grid
Finished setting up grid
Measures
0, 2, 187
1, 28, 180
2, 78, 21
3, 35, 187
4, 126, 10
5, 92, 266
6, 32, 345
7, 3, 313
8, 106, 18
9, 19, 72
10, 26, 255
11, 59, 133
12, 71, 187
13, 107, 331
14, 61, 320
15, 45, 262
16, 85, 54
17, 2, 284
18, 74, 162
19, 35, 0
20, 114, 345
21, 91, 100
22, 0, 3
23, 71, 244
24, 46, 309
25, 53, 201
26, 50, 64
27, 87, 104
28, 113, 61
29, 105, 3
30, 70, 18
31, 23, 39
32, 20, 241
33, 33, 273
34, 35, 82
35, 50, 219
36, 102, 277
37, 96, 111
38, 63, 201
39, 106, 320
40, 107, 248
41, 31, 219
42, 98, 320
43, 79, 270
44, 20, 187
45, 71, 205
46, 91, 72
47, 79, 18
48, 36, 309
49, 15, 172

Position of the robot: (%d, %d)
26, 26

Updating the certainty grid...

---------------------------------------------------ddddd
---------------------------------------------------ddddd
---------------------------------------------------ddddd
---------------------------------------------------ddddd
---------------------------------------------------ddddd
---------------------------------------------------ddddd
---------------------------------------------------ddddd
---------------------------------------------------ddddd
---------------------------------------------------ddddd
---------------------------------------------------ddddd
---------------------------------------------------ddddd
---------------------------------------------------ddddd
---------------------------------------------------ddddd
---------------------------------------------------ddddd
---------------------x-----------------------------ddddd
----------------------x-x-x-x----------------------ddddd
--------------------xo--------xx-------------------ddddd
-------------------xx-x--------x--x----------------ddddd
-------------------x------x-x---x------------------ddddd
-----------------x-xx--x-xxxxx--x------------------ddddd
---------------xxx-xxxxxx--xox------x--------------ddddd
-------------------xx-xoxxo-x--x---x---------------ddddd
-------------------x--xxxxxx-o-x-xxx---------------ddddd
---------------x--x--xxooxoo--x-xx---x-------------ddddd
---------------------xxooooooxx--x---x-------------ddddd
---------------xxx--xxxoooooox--x------------------ddddd
------------------xx--xxooooooo-x-x----------------ddddd
---------------x----x-xxooooox---------------------ddddd
--------------x----x-x-ooxoxooo-x-x----------------ddddd
---------------x-x--o-oxx-oxx--xxx---x-------------ddddd
-------------------xx--x--x-o-xxxx-----------------ddddd
----------------x----xx-x-x---x-x-xx---------------ddddd
---------------x--x---ox--x-o----x-----------------ddddd
-------------------x---xx-------x--x---------------ddddd
---------------------x-x-------xx------------------ddddd
--------------------x--x---x--x--------------------ddddd
--------------------x------x-x---------------------ddddd
----------------------xx------x--------------------ddddd
---------------------------------------------------ddddd
---------------------------------------------------ddddd
---------------------------------------------------ddddd
---------------------------------------------------ddddd
---------------------------------------------------ddddd
---------------------------------------------------ddddd
---------------------------------------------------ddddd
---------------------------------------------------ddddd
---------------------------------------------------ddddd
---------------------------------------------------ddddd
---------------------------------------------------ddddd
-oo-oo--ooo----------------------------------------ddddd
---------------------------------------------------ddddd

Updating the polar histogram...

Next direction: %d [degrees]
165799
0

You don't by any chance have a routine that you print out the histograms do you? Any suggestions?

Thanks
Mike

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants