exchangenax.blogg.se

Occupancy grid mapping with ultrasonic range finder
Occupancy grid mapping with ultrasonic range finder








occupancy grid mapping with ultrasonic range finder

The solution to this was to have the Arduino buffer it's response after receiving a request from the RPi. This turned out to be entirely untrue as I2C is only a half-duplex protocol, thou I had been trying to treat it like a full-duplex protocol. I had initially assumed that I2C would allow me to write data to the Arduino, and then have the Arduino immediately write data directly back to the RPi. Specifically getting data to be sent from the Arduino to the RPi took longer than expected partially due to using wiringPII2C and partially due to a lack of familiarity with the I2C protocol. Setting up communications between the RPi3 and the Arduino was surprising one of the most difficult components of the project.

occupancy grid mapping with ultrasonic range finder

The time stamp is currently used only for debugging purposes, but was intended to allow for communication latency to be corrected for by the host computer. The response packet consists of the number of seconds that the web socket has been opened, followed by the requested data. Once the RPi3 has received a command it then performs the desired action and returns a response packet to the Host computer. For example "GRM" would be used to tell the RPi3 to return the current sonar measurements while "SWV 1.1 1.1" is used to tell the RPi3 to set both wheels to have a ground speed of 1.1 m/s. However, as transmission speeds were sufficiently fast, this was not pursued.Įssentially, the protocol works by sending the RPi3 a 3 letter command followed by any additional information required by the request. The 1026 buffer size is significantly larger than required and faster data rates could be achieved by reducing the packet or by allowing for arbitrary packet lengths. Instead, each packet consists of a 1026 char array containing the data to be sent in plain text, with separate packet formats used for sending and receiving data. This protocol was ultimately dropped for being difficult to debug and for it's general complexity. The initial protocol attempted to typecast the data to be sent into a char array and then unpacked at the other end.

occupancy grid mapping with ultrasonic range finder occupancy grid mapping with ultrasonic range finder

A communications protocol was implemented on top of the web socket connection for sending commands and receiving data. Communication via the Host computer and RPi3 is done using a TCP/IP web socket implemented in C on the RPi side and MATLAB on the Host computer side.










Occupancy grid mapping with ultrasonic range finder