how to get x,y coordinates of hedge on the serial port of arduino?

Frequent questions asked online, offline, in forums are answered here
Briser
Posts: 7
Joined: Thu Jul 11, 2019 12:45 pm

Re: how to get x,y coordinates of hedge on the serial port of arduino?

Postby Briser » Thu Jul 11, 2019 12:49 pm

Hello
How can I get two coordinates from two hedgehogs at the same time and send them to the arduino?

User avatar
admin
Site Admin
Posts: 294
Joined: Tue Jan 26, 2016 7:06 pm
Contact:

Re: how to get x,y coordinates of hedge on the serial port of arduino?

Postby admin » Thu Jul 11, 2019 8:07 pm

Briser wrote:Hello
How can I get two coordinates from two hedgehogs at the same time and send them to the arduino?


It depends on which architecture you are in: IA or NIA.
- In IA, all mobile beacons measure location at the same time
- In NIA, all mobile beacons measure position one by one

However, you have a timestamp coming with each location update. So, by have timestamps linked with location updates, you can always adjust match or interpolate positions and time.

Briser
Posts: 7
Joined: Thu Jul 11, 2019 12:45 pm

Re: how to get x,y coordinates of hedge on the serial port of arduino?

Postby Briser » Fri Jul 12, 2019 4:17 am

When I want to obtain coordinate and send it to the arduino, I could only pin the RX0, When I change the pin to RX1,I can't get anything.

Briser
Posts: 7
Joined: Thu Jul 11, 2019 12:45 pm

Re: how to get x,y coordinates of hedge on the serial port of arduino?

Postby Briser » Fri Jul 12, 2019 11:32 am

Hello!
When I connect a hedgehog to arduino(I want to obtain its coordinate), and I wake up two hedgehogs. But I obtain the two hedgehogs coordinates mixed together from the Serial monitor. So what's the problem? How can I separate them?

smoker77
Posts: 228
Joined: Sat Feb 06, 2016 4:03 pm

Re: how to get x,y coordinates of hedge on the serial port of arduino?

Postby smoker77 » Sat Jul 13, 2019 3:38 pm

Hello.
This is not a problem but a feature.
Locations of all hedgehogs are available from any hedgehog or from modem.
You can separate them by address of hedgehog transmitted in offset 22 of the data packet.
Please see section 1.1.2 of the protocol:
https://marvelmind.com/pics/marvelmind_ ... rfaces.pdf
Also you can use bit 6 in "byte of flags" (offset 21) to differ connected hedgehog from all other hedgehogs.

Briser
Posts: 7
Joined: Thu Jul 11, 2019 12:45 pm

Re: how to get x,y coordinates of hedge on the serial port of arduino?

Postby Briser » Sun Jul 14, 2019 4:03 am

smoker77 wrote:Hello.
This is not a problem but a feature.
Locations of all hedgehogs are available from any hedgehog or from modem.
You can separate them by address of hedgehog transmitted in offset 22 of the data packet.
Please see section 1.1.2 of the protocol:
https://marvelmind.com/pics/marvelmind_ ... rfaces.pdf
Also you can use bit 6 in "byte of flags" (offset 21) to differ connected hedgehog from all other hedgehogs.

Hello, this is my code, I don't know how to put your method into practice.
I start a software(10) and use a hardware(RX0) in order to read coordinates of two hedgehogs separately.
Thank you very much!
Attachments
software10_RX.rar
(1.58 KiB) Downloaded 9 times

smoker77
Posts: 228
Joined: Sat Feb 06, 2016 4:03 pm

Re: how to get x,y coordinates of hedge on the serial port of arduino?

Postby smoker77 » Tue Jul 16, 2019 12:20 am

Hello,
I attach two modifications of your code.

1. software11_RX simply filters data from each hedgehog to get only its location and skip location of another hedgehog.
So hedgehog1_x1, hedgehog1_y1 will always receive data from only first hedgehog and hedgehog2_x2, hedgehog2_y2 only from second one.

2. software11a_RX provides same result by another way. For this software you don't need to connect second hedgehog to UART. Locations of both hedgehogs are received from one hedhehog. But you need to specify proper addresses of both hedgehogs in the software in constants HEDGEHOG1_ADDRESS, HEDGEHOG2_ADDRESS. These constants are used to separate locations of different hedgehogs.

These modifications are not tested, but I think they should work.
Attachments
software11a_RX.zip
(1.84 KiB) Downloaded 3 times
software11_RX.zip
(1.74 KiB) Downloaded 4 times

Briser
Posts: 7
Joined: Thu Jul 11, 2019 12:45 pm

Re: how to get x,y coordinates of hedge on the serial port of arduino?

Postby Briser » Fri Jul 19, 2019 3:19 pm

Thanks for your help very much.I have solved this problem.
But when I use the coordinates to control my robot,I find that the coordinate is not stable, it always drift. So how can I improve coordinate stability?

smoker77
Posts: 228
Joined: Sat Feb 06, 2016 4:03 pm

Re: how to get x,y coordinates of hedge on the serial port of arduino?

Postby smoker77 » Sat Jul 27, 2019 6:39 pm

Hello,
Please check the ultrasonic coverage.
Does your mobile beacon on line of sight with stationary beacons?
Please refer to operating manual, especially sections 10.4, 10.5 10.6:
https://marvelmind.com/pics/marvelmind_ ... manual.pdf
Check ultrasonic signals as shown in section 10.5

Briser
Posts: 7
Joined: Thu Jul 11, 2019 12:45 pm

Re: how to get x,y coordinates of hedge on the serial port of arduino?

Postby Briser » Sun Jul 28, 2019 6:11 am

smoker77 wrote:Hello,
Please check the ultrasonic coverage.
Does your mobile beacon on line of sight with stationary beacons?
Please refer to operating manual, especially sections 10.4, 10.5 10.6:
https://marvelmind.com/pics/marvelmind_ ... manual.pdf
Check ultrasonic signals as shown in section 10.5

Thanks for your help, but the manual is too simplified. I don't know how to set the ultrasonic threshold on the Dashboard.
I found that the acquisition of coordinates was delayed, which made my robot mobility had some problems. So how can I eliminate the time delay.


Return to “FAQ”

Who is online

Users browsing this forum: No registered users and 3 guests