Xinyan(Rose) Jiang's Notebook - cps-vip/cps-cosimulation-env GitHub Wiki
- Carried out kick-off presentation and explained the existing applications of LiDAR and SLAM in robots.
- Participated in group meeting and decided the major areas I will be working on this semester.
- Attended ROS/HELICS subteam meeting to follow up with latest updates especially in robot design.
- Acknowledged anticipated tasks and progress in robot design this semester.
- Started studying ROS using YouTube tutorials.
- Working on learning ROS using YouTube tutorial.
- Learnt about how to use LIDAR in ROS including LIDAR simulation in Gazebo
- Downloaded Docker and pulled down docker image from container registry
* attended weekly ROS/HELICS meeting online
* continued working on studying LiDar confidence levels and calculation
- attended weekly meeting and found out that I had the wrong docker container
- learnt about Linux basic knowledge and fundamental commands
- successfully ran the correct docker container and obtained the image.
- Continued reading research papers regarding Lidar.
- Participated in weekly subteam meeting, and updated my progress on learning Lidar.
- Installed Wireshark prior to the Thursday class session.
- Learnt about how to use wireshark to study network traffic using a sample data of packet cap.
- Participated in weekly online subteam meeting. Decided to get the actual components of LiDAR and start working on it next week.
- Read the report paper from last semester.
- Found out that the previous paper did not included enough information about the LiDAR module.
- In the team meeting during class session, I obtained the specific version of LiDAR that will be utilized and started research on this specific LiDAR product.
- Added a section regarding RPLiDAR A1, the LiDAR that we will use, into the midterm paper.
- Presented midterm presentation during class period and updated Lidar progress to the entire team.
- Shared with teammates about current progress on the project.
- attended group discussion on our progress. shared my progress on lidar implementation: the specifications of the specific Lidar we decided to use.
- researched on the RPLiDAR that we are using. existing implementations: https://ieeexplore.ieee.org/abstract/document/7451592
- I will learn from the current existing implementation of RPLiDAR to help with later debugging.
- shared progress of LiDAR implementation with a guest visiting our VIP meeting when Will was away.
- continued working on researching RPLiDAR. https://ieeexplore.ieee.org/abstract/document/8821803
- ready to work on physical LiDAR module hopefully this week on Thursday.
- researching on how to implement LiDAR on ROS. https://www.youtube.com/watch?v=WVyJjxAyGJc
- confirmed that I will have access to physical LiDAR next week on Thursday's session.
- updated on my progress on lidar implementation research to the subteam on Wednesday's group meeting
- received the physical lidar and got successful connection - data received on laptop.
- data received in terminal is not easy to read as shown in the following screenshots. Therefore, I created a csv to display the data in table format. The procedure of data collection in csv format is included in WEEK13's notebook.
- organized data collection in a table for readability and future debug.
\
Table:
- attended weekly subteam meeting to update my progress on lidar connection
- showed data collection outcome to the team
- will record details of my lidar connection procedure for people to reference next semester.
LiDar data collection procedure: I am using a MacBook with M-series chip. Run the following code in terminal.
step 1: find the port connected
ls /dev/cu.* | grep usbserial
expected: /dev/cu.usbserial-0001
step 2: install the serial library
python3 -m pip install --user pyserial
step 3: create a CSV logger to read data
cat > ~/ld2csv_auto.py <<'PY'
import sys, time, csv, serial
P = sys.argv[1] if len(sys.argv)>1 else '/dev/cu.usbserial-0001'
BAUDS = [230400,115200,256000,512000]
u16 = lambda b: b[0] | (b[1]<<8)
ser = None
for B in BAUDS:
try:
ser = serial.Serial(P, B, timeout=1, exclusive=False)
break
except: pass
if not ser: raise SystemExit("Can't open serial")
buf = bytearray(); t0 = time.time()
w = csv.writer(open('lidar.csv','w',newline=''))
w.writerow(['t_sec','angle_deg','distance_m','intensity'])
try:
while True:
buf += ser.read(4096)
i = buf.find(b'\x54')
if i < 0: buf = buf[-64:]; continue
if len(buf)-i < 3: buf = buf[i:]; continue
L = buf[i+1]; need = L + 3 # generic LD frame: total bytes
if len(buf)-i < need: buf = buf[i:]; continue
fr = buf[i:i+need]; del buf[:i+need]
if fr[0] != 0x54: continue
if need == 47: # common 12-point frame
sa = u16(fr[4:6]); ea = u16(fr[-5:-3])
step = ((ea + (36000 if ea < sa else 0)) - sa) / 11.0
t = time.time()-t0
for k in range(12):
j = 6 + 3*k
d = u16(fr[j:j+2]); it = fr[j+2]
ang = (sa + step*k) % 36000
w.writerow([t, ang/100.0, d/1000.0, it])
except KeyboardInterrupt:
pass
finally:
try: ser.close()
except: pass
PY
step 4: run and stop with control C
python3 ~/ld2csv_auto.py /dev/cu.usbserial-0001
step 5: open
open lidar.csv
potential problems:
bad connection: loose serial UART connection, the wire frequently disconnects from the port, causing unstable connection.
- changing a wire might help. If changing the wire does not solve the problem, we might need to dissemble the LiDAR, remove the serial connector and resolder a better one.
- discussed my update on lidar data collection progress in Wednesday's meeting and talked about preparing slides for end-of-semester presentation.
- added slides for my progress on lidar data collection in the presentation slides
- listen to the other subteam's presentation and learned about their outcome of this semester
- did final presentation in class to share out subteam's progress. I shared about my progress on LiDar Data collection