Skip to content

Commit 877c605

Browse files
committed
support automatic identification platform
1 parent 4999819 commit 877c605

File tree

13 files changed

+58
-193
lines changed

13 files changed

+58
-193
lines changed

jetson/CMakeLists.txt

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,7 @@ include_directories(BEFORE /usr/include/c /usr/include/cpp)
55
find_package( OpenCV REQUIRED )
66
include_directories( ${OpenCV_INCLUDE_DIRS} )
77

8-
project(NanoPreview)
9-
add_executable(nano_preview jetson_nano_preview.cpp )
10-
target_link_libraries( nano_preview ArducamDepthCamera ${OpenCV_LIBS} )
11-
12-
project(NxPreview)
13-
add_executable(nx_preview jetson_nx_preview.cpp )
14-
target_link_libraries( nx_preview ArducamDepthCamera ${OpenCV_LIBS} )
15-
8+
project(JetsonPreview)
9+
add_executable(jetson_preview jetson_preview.cpp )
10+
target_link_libraries( jetson_preview ArducamDepthCamera ${OpenCV_LIBS} )
1611

jetson/compile_nano.sh renamed to jetson/Install_dependecies_jetson.sh

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,6 @@ sudo curl -s --compressed -o /etc/apt/sources.list.d/arducam_list_files.list "ht
77
sudo apt update
88
sudo apt install arducam-config-parser-dev arducam-usb-sdk-dev arducam-tof-sdk-dev
99

10-
# compile
11-
cd `find ~ -name Arducam_tof_camera`
12-
cd `find . -name jetson`
13-
14-
mkdir build && cd build
15-
cmake ..
16-
make
17-
./nano_preview
10+
wget https://github.com/ArduCAM/MIPI_Camera/releases/download/v0.0.3/install_full.sh
11+
chmod +x install_full.sh
12+
./install_full.sh -m arducam

jetson/README.md

Lines changed: 12 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,23 @@
11
## ArduCam Depth Camera
22
### Run project on Jetson
3-
### Driver install
3+
#### Install dependencies
4+
> Run in the Arducam_tof_camera/jetson folder
45
```Shell
5-
wget https://github.com/ArduCAM/MIPI_Camera/releases/download/v0.0.3/install_full.sh
6-
chmod +x install_full.sh
7-
./install_full.sh -m arducam
6+
./Install_dependencies.sh
87
```
98
### Compile && Run
10-
> Run in the Arducam_tof_camera folder
9+
> Run in the Arducam_tof_camera/jetson folder
1110
```Shell
12-
./compile_nano.sh
13-
# or
14-
./compile_nx.sh
11+
./compile.sh
1512
```
1613
> You can also manually install and compile according to the following steps
1714
### example
15+
### Driver install
16+
```Shell
17+
wget https://github.com/ArduCAM/MIPI_Camera/releases/download/v0.0.3/install_full.sh
18+
chmod +x install_full.sh
19+
./install_full.sh -m arducam
20+
```
1821
#### project dependencies
1922
```Shell
2023
sudo apt-get update
@@ -43,7 +46,5 @@
4346
#### cpp example
4447
> Run in the example/build folder
4548
```Shell
46-
./jetson/nx_preview
47-
#or
48-
./jetson/nano_preview
49+
./jetson/jetson_preview
4950
```

jetson/compile.sh

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
2+
# compile
3+
cd `find ~ -name Arducam_tof_camera`
4+
cd jetson
5+
6+
mkdir build && cd build
7+
cmake ..
8+
make
9+
./jetson_preview

jetson/compile_nx.sh

Lines changed: 0 additions & 17 deletions
This file was deleted.

jetson/jetson_nano_preview.cpp

Lines changed: 0 additions & 94 deletions
This file was deleted.

jetson/jetson_nx_preview.cpp renamed to jetson/jetson_preview.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ void getPreview(uint8_t *preview_ptr, float *phase_image_ptr, float *amplitude_i
3737

3838
int main()
3939
{
40-
ArduCam::ArduCamTOFCamera tof(ArduCam::Jetson_NX);
40+
ArduCam::ArduCamTOFCamera tof;
4141
ArduCam::FrameBuffer *frame;
4242
if (tof.init(ArduCam::CSI,ArduCam::DEPTH_TYPE)){
4343
std::cerr<<"initialization failed"<<std::endl;

pcl_preview/CMakeLists.txt

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -4,18 +4,18 @@ find_package(PCL QUIET)
44
include_directories(BEFORE /usr/include/c /usr/include/cpp)
55

66
if(PCL_FOUND)
7-
if(PLATFORM STREQUAL "NANO")
8-
message("JETSON_NANO!")
9-
add_definitions(-D__JETSON_NANO__)
10-
endif()
11-
if(PLATFORM STREQUAL "NX")
12-
message("JETSON_NX!")
13-
add_definitions(-D__JETSON_NX__)
14-
endif()
15-
if(PLATFORM STREQUAL "DEFAULT")
16-
message("DEFAULT!")
17-
add_definitions(-D__DEFAULT__)
18-
endif()
7+
# if(PLATFORM STREQUAL "NANO")
8+
# message("JETSON_NANO!")
9+
# add_definitions(-D__JETSON_NANO__)
10+
# endif()
11+
# if(PLATFORM STREQUAL "NX")
12+
# message("JETSON_NX!")
13+
# add_definitions(-D__JETSON_NX__)
14+
# endif()
15+
# if(PLATFORM STREQUAL "DEFAULT")
16+
# message("DEFAULT!")
17+
# add_definitions(-D__DEFAULT__)
18+
# endif()
1919
include_directories(BEFORE /usr/include/c /usr/include/cpp)
2020
find_package(OpenCV REQUIRED)
2121
include_directories(${OpenCV_INCLUDE_DIRS})

pcl_preview/README.md

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -14,12 +14,7 @@
1414
cd Arducam_tof_camera/pcl_preview
1515
mkdir build && cd build
1616

17-
# If the platform running the program is Jetson nano
18-
cmake -DPLATFORM:STRING=NANO ..
19-
# Else if the platform running the program is Jetson NX
20-
cmake -DPLATFORM:STRING=NX ..
21-
# Else
22-
cmake -DPLATFORM:STRING=DEFAULT ..
17+
cmake ..
2318

2419
make
2520
```

pcl_preview/preview_pointcloud.cpp

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -50,15 +50,8 @@ void getPreview(uint8_t *preview_ptr, float *depth_image_ptr, float *amplitude_i
5050

5151
int main()
5252
{
53-
#ifdef __JETSON_NANO__
54-
ArduCam::ArduCamTOFCamera tof(ArduCam::Jetson_Nano);
55-
#endif
56-
#ifdef __JETSON_NX__
57-
ArduCam::ArduCamTOFCamera tof(ArduCam::Jetson_NX);
58-
#endif
59-
#ifdef __DEFAULT__
60-
ArduCam::ArduCamTOFCamera tof;
61-
#endif
53+
54+
ArduCam::ArduCamTOFCamera tof;
6255
ArduCam::FrameBuffer *frame;
6356
std::time_t t;
6457
tm *nowtime;

0 commit comments

Comments
 (0)