Skip to content

Commit 5c130e0

Browse files
Split collect into windows/wsl
1 parent 94fb33f commit 5c130e0

File tree

4 files changed

+163
-12
lines changed

4 files changed

+163
-12
lines changed

collect/Automation.lua

+69
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,69 @@
1+
---------------------------------- STARTUP -------------------------------------
2+
------------------------ DO NOT MODIFY THIS SECTION ----------------------------
3+
4+
-- mmwavestudio installation path
5+
RSTD_PATH = RSTD.GetRstdPath()
6+
7+
-- Declare the loading function
8+
dofile(RSTD_PATH .. "\\Scripts\\Startup.lua")
9+
10+
----------------------------------- CONFIG -------------------------------------
11+
12+
ar1.FullReset()
13+
ar1.SOPControl(2)
14+
ar1.Connect(5,115200,1000)
15+
ar1.Calling_IsConnected()
16+
ar1.SelectChipVersion("AR1642")
17+
ar1.SelectChipVersion("AR1642")
18+
ar1.deviceVariantSelection("XWR1843")
19+
ar1.frequencyBandSelection("77G")
20+
ar1.SelectChipVersion("XWR1843")
21+
ar1.DownloadBSSFw("C:\\ti\\mmwave_studio_02_01_01_00\\rf_eval_firmware\\radarss\\xwr18xx_radarss.bin")
22+
ar1.GetBSSFwVersion()
23+
ar1.GetBSSPatchFwVersion()
24+
ar1.DownloadMSSFw("C:\\ti\\mmwave_studio_02_01_01_00\\rf_eval_firmware\\masterss\\xwr18xx_masterss.bin")
25+
ar1.GetMSSFwVersion()
26+
ar1.PowerOn(0, 1000, 0, 0)
27+
ar1.SelectChipVersion("AR1642")
28+
ar1.SelectChipVersion("XWR1843")
29+
ar1.RfEnable()
30+
ar1.GetMSSFwVersion()
31+
ar1.GetBSSFwVersion()
32+
ar1.GetBSSPatchFwVersion()
33+
ar1.ChanNAdcConfig(1, 1, 1, 1, 1, 1, 1, 2, 2, 0)
34+
ar1.LPModConfig(0, 1)
35+
ar1.RfInit()
36+
ar1.SetCalMonFreqLimitConfig(77,81)
37+
ar1.DataPathConfig(513, 1216644097, 0)
38+
ar1.LvdsClkConfig(1, 1)
39+
ar1.LVDSLaneConfig(0, 1, 1, 0, 0, 1, 0, 0)
40+
ar1.ProfileConfig(0, 77, 10, 6, 63.14, 0, 0, 0, 0, 0, 0, 63.343, 1, 512, 9121, 0, 0, 30)
41+
ar1.ChirpConfig(0, 0, 0, 0, 0, 0, 0, 1, 0, 0)
42+
-- ar1.ChirpConfig(1, 1, 0, 0, 0, 0, 0, 0, 1, 0)
43+
ar1.ChirpConfig(1, 1, 0, 0, 0, 0, 0, 0, 0, 1)
44+
ar1.DisableTestSource(0)
45+
ar1.FrameConfig(0, 1, 0, 1, 0.5, 0, 0, 1)
46+
ar1.GetCaptureCardDllVersion()
47+
ar1.SelectCaptureDevice("DCA1000")
48+
ar1.CaptureCardConfig_EthInit("192.168.33.30", "192.168.33.180", "12:34:56:78:90:12", 4096, 4098)
49+
ar1.CaptureCardConfig_Mode(1, 2, 1, 2, 3, 30)
50+
ar1.CaptureCardConfig_PacketDelay(25)
51+
ar1.GetCaptureCardFPGAVersion()
52+
53+
------------------------- Start the capture ------------------------------------
54+
55+
RSTD.Sleep(15000)
56+
ar1.CaptureCardConfig_StartRecord("C:\\ti\\mmwave_studio_02_01_01_00\\mmWaveStudio\\PostProc\\adc_data.bin", 1)
57+
RSTD.Sleep(1000)
58+
ar1.StartFrame()
59+
RSTD.Sleep(1000)
60+
61+
------------------------- End the capture --------------------------------------
62+
63+
-- ar1.StopFrame()
64+
-- ar1.PowerOff()
65+
-- ar1.Disconnect()
66+
67+
os.exit()
68+
69+
-- end

collect/README.md

+48
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
# Data Collection
2+
3+
## Radar Computer
4+
1. Power:
5+
- power supply charges via USB-C
6+
- power supply power button
7+
- hold power supply AC button until AC is shown on screen
8+
2. connect laptop to dart-5 (wiselab2023)
9+
3. AFTER laptop is connected to wifi, plug in NUC + radar and press power on NUC
10+
4. run RDP on laptop.
11+
- connect to win-qbb0j8pltgl.local
12+
- username: Administrator
13+
- password: mmwave76GHz
14+
5. run cmd:
15+
```sh
16+
cd git/dart/scripts
17+
conda activate dart-datacollect
18+
python radar.py
19+
```
20+
6. wait about 60 seconds until mmwave GUI closes
21+
- should see "flushing 8192 packets"
22+
- if radar packets are not showing up (this happens on first boot of NUC):
23+
1. ctrl-C
24+
2. open task manager
25+
3. find `DCA1000EVM` exe
26+
4. end task
27+
5. power cycle the radar
28+
6. start again from the `python radar.py` command
29+
30+
31+
## Lidar Computer
32+
33+
34+
35+
0. Time sync: `sudo ntpdate -u time.windows.com`
36+
1. `roslaunch slam ouster.launch`
37+
2. `roslaunch xsens_mti_driver xsens_mti_node.launch`
38+
3. go into `/home/wiselab/catkin_ws/src/data_collection/src/`, then execute `./gt_collect.sh {filename}`
39+
40+
## Cartographer Processing
41+
42+
wiselab@touriga
43+
44+
0. Check that rosbag is good shape: `rosbag info {filename}.bag`
45+
- If an issue is found: `rosbag reindex {filename}.bag`
46+
1. `roslaunch slam offine_cart_3d.launch bag_filenames:=/home/wiselab/ws/dart/{filename}.bag`
47+
2. `roslaunch slam asset_writer_cart_3d.launch bag_filenames:=/home/wiselab/ws/dart/{filename}.bag pose_graph_filename:=/home/wiselab/ws/dart/{filename}.bag.pbstream`
48+
3. go to `/home/wiselab/catkin_ws/src/slam/src/`, execute `./get_pose {filename}`

collect/radar.py collect/collect.py

+2-12
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
1-
#!/usr/bin/python
2-
# -*- coding: utf-8 -*-
1+
"""Main collection script (wsl)"""
32

43
import argparse
54
import subprocess
@@ -12,8 +11,6 @@
1211
from datetime import datetime
1312

1413

15-
CMD_DIR = 'C:/ti/mmwave_studio_02_01_01_00/mmWaveStudio/RunTime'
16-
SCRIPT_FILE = 'C:/Users/Administrator/git/dart/scripts/radar/Automation.lua'
1714
PACKET_BUFSIZE = 8192
1815
MAX_PACKET_SIZE = 4096
1916

@@ -51,19 +48,12 @@ def radarcollect(args):
5148
os.makedirs(args.output, exist_ok=True)
5249
outfile = os.path.join(args.output, 'radarpackets.h5')
5350

54-
cwd = os.getcwd()
55-
os.chdir(CMD_DIR)
56-
subprocess.Popen(['mmWaveStudio.exe', '/lua', SCRIPT_FILE])
57-
os.chdir(cwd)
58-
print('waiting 56 seconds...')
59-
time.sleep(56.0)
60-
print('starting!')
61-
6251
cfg_recv = (args.static_ip, args.config_port)
6352
data_recv = (args.static_ip, args.data_port)
6453

6554
# Need to open the config socket, even if we don't use it, in order to
6655
# "steal" it from mmwave studo.
56+
# Otherwise, this script will crash after
6757
config_socket = socket.socket(
6858
socket.AF_INET, socket.SOCK_DGRAM, socket.IPPROTO_UDP)
6959
data_socket = socket.socket(

collect/start.py

+44
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
#!/usr/bin/python
2+
# -*- coding: utf-8 -*-
3+
4+
import os
5+
import sys
6+
import subprocess
7+
import time
8+
9+
10+
CMD_DIR = 'C:/ti/mmwave_studio_02_01_01_00/mmWaveStudio/RunTime'
11+
SCRIPT_FILE = 'C:/Users/Administrator/git/dart/collect/Automation.lua'
12+
13+
14+
def _parse(p):
15+
p.add_argument(
16+
'--static_ip', '-i',
17+
help='Static IP address (eg 192.168.33.30)',
18+
default='192.168.33.30')
19+
p.add_argument(
20+
'--data_port', '-d', type=int, default=4098,
21+
help='Port for data stream (eg. 4098)')
22+
p.add_argument(
23+
'--config_port', '-c', type=int, default=4096,
24+
help='Port for config stream (eg. 4096)')
25+
p.add_argument(
26+
'--timeout', '-t', type=float, default=20,
27+
help='Socket timeout in seconds (eg. 20)')
28+
p.add_argument(
29+
'--output', '-o', default=None, help="Output directory. If blank, "
30+
"creates a folder with the current datetime.")
31+
return p
32+
33+
34+
if __name__ == '__main__':
35+
36+
cwd = os.getcwd()
37+
os.chdir(CMD_DIR)
38+
subprocess.Popen(['mmWaveStudio.exe', '/lua', SCRIPT_FILE])
39+
os.chdir(cwd)
40+
print('waiting 56 seconds...')
41+
time.sleep(56.0)
42+
print('starting!')
43+
44+
subprocess.Popen(["wsl", "python3", "collect.py"] + sys.argv[1:])

0 commit comments

Comments
 (0)