- #SLAMTEC ROBOTSTUDIO SAVE DATA SERIAL#
- #SLAMTEC ROBOTSTUDIO SAVE DATA FULL#
- #SLAMTEC ROBOTSTUDIO SAVE DATA CODE#
- #SLAMTEC ROBOTSTUDIO SAVE DATA PC#
\n ") ĬhkSum = (pRPLIDAR-> esdata_prev esdata_prev & 0x0F) Printf( "A RPLIDAR is not responding correctly : Bad sync1 or sync2. sync = (pRPLIDAR-> esdata_prev & 0xF0)|(pRPLIDAR-> esdata_prev> 4) Failure printf( "A RPLIDAR is not responding correctly. If ( ReadAllRS232Port(&pRPLIDAR-> RS232Port, pRPLIDAR-> esdata_prev, sizeof(pRPLIDAR-> esdata_prev)) != EXIT_SUCCESS) memset(pRPLIDAR-> esdata_prev, 0, sizeof(pRPLIDAR-> esdata_prev)) Receive the first data response (2 data responses needed for angles computation.). Failure - After waiting for an input buffer, it wasn't there printf( " : Failed to detect response on the input FIFO buffer. Not enough, wait a little mSleep(checkingperiod)
#SLAMTEC ROBOTSTUDIO SAVE DATA FULL#
Check if there is enough to get a full payload read if (count >= sizeof(pRPLIDAR-> esdata_prev)) Success - Something is there // If anything is on the input buffer, wait until there is enough Wait for something to show up on the input buffer on port if (! WaitForRS232Port(&pRPLIDAR-> RS232Port, timeout, checkingperiod)) RS232PORT* pRS232Port = &pRPLIDAR-> RS232Port
#SLAMTEC ROBOTSTUDIO SAVE DATA SERIAL#
Check it every 5 ms // Note on Checking Period Value: // Waiting on 82 bytes in lidar payload // 10 bits per byte for the serial communication // 820 bits / 256000 baud = 0.0032s = 3.2ms int checkingperiod = 5 Keep anticipating a port read buffer for 1 second int timeout = 1500 if ((descbuf != 0x54) || (descbuf != 0x40) || (descbuf != MEASUREMENT_CAPSULED_RESPONSE_RPLIDAR)) Quick check of the response descriptor. Printf( "A RPLIDAR is not responding correctly. memset(descbuf, 0, sizeof(descbuf)) // Alocate memory if ( ReadAllRS232Port(&pRPLIDAR-> RS232Port, descbuf, sizeof(descbuf)) != EXIT_SUCCESS) Printf( "Error writing data to a RPLIDAR. Send request to output/tx OS FIFO buffer for port if ( WriteAllRS232Port(&pRPLIDAR-> RS232Port, reqbuf, sizeof(reqbuf)) != EXIT_SUCCESS) Inline int StartExpressScanRequestRPLIDAR(RPLIDAR* pRPLIDAR) Where as a successfully connection response from the LIDAR much longer in content Could you confirm that everything works with 3 devices?.If you have USB hubs with external power supply, it might be worth to try to connect the RPLIDAR through them to the computer, it case there is some kind of power supply issue.
#SLAMTEC ROBOTSTUDIO SAVE DATA PC#
Having multiple power-consuming devices on the USB bus often cause power supply problems : the PC might not be really able to provide enough power to all the USB ports in the same time (sometimes even if theoretically we would expect it should).
#SLAMTEC ROBOTSTUDIO SAVE DATA CODE#
This would be a workaround to isolate as much as we can the code in case it does not behave well with multiple devices in the same program. Maybe you already do this but in case you do otherwise, I would recommend to copy the files of the repo in 4 folders, launch 4 separate instances of MATLAB and each instance would run its own version of test_rplidar.m.The code has not been designed to be able to use multiple devices of the same type in the same program, though I would say it should work for the RPLIDAR as long as you do not use the RPLIDAR MATLAB functions with "Thread" in their name (this is why they are just in comments in test_rplidar.m).I have not tested the RPLIDAR A3 so it is possible that something is not correctly done in the communication protocol, I would have to check more in details.Here are some info, ideas, suggestions, questions: