├── .gitignore ├── .hgignore ├── .hgtags ├── AUTHORS.txt ├── Makefile ├── Readme.txt ├── Readme_ja.txt ├── Releasenotes.txt ├── current ├── COPYRIGHT.txt ├── Doxyfile ├── Doxyfile_ja ├── Install.txt ├── Makefile ├── Makefile.release ├── build_rule.mk ├── dox │ ├── Makefile │ ├── connect_and_get.c │ ├── connect_ethernet.c │ ├── convert_xy.c │ ├── doxygen_stylesheet.css │ ├── get_scans.c │ ├── get_timestamp.c │ ├── library_sample.dox │ ├── library_tutorial.dox │ ├── mainpage.dox │ ├── multiecho_image.svg │ ├── sensor_angle_image.svg │ ├── sensor_index_image.svg │ ├── sensor_step_image.svg │ ├── set_parameter.c │ ├── skip_scan_image.svg │ ├── usage_gcc.dox │ ├── usage_windows_bat.dox │ └── usage_windows_vcproj.dox ├── include │ ├── c │ │ ├── urg_connection.h │ │ ├── urg_debug.h │ │ ├── urg_detect_os.h │ │ ├── urg_errno.h │ │ ├── urg_ring_buffer.h │ │ ├── urg_sensor.h │ │ ├── urg_serial.h │ │ ├── urg_serial_utils.h │ │ ├── urg_tcpclient.h │ │ └── urg_utils.h │ └── cpp │ │ ├── Lidar.h │ │ ├── Urg_driver.h │ │ ├── detect_os.h │ │ ├── math_utilities.h │ │ └── ticks.h ├── samples │ ├── Makefile │ ├── Makefile.release │ ├── c │ │ ├── Makefile │ │ ├── Makefile.release │ │ ├── angle_convert_test.c │ │ ├── calculate_xy.c │ │ ├── find_port.c │ │ ├── get_distance.c │ │ ├── get_distance_handshake.c │ │ ├── get_distance_intensity.c │ │ ├── get_distance_intensity_io.c │ │ ├── get_distance_io.c │ │ ├── get_multiecho.c │ │ ├── get_multiecho_intensity.c │ │ ├── open_urg_sensor.c │ │ ├── open_urg_sensor.h │ │ ├── reboot_test.c │ │ ├── sensor_parameter.c │ │ ├── sync_time_stamp.c │ │ └── timeout_test.c │ └── cpp │ │ ├── Connection_information.cpp │ │ ├── Connection_information.h │ │ ├── Makefile │ │ ├── Makefile.release │ │ ├── get_distance.cpp │ │ ├── get_distance_handshake.cpp │ │ ├── get_distance_intensity.cpp │ │ ├── get_distance_intensity_io.cpp │ │ ├── get_distance_io.cpp │ │ ├── get_multiecho.cpp │ │ ├── get_multiecho_intensity.cpp │ │ ├── sensor_parameter.cpp │ │ └── sync_time_stamp.cpp ├── src │ ├── Makefile │ ├── Makefile.release │ ├── Urg_driver.cpp │ ├── ticks.cpp │ ├── urg_connection.c │ ├── urg_debug.c │ ├── urg_ring_buffer.c │ ├── urg_sensor.c │ ├── urg_serial.c │ ├── urg_serial_linux.c │ ├── urg_serial_utils.c │ ├── urg_serial_utils_linux.c │ ├── urg_serial_utils_windows.c │ ├── urg_serial_windows.c │ ├── urg_tcpclient.c │ └── urg_utils.c ├── urg_c-config.in ├── urg_cpp-config.in ├── viewers │ ├── Makefile │ └── viewer_sdl │ │ ├── Makefile │ │ ├── plotter_sdl.c │ │ ├── plotter_sdl.h │ │ └── viewer_sdl.c ├── vs2005 │ ├── c │ │ ├── calculate_xy │ │ │ └── calculate_xy.vcproj │ │ ├── find_port │ │ │ └── find_port.vcproj │ │ ├── get_distance │ │ │ └── get_distance.vcproj │ │ ├── get_distance_intensity │ │ │ └── get_distance_intensity.vcproj │ │ ├── get_multiecho │ │ │ └── get_multiecho.vcproj │ │ ├── get_multiecho_intensity │ │ │ └── get_multiecho_intensity.vcproj │ │ ├── sensor_parameter │ │ │ └── sensor_parameter.vcproj │ │ ├── sync_time_stamp │ │ │ └── sync_time_stamp.vcproj │ │ ├── urg.sln │ │ └── urg │ │ │ └── urg.vcproj │ └── cpp │ │ ├── get_distance │ │ └── get_distance.vcproj │ │ ├── get_distance_intensity │ │ └── get_distance_intensity.vcproj │ │ ├── get_multiecho │ │ └── get_multiecho.vcproj │ │ ├── get_multiecho_intensity │ │ └── get_multiecho_intensity.vcproj │ │ ├── sensor_parameter │ │ └── sensor_parameter.vcproj │ │ ├── sync_time_stamp │ │ └── sync_time_stamp.vcproj │ │ ├── urg_cpp.sln │ │ └── urg_cpp │ │ └── urg_cpp.vcproj ├── vs2010 │ ├── c │ │ ├── calculate_xy │ │ │ └── calculate_xy.vcxproj │ │ ├── find_port │ │ │ └── find_port.vcxproj │ │ ├── get_distance │ │ │ └── get_distance.vcxproj │ │ ├── get_distance_intensity │ │ │ └── get_distance_intensity.vcxproj │ │ ├── get_multiecho │ │ │ └── get_multiecho.vcxproj │ │ ├── get_multiecho_intensity │ │ │ └── get_multiecho_intensity.vcxproj │ │ ├── sensor_parameter │ │ │ └── sensor_parameter.vcxproj │ │ ├── sync_time_stamp │ │ │ └── sync_time_stamp.vcxproj │ │ ├── urg.sln │ │ └── urg │ │ │ └── urg.vcxproj │ └── cpp │ │ ├── get_distance │ │ └── get_distance.vcxproj │ │ ├── get_distance_intensity │ │ └── get_distance_intensity.vcxproj │ │ ├── get_multiecho │ │ └── get_multiecho.vcxproj │ │ ├── get_multiecho_intensity │ │ └── get_multiecho_intensity.vcxproj │ │ ├── sensor_parameter │ │ └── sensor_parameter.vcxproj │ │ ├── sync_time_stamp │ │ └── sync_time_stamp.vcxproj │ │ ├── urg_cpp.sln │ │ └── urg_cpp │ │ └── urg_cpp.vcxproj ├── vs2015 │ ├── c │ │ ├── calculate_xy │ │ │ └── calculate_xy.vcxproj │ │ ├── find_port │ │ │ └── find_port.vcxproj │ │ ├── get_distance │ │ │ └── get_distance.vcxproj │ │ ├── get_distance_intensity │ │ │ └── get_distance_intensity.vcxproj │ │ ├── get_multiecho │ │ │ └── get_multiecho.vcxproj │ │ ├── get_multiecho_intensity │ │ │ └── get_multiecho_intensity.vcxproj │ │ ├── sensor_parameter │ │ │ └── sensor_parameter.vcxproj │ │ ├── sync_time_stamp │ │ │ └── sync_time_stamp.vcxproj │ │ ├── urg.sln │ │ └── urg │ │ │ └── urg.vcxproj │ └── cpp │ │ ├── get_distance │ │ └── get_distance.vcxproj │ │ ├── get_distance_intensity │ │ └── get_distance_intensity.vcxproj │ │ ├── get_multiecho │ │ └── get_multiecho.vcxproj │ │ ├── get_multiecho_intensity │ │ └── get_multiecho_intensity.vcxproj │ │ ├── sensor_parameter │ │ └── sensor_parameter.vcxproj │ │ ├── sync_time_stamp │ │ └── sync_time_stamp.vcxproj │ │ ├── urg_cpp.sln │ │ └── urg_cpp │ │ └── urg_cpp.vcxproj ├── vs2017 │ ├── c │ │ ├── calculate_xy │ │ │ └── calculate_xy.vcxproj │ │ ├── find_port │ │ │ └── find_port.vcxproj │ │ ├── get_distance │ │ │ └── get_distance.vcxproj │ │ ├── get_distance_intensity │ │ │ └── get_distance_intensity.vcxproj │ │ ├── get_distance_intensity_io │ │ │ └── get_distance_intensity_io.vcxproj │ │ ├── get_distance_io │ │ │ └── get_distance_io.vcxproj │ │ ├── get_multiecho │ │ │ └── get_multiecho.vcxproj │ │ ├── get_multiecho_intensity │ │ │ └── get_multiecho_intensity.vcxproj │ │ ├── sensor_parameter │ │ │ └── sensor_parameter.vcxproj │ │ ├── sync_time_stamp │ │ │ └── sync_time_stamp.vcxproj │ │ ├── urg.sln │ │ └── urg │ │ │ └── urg.vcxproj │ └── cpp │ │ ├── get_distance │ │ └── get_distance.vcxproj │ │ ├── get_distance_intensity │ │ └── get_distance_intensity.vcxproj │ │ ├── get_distance_intensity_io │ │ └── get_distance_intensity_io.vcxproj │ │ ├── get_distance_io │ │ └── get_distance_io.vcxproj │ │ ├── get_multiecho │ │ └── get_multiecho.vcxproj │ │ ├── get_multiecho_intensity │ │ └── get_multiecho_intensity.vcxproj │ │ ├── sensor_parameter │ │ └── sensor_parameter.vcxproj │ │ ├── sync_time_stamp │ │ └── sync_time_stamp.vcxproj │ │ ├── urg_cpp.sln │ │ └── urg_cpp │ │ └── urg_cpp.vcxproj ├── vs2019 │ ├── c │ │ ├── calculate_xy │ │ │ └── calculate_xy.vcxproj │ │ ├── find_port │ │ │ └── find_port.vcxproj │ │ ├── get_distance │ │ │ └── get_distance.vcxproj │ │ ├── get_distance_intensity │ │ │ └── get_distance_intensity.vcxproj │ │ ├── get_distance_intensity_io │ │ │ └── get_distance_intensity_io.vcxproj │ │ ├── get_distance_io │ │ │ └── get_distance_io.vcxproj │ │ ├── get_multiecho │ │ │ └── get_multiecho.vcxproj │ │ ├── get_multiecho_intensity │ │ │ └── get_multiecho_intensity.vcxproj │ │ ├── sensor_parameter │ │ │ └── sensor_parameter.vcxproj │ │ ├── sync_time_stamp │ │ │ └── sync_time_stamp.vcxproj │ │ ├── urg.sln │ │ └── urg │ │ │ └── urg.vcxproj │ └── cpp │ │ ├── get_distance │ │ └── get_distance.vcxproj │ │ ├── get_distance_intensity │ │ └── get_distance_intensity.vcxproj │ │ ├── get_distance_intensity_io │ │ └── get_distance_intensity_io.vcxproj │ │ ├── get_distance_io │ │ └── get_distance_io.vcxproj │ │ ├── get_multiecho │ │ └── get_multiecho.vcxproj │ │ ├── get_multiecho_intensity │ │ └── get_multiecho_intensity.vcxproj │ │ ├── sensor_parameter │ │ └── sensor_parameter.vcxproj │ │ ├── sync_time_stamp │ │ └── sync_time_stamp.vcxproj │ │ ├── urg_cpp.sln │ │ └── urg_cpp │ │ └── urg_cpp.vcxproj └── windowsexe │ ├── cleanobj.bat │ └── compile.bat └── split_comment.rb /.gitignore: -------------------------------------------------------------------------------- 1 | 2 | *.exe 3 | 4 | *.o 5 | 6 | *.dll 7 | 8 | *.a 9 | 10 | *.zip 11 | 12 | release/ 13 | -------------------------------------------------------------------------------- /.hgignore: -------------------------------------------------------------------------------- 1 | syntax: glob 2 | *~ 3 | *.o 4 | *.a 5 | *.exe 6 | current/html 7 | current/html_ja 8 | 9 | current/dox/multiecho_image.png 10 | current/dox/sensor_angle_image.png 11 | current/dox/sensor_index_image.png 12 | current/dox/sensor_step_image.png 13 | current/dox/skip_scan_image.png 14 | 15 | release 16 | generated_html 17 | test/urg_sensor_test 18 | test/serial_test 19 | test/urg04lx_parameter_test 20 | viewer_sdl/viewer_sdl 21 | urg_library*.zip 22 | 23 | connect_and_get 24 | connect_ethernet 25 | convert_xy 26 | get_scans 27 | get_timestamp 28 | set_parameter 29 | reboot_test 30 | timeout_test 31 | angle_convert_test 32 | current/clean_vs_file.sh 33 | current/windowsexe/vsvars32.bat 34 | current/src/tags 35 | *.dll 36 | -------------------------------------------------------------------------------- /.hgtags: -------------------------------------------------------------------------------- 1 | fdf99b29c375d397a9ab55566b0dca0c7d046c82 ver.1.2.1 2 | -------------------------------------------------------------------------------- /AUTHORS.txt: -------------------------------------------------------------------------------- 1 | Satofumi Kamimura 2 | Adrian Boeing 3 | -------------------------------------------------------------------------------- /Makefile: -------------------------------------------------------------------------------- 1 | # urgwidget 2 | 3 | VERSION = 1.2.8 4 | RELEASE_DIR = release 5 | PACKAGE_EN_DIR = urg_library-$(VERSION) 6 | PACKAGE_JA_DIR = urg_library_ja-$(VERSION) 7 | 8 | PWD = $(shell pwd) 9 | 10 | all : 11 | cd current/ && $(MAKE) 12 | 13 | clean : release_clean 14 | cd current/ && $(MAKE) clean 15 | $(RM) -rf $(RELEASE_DIR) 16 | 17 | install : dist 18 | cd $(RELEASE_DIR)/$(PACKAGE_JA_DIR) && $(MAKE) install 19 | 20 | 21 | TARGET_DIR = $(PACKAGE_EN_DIR) $(PACKAGE_JA_DIR) 22 | dist : release_clean 23 | mkdir -p $(RELEASE_DIR) 24 | for i in $(TARGET_DIR) ; \ 25 | do \ 26 | mkdir -p $(RELEASE_DIR)/$$i; \ 27 | mkdir -p $(RELEASE_DIR)/$$i/include; \ 28 | mkdir -p $(RELEASE_DIR)/$$i/include/c; \ 29 | mkdir -p $(RELEASE_DIR)/$$i/include/cpp; \ 30 | mkdir -p $(RELEASE_DIR)/$$i/src; \ 31 | mkdir -p $(RELEASE_DIR)/$$i/windowsexe; \ 32 | mkdir -p $(RELEASE_DIR)/$$i/vs2005; \ 33 | mkdir -p $(RELEASE_DIR)/$$i/vs2010; \ 34 | mkdir -p $(RELEASE_DIR)/$$i/vs2015; \ 35 | mkdir -p $(RELEASE_DIR)/$$i/vs2017; \ 36 | mkdir -p $(RELEASE_DIR)/$$i/vs2019; \ 37 | mkdir -p $(RELEASE_DIR)/$$i/samples; \ 38 | mkdir -p $(RELEASE_DIR)/$$i/samples/c; \ 39 | mkdir -p $(RELEASE_DIR)/$$i/samples/cpp; \ 40 | cp current/COPYRIGHT.txt current/Install.txt current/build_rule.mk Readme.txt AUTHORS.txt Releasenotes.txt $(RELEASE_DIR)/$$i/; \ 41 | cp current/Makefile.release $(RELEASE_DIR)/$$i/Makefile; \ 42 | cp current/src/Makefile.release $(RELEASE_DIR)/$$i/src/Makefile; \ 43 | cp current/samples/Makefile $(RELEASE_DIR)/$$i/samples/Makefile ; \ 44 | cp current/samples/c/Makefile.release $(RELEASE_DIR)/$$i/samples/c/Makefile ; \ 45 | cp current/samples/cpp/Makefile.release $(RELEASE_DIR)/$$i/samples/cpp/Makefile ; \ 46 | cp current/include/c/*.h $(RELEASE_DIR)/$$i/include/c/; \ 47 | cp current/include/cpp/*.h $(RELEASE_DIR)/$$i/include/cpp/; \ 48 | cp current/src/*.c $(RELEASE_DIR)/$$i/src/; \ 49 | cp current/src/*.cpp $(RELEASE_DIR)/$$i/src/; \ 50 | cp current/windowsexe/*.bat $(RELEASE_DIR)/$$i/windowsexe/; \ 51 | cp -r current/vs2005/ $(RELEASE_DIR)/$$i/; \ 52 | cp -r current/vs2010/ $(RELEASE_DIR)/$$i/; \ 53 | cp -r current/vs2015/ $(RELEASE_DIR)/$$i/; \ 54 | cp -r current/vs2017/ $(RELEASE_DIR)/$$i/; \ 55 | cp -r current/vs2019/ $(RELEASE_DIR)/$$i/; \ 56 | cat current/urg_c-config.in | sed -e "s/VERSION/$(VERSION)/g" > $(RELEASE_DIR)/$$i/urg_c-config.in ; \ 57 | cat current/urg_cpp-config.in | sed -e "s/VERSION/$(VERSION)/g" > $(RELEASE_DIR)/$$i/urg_cpp-config.in ; \ 58 | done 59 | ruby split_comment.rb -e current/include/c/*.h $(RELEASE_DIR)/$(PACKAGE_EN_DIR)/include/c/ 60 | ruby split_comment.rb -e current/include/cpp/*.h $(RELEASE_DIR)/$(PACKAGE_EN_DIR)/include/cpp/ 61 | ruby split_comment.rb -e current/src/*.c $(RELEASE_DIR)/$(PACKAGE_EN_DIR)/src/ 62 | ruby split_comment.rb -e current/src/*.cpp $(RELEASE_DIR)/$(PACKAGE_EN_DIR)/src/ 63 | ruby split_comment.rb -e current/samples/c/*.c $(RELEASE_DIR)/$(PACKAGE_EN_DIR)/samples/c/ 64 | ruby split_comment.rb -e current/samples/cpp/*.cpp $(RELEASE_DIR)/$(PACKAGE_EN_DIR)/samples/cpp/ 65 | ruby split_comment.rb -e current/samples/c/*.h $(RELEASE_DIR)/$(PACKAGE_EN_DIR)/samples/c/ 66 | ruby split_comment.rb -e current/samples/cpp/*.h $(RELEASE_DIR)/$(PACKAGE_EN_DIR)/samples/cpp/ 67 | ruby split_comment.rb -j current/include/c/*.h $(RELEASE_DIR)/$(PACKAGE_JA_DIR)/include/c/ 68 | ruby split_comment.rb -j current/include/cpp/*.h $(RELEASE_DIR)/$(PACKAGE_JA_DIR)/include/cpp/ 69 | ruby split_comment.rb -j current/src/*.c $(RELEASE_DIR)/$(PACKAGE_JA_DIR)/src/ 70 | ruby split_comment.rb -j current/src/*.cpp $(RELEASE_DIR)/$(PACKAGE_JA_DIR)/src/ 71 | ruby split_comment.rb -j current/samples/c/*.c $(RELEASE_DIR)/$(PACKAGE_JA_DIR)/samples/c/ 72 | ruby split_comment.rb -j current/samples/cpp/*.cpp $(RELEASE_DIR)/$(PACKAGE_JA_DIR)/samples/cpp/ 73 | ruby split_comment.rb -j current/samples/c/*.h $(RELEASE_DIR)/$(PACKAGE_JA_DIR)/samples/c/ 74 | ruby split_comment.rb -j current/samples/cpp/*.h $(RELEASE_DIR)/$(PACKAGE_JA_DIR)/samples/cpp/ 75 | 76 | for i in $(TARGET_DIR) ; \ 77 | do \ 78 | cd $(PWD); \ 79 | cd $(RELEASE_DIR)/$$i && $(MAKE) && $(MAKE) clean; \ 80 | done 81 | for i in $(TARGET_DIR) ; \ 82 | do \ 83 | cd $(PWD); \ 84 | cd $(RELEASE_DIR)/ && (zip -r $$i.zip $$i) && mv $$i.zip ../; \ 85 | done 86 | 87 | release_clean : 88 | $(RM) -rf $(RELEASE_DIR)/$(PACKAGE_EN_DIR) $(RELEASE_DIR)/$(PACKAGE_JA_DIR) 89 | $(RM) $(PACKAGE_EN_DIR).zip $(PACKAGE_JA_DIR).zip 90 | -------------------------------------------------------------------------------- /Readme.txt: -------------------------------------------------------------------------------- 1 | URG Library 2 | 3 | About this software: 4 | This software have been developed to provide a library to use 5 | scanning range sensors of Hokuyo Automatic Corporation. Samples 6 | will help to know how to use them. 7 | 8 | Authors: 9 | Satofumi Kamimura Design and implementation of the first version. 10 | Katsumi Kimoto 11 | 12 | License: 13 | (C)Simplified BSD License. 14 | (C++)Simplified BSD License. 15 | See COPYRIGHT file. 16 | 17 | 18 | Mailing list: 19 | urgnetwork-support@lists.sourceforge.net 20 | 21 | 22 | Library usage: 23 | 24 | Visual Studio Solution (Windows) 25 | 26 | Use urg_library-X.X.X/vs2010(or vs2005)/c(or cpp)/urg.sln project file to build. 27 | 28 | After building, the urg.lib static library file and the executable files for each 29 | sample program will be generated. 30 | 31 | 32 | Visual Studio bat compile (Windows) 33 | *Perform the following steps using the command prompt* 34 | 35 | 1. To configure the environment variables, copy the batch (.bat) file provided by Visual Studio. 36 | Copy the following file: 37 | Microsoft Visual Studio 8/Common7/Tools/vsvars32.bat 38 | into the folder: 39 | urg-library-X.X.X/windowsexe 40 | 41 | 2. After configuring the environment variables (the above .bat file), execute the following .bat 42 | file to compile: 43 | urg-library-X.X.X/windowsexe/compile.bat 44 | 45 | 3. The executable file for the sample programs is generated. 46 | The samples' executable files are found in the folder: 47 | urg-library-X.X.X/windowsexe 48 | 49 | 4. To clean up generated executable files run the following .bat file: 50 | urg-library-X.X.X/windowsexe/cleanobj.bat 51 | 52 | 53 | gcc (Linux, MinGW) 54 | 55 | If you need to change the default installation directory, change the PREFIX variable 56 | in the following file: 57 | urg_library-X.X.X/current/Makefile.release 58 | 59 | This is the default setting, change it to suit your needs: 60 | PREFIX = /usr/local 61 | #PREFIX = /mingw 62 | 63 | To compile and install, perform the following steps: 64 | $ make 65 | # make install 66 | 67 | To learn how to use the library, see the Makefile and source codes on the following folder: 68 | urg-library-X.X.X/samples/ 69 | 70 | -------------------------------------------------------------------------------- /Readme_ja.txt: -------------------------------------------------------------------------------- 1 | URG Library 2 | 3 | About this software: 4 | This software have been developed to provide a library to use 5 | scanning range sensors of Hokuyo Automatic Corporation. Samples 6 | will help to know how to use them. 7 | 8 | Authors: 9 | Satofumi Kamimura Design and implementation of the first version. 10 | Katsumi Kimoto 11 | 12 | License: 13 | (C)Simplified BSD License. 14 | (C++)Simplified BSD License. 15 | See COPYRIGHT file. 16 | 17 | 18 | Mailing list: 19 | urgnetwork-support@lists.sourceforge.net 20 | 21 | 22 | Library usage: 23 | 24 | Visual Studio Solution (Windows) 25 | 26 | urg_library-X.X.X/vs2010(or vs2005)/c(or cpp)/urg.sln をビルドします。 27 | 28 | ビルド後は、urg.lib のスタティックライブラリと各サンプルの 29 | 実行ファイルが生成されています。 30 | 31 | 32 | 33 | Visual Studio bat compile (Windows) 34 | 35 | *以下の作業はコマンドプロンプト上で行ってください* 36 | 37 | 1. 環境変数を設定するために Visual Studio が提供している bat ファイルを 38 | コピーします。 39 | 40 | Microsoft Visual Studio 8/Common7/Tools/vsvars32.bat を 41 | urg-library-X.X.X/windowsexeにコピーする。 42 | 43 | 44 | 2. 環境変数を設定後、コンパイル用のbatファイルを実行する。 45 | 46 | urg-library-X.X.X/windowsexe/compile.batを実行する。 47 | 48 | 49 | 3. 生成されたサンプルの実行ファイルを動かす。 50 | 51 | urg-library-X.X.X/windowsexeに生成されるexeを実行する。 52 | 53 | 54 | 4. 生成されたサンプルの実行ファイルを削除する。 55 | 56 | urg-library-X.X.X/windowsexe/cleanobj.batを実行し 57 | 生成された実行ファイルを削除する。 58 | 59 | 60 | gcc (Linux, MinGW) 61 | 62 | 必要ならば urg_library-X.X.X/Makefile の PREFIX を編集して 63 | インストール先を変更します。 64 | 65 | !!! 現状こうなっているので、他の場所にしたければ、変更して下さい。 66 | PREFIX = /usr/local 67 | #PREFIX = /mingw 68 | 69 | コンパイルとインストールを行います。 70 | 71 | % make 72 | # make install 73 | 74 | ライブラリの使い方は、urg-library-X.X.X/samples/ 中の Makefile をご覧下さい。 75 | 76 | !!! ライブラリの使い方は、もう少しちゃんと書きたい。 77 | -------------------------------------------------------------------------------- /Releasenotes.txt: -------------------------------------------------------------------------------- 1 | 2025-09-30 2 | * 1.2.8 released. 3 | * All license notices have been changed to the simplified BSD license. 4 | 5 | 2022-09-02 6 | * 1.2.7 released. 7 | * Added vs2019 project. 8 | * Added the feature which can change to ignore check sum error. 9 | * Fixed the feature which ignores SIGPIPE when executed send function. 10 | 11 | 2022-06-22 12 | * 1.2.6 released. 13 | * Added get_distance_io and get_distance_intensity_io functions. 14 | * Added get_distance_io and get_distance_intensity_io samples for VS2017. 15 | * Fixed urg_is_stable function. 16 | 17 | 2019-10-29 18 | * 1.2.5 released. 19 | * Added urg_t_initialize function. 20 | * Fixed sync_time_stamp sample. 21 | 22 | 2019-08-20 23 | * 1.2.4 released. 24 | * Fixed get_sensor_time_stamp to support timestamp offset. 25 | * Changed is_open to return urg.is_active. 26 | * Added handshake samples. 27 | 28 | 2018-06-01 29 | * 1.2.3 released. 30 | * Added x64 setting on VS2010. 31 | * Added VS2015, VS2017 solution. 32 | * Changed startup project of VS solution from urg to get_distance. 33 | 34 | 2017-11-27 35 | * 1.2.2 released. 36 | * Fixed bugs on angle calculating function. 37 | 38 | 2017-9-27 39 | * 1.2.1 released. 40 | * Fixed bugs on angle calculating function (calculating incorrectly when using grouping). 41 | * Fixed bugs on function that informs you whether the sensor is stable or not in urg_sensor.c. 42 | 43 | 2015-10-21 44 | * 1.2.0 released. 45 | * Fixed bugs on serial communication. 46 | * Fixed bugs on urg_sensor_state in urg_sensor.c. 47 | 48 | 2015-05-07 49 | * 1.1.9 released. 50 | * Added the files with translation macros. 51 | * Fixed bugs on doxygen examples. 52 | * Fixed the split_comment.rb Ruby script. 53 | * Fixed bugs on urg_open in urg_sensor.c. 54 | * Fixed compile error of viewer_sdl. 55 | 56 | 2015-01-08 57 | * Fixed link error on MinGW. 58 | 59 | 2014-09-10 60 | * 1.1.8 released. 61 | * To enable ringbuffer and serial port finder with C++. 62 | 63 | 2014-08-27 64 | * 1.1.7 released. 65 | * Changed argument for start_measurement 0 to URG_SCAN_INFINITY on sample. 66 | 67 | 2014-07-17 68 | * 1.1.6 released. 69 | * Fixed compile error on Mac OS. 70 | 71 | 2014-06-05 72 | * 1.1.5 released. 73 | * Added include on "urg_serial_linux.c" 74 | 75 | 2014-05-19 76 | * 1.1.4 released. 77 | * Fixed sample code crashed when cannot receive data. 78 | 79 | 2013-09-05 80 | * 1.1.3 released. 81 | * Changed serial communication setting to handle UST sensor. 82 | 83 | 2013-08-26 84 | * 1.1.2 released. 85 | * Changed to make dynamic library. 86 | * Fixed link error on Linux. 87 | 88 | 2013-07-16 89 | * 1.1.1 released. 90 | * Fixed SCIP 1.1 sensor problem. 91 | 92 | 2013-06-25 93 | * 1.1.0 released. 94 | * Added C++ Wrapper. 95 | * Added Visual Studio 2010 project. 96 | 97 | 2012-02-21 98 | * 1.0.4 released. 99 | * Fixed ethernet open problem. 100 | * Fixed laser off fail when "urg_close()" function has called. 101 | 102 | 2012-01-31 103 | * 1.0.3 released. 104 | * Fixed Macintosh implementation to work. (reported Adrian Boeing) 105 | -------------------------------------------------------------------------------- /current/COPYRIGHT.txt: -------------------------------------------------------------------------------- 1 | Copyright (c) 2010 urg network project All rights reserved. 2 | 3 | Redistribution and use in source and binary forms, with or without 4 | modification, are permitted provided that the following conditions 5 | are met: 6 | 1. Redistributions of source code must retain the above copyright 7 | notice, this list of conditions and the following disclaimer. 8 | 2. Redistributions in binary form must reproduce the above copyright 9 | notice, this list of conditions and the following disclaimer in the 10 | documentation and/or other materials provided with the distribution. 11 | 12 | THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND 13 | ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 14 | IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 15 | ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE 16 | FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 17 | DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 18 | OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 19 | HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 20 | LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 21 | OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 22 | SUCH DAMAGE. 23 | -------------------------------------------------------------------------------- /current/Install.txt: -------------------------------------------------------------------------------- 1 | Description for install. 2 | -------------------------------------------------------------------------------- /current/Makefile: -------------------------------------------------------------------------------- 1 | # Makefile for urgwidget 2 | 3 | OUTPUT_HTML_DIR = html 4 | OUTPUT_HTML_JA_DIR = html_ja 5 | 6 | all : 7 | cd src/ && $(MAKE) 8 | cd samples/ && $(MAKE) 9 | 10 | clean : 11 | $(RM) -rf html html_ja $(OUTPUT_HTML_DIR) $(OUTPUT_HTML_JA_DIR) 12 | cd src/ && $(MAKE) clean 13 | cd samples/ && $(MAKE) clean 14 | -cd viewers/ && $(MAKE) clean 15 | cd dox/ && $(MAKE) clean 16 | 17 | html : 18 | cd dox/ && $(MAKE) img 19 | doxygen Doxyfile_ja 20 | cp COPYRIGHT.txt $(OUTPUT_HTML_JA_DIR) 21 | doxygen Doxyfile 22 | cp COPYRIGHT.txt $(OUTPUT_HTML_DIR) 23 | 24 | .PHONY : all clean html 25 | ###################################################################### 26 | -------------------------------------------------------------------------------- /current/Makefile.release: -------------------------------------------------------------------------------- 1 | PREFIX = /usr/local 2 | #PREFIX = /mingw 3 | 4 | include build_rule.mk 5 | 6 | CONFIG_FILE = urg_c-config 7 | CONFIG_FILE_CPP = urg_cpp-config 8 | INCLUDE_DIR_C = $(PREFIX)/include/urg_c/ 9 | INCLUDE_DIR_CPP = $(PREFIX)/include/urg_cpp/ 10 | URGLIB_C_STATIC = liburg_c.a 11 | URGLIB_C_SHARED = $(shell if test `echo $(OS) | grep Windows`; then echo "urg_c.dll"; else echo "liburg_c.so"; fi) 12 | URGLIB_CPP_STATIC = liburg_cpp.a 13 | URGLIB_CPP_SHARED = $(shell if test `echo $(OS) | grep Windows`; then echo "urg_cpp.dll"; else echo "liburg_cpp.so"; fi) 14 | S_PREFIX = $(shell echo "$(PREFIX)" | sed "s/\//\\\\\\\\\//g") 15 | S_LIBS = $(shell if test `echo $(OS) | grep Windows`; then echo "-lwsock32 -lsetupapi"; else if test `echo $(OS) | grep Mac`; then echo ""; else echo "-lrt"; fi; fi) 16 | all : $(CONFIG_FILE) $(CONFIG_FILE_CPP) 17 | cd src/ && $(MAKE) 18 | cd samples/ && $(MAKE) 19 | 20 | clean : 21 | $(RM) $(CONFIG_FILE) 22 | $(RM) $(CONFIG_FILE_CPP) 23 | cd src/ && $(MAKE) clean 24 | cd samples/ && $(MAKE) clean 25 | 26 | install : all 27 | install -d $(INCLUDE_DIR_C) 28 | install -d $(INCLUDE_DIR_CPP) 29 | install -m 644 include/c/*.h $(INCLUDE_DIR_C) 30 | install -m 644 include/cpp/*.h $(INCLUDE_DIR_CPP) 31 | install -d $(PREFIX)/lib/ 32 | install -m 644 src/$(URGLIB_C_STATIC) $(PREFIX)/lib/ 33 | install -m 644 src/$(URGLIB_C_SHARED) $(PREFIX)/lib/ 34 | install -m 644 src/$(URGLIB_CPP_STATIC) $(PREFIX)/lib/ 35 | install -m 644 src/$(URGLIB_CPP_SHARED) $(PREFIX)/lib/ 36 | install -d $(PREFIX)/bin/ 37 | install -m 755 $(CONFIG_FILE) $(PREFIX)/bin/ 38 | install -m 755 $(CONFIG_FILE_CPP) $(PREFIX)/bin/ 39 | 40 | uninstall : 41 | $(RM) -r $(INCLUDE_DIR_C) 42 | $(RM) -r $(INCLUDE_DIR_CPP) 43 | $(RM) $(PREFIX)/lib/$(URGLIB_C_STATIC) 44 | $(RM) $(PREFIX)/lib/$(URGLIB_C_SHARED) 45 | $(RM) $(PREFIX)/lib/$(URGLIB_CPP_STATIC) 46 | $(RM) $(PREFIX)/lib/$(URGLIB_CPP_SHARED) 47 | $(RM) $(PREFIX)/bin/$(CONFIG_FILE) 48 | $(RM) $(PREFIX)/bin/$(CONFIG_FILE_CPP) 49 | 50 | $(CONFIG_FILE) : $(CONFIG_FILE).in Makefile 51 | cat $(CONFIG_FILE).in | sed "s/PREFIX/$(S_PREFIX)/g" | sed "s/LIBS/$(S_LIBS)/g" > $(CONFIG_FILE) 52 | $(CONFIG_FILE_CPP) : $(CONFIG_FILE_CPP).in Makefile 53 | cat $(CONFIG_FILE_CPP).in | sed "s/PREFIX/$(S_PREFIX)/g" | sed "s/LIBS/$(S_LIBS)/g" > $(CONFIG_FILE_CPP) 54 | -------------------------------------------------------------------------------- /current/build_rule.mk: -------------------------------------------------------------------------------- 1 | ARCH = 2 | CC = $(ARCH)gcc 3 | CXX = $(ARCH)g++ 4 | AS = $(ARCH)as 5 | LD = $(ARCH)ld 6 | AR = $(ARCH)ar 7 | OBJ_COPY = $(ARCH)objcopy 8 | OBJ_DUMP = $(ARCH)objdump 9 | -------------------------------------------------------------------------------- /current/dox/Makefile: -------------------------------------------------------------------------------- 1 | # current/dox 2 | 3 | CFLAGS = -g -O0 -Wall -Werror -W `urg_c-config --cflags` 4 | LDFLAGS = 5 | LDLIBS = `urg_c-config --libs` -lm 6 | 7 | 8 | TARGET = \ 9 | connect_and_get \ 10 | connect_ethernet \ 11 | get_scans \ 12 | get_timestamp \ 13 | set_parameter \ 14 | convert_xy \ 15 | 16 | IMAGE_TARGET = \ 17 | multiecho_image.png \ 18 | sensor_angle_image.png \ 19 | sensor_index_image.png \ 20 | sensor_step_image.png \ 21 | skip_scan_image.png \ 22 | 23 | all : $(TARGET) img 24 | cd ../ && $(MAKE) html 25 | 26 | img : $(IMAGE_TARGET) 27 | 28 | clean : 29 | $(RM) $(TARGET) $(IMAGE_TARGET) 30 | 31 | .PHONY : all clean 32 | ###################################################################### 33 | .SUFFIXES: .png .svg 34 | .svg.png: 35 | convert $< $@ 36 | -------------------------------------------------------------------------------- /current/dox/connect_and_get.c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/UrgNetwork/urg_library/c10c1dc78328feb5d62a0a8a1a3c2f87a253307a/current/dox/connect_and_get.c -------------------------------------------------------------------------------- /current/dox/connect_ethernet.c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/UrgNetwork/urg_library/c10c1dc78328feb5d62a0a8a1a3c2f87a253307a/current/dox/connect_ethernet.c -------------------------------------------------------------------------------- /current/dox/convert_xy.c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/UrgNetwork/urg_library/c10c1dc78328feb5d62a0a8a1a3c2f87a253307a/current/dox/convert_xy.c -------------------------------------------------------------------------------- /current/dox/get_scans.c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/UrgNetwork/urg_library/c10c1dc78328feb5d62a0a8a1a3c2f87a253307a/current/dox/get_scans.c -------------------------------------------------------------------------------- /current/dox/get_timestamp.c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/UrgNetwork/urg_library/c10c1dc78328feb5d62a0a8a1a3c2f87a253307a/current/dox/get_timestamp.c -------------------------------------------------------------------------------- /current/dox/library_sample.dox: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/UrgNetwork/urg_library/c10c1dc78328feb5d62a0a8a1a3c2f87a253307a/current/dox/library_sample.dox -------------------------------------------------------------------------------- /current/dox/library_tutorial.dox: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/UrgNetwork/urg_library/c10c1dc78328feb5d62a0a8a1a3c2f87a253307a/current/dox/library_tutorial.dox -------------------------------------------------------------------------------- /current/dox/mainpage.dox: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/UrgNetwork/urg_library/c10c1dc78328feb5d62a0a8a1a3c2f87a253307a/current/dox/mainpage.dox -------------------------------------------------------------------------------- /current/dox/multiecho_image.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 18 | 20 | 27 | 28 | 46 | 53 | 54 | 56 | 57 | 59 | image/svg+xml 60 | 62 | 63 | 64 | 65 | 66 | 71 | 75 | 82 | 89 | 99 | sensor 110 | object 121 | object 132 | 140 | 141 | 142 | -------------------------------------------------------------------------------- /current/dox/set_parameter.c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/UrgNetwork/urg_library/c10c1dc78328feb5d62a0a8a1a3c2f87a253307a/current/dox/set_parameter.c -------------------------------------------------------------------------------- /current/dox/usage_gcc.dox: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/UrgNetwork/urg_library/c10c1dc78328feb5d62a0a8a1a3c2f87a253307a/current/dox/usage_gcc.dox -------------------------------------------------------------------------------- /current/dox/usage_windows_bat.dox: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/UrgNetwork/urg_library/c10c1dc78328feb5d62a0a8a1a3c2f87a253307a/current/dox/usage_windows_bat.dox -------------------------------------------------------------------------------- /current/dox/usage_windows_vcproj.dox: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/UrgNetwork/urg_library/c10c1dc78328feb5d62a0a8a1a3c2f87a253307a/current/dox/usage_windows_vcproj.dox -------------------------------------------------------------------------------- /current/include/c/urg_connection.h: -------------------------------------------------------------------------------- 1 | #ifndef URG_CONNECTION_H 2 | #define URG_CONNECTION_H 3 | 4 | /*! 5 | \file 6 | \~japanese 7 | \brief 通信の処理 8 | \~english 9 | \brief Process communications 10 | \~ 11 | \author Satofumi KAMIMURA 12 | 13 | $Id$ 14 | */ 15 | 16 | #ifdef __cplusplus 17 | extern "C" { 18 | #endif 19 | 20 | #include "urg_serial.h" 21 | #include "urg_tcpclient.h" 22 | 23 | 24 | /*! 25 | \~japanese 26 | \brief 定数定義 27 | \~english 28 | \brief Defines constants 29 | */ 30 | enum { 31 | URG_CONNECTION_TIMEOUT = -1, //!< \~japanese タイムアウトが発生したときの戻り値 \~english Return value in case of timeout 32 | }; 33 | 34 | 35 | /*! 36 | \~japanese 37 | \brief 通信タイプ 38 | \~english 39 | \brief Connection type 40 | */ 41 | typedef enum { 42 | URG_SERIAL, //!< \~japanese シリアル, USB 接続 \~english Serial/USB connection 43 | URG_ETHERNET, //!< \~japanese イーサーネット接続 \~english Ethernet connection 44 | } urg_connection_type_t; 45 | 46 | 47 | /*! 48 | \~japanese 49 | \brief 通信リソース 50 | \~english 51 | \brief Connection resources 52 | */ 53 | typedef struct 54 | { 55 | urg_connection_type_t type; //!< \~japanese 接続タイプ \~english Type of connection 56 | urg_serial_t serial; //!< \~japanese シリアル接続 \~english Serial connection 57 | urg_tcpclient_t tcpclient; //!< \~japanese イーサーネット接続 \~english Ethernet connection 58 | } urg_connection_t; 59 | 60 | 61 | /*! 62 | \~japanese 63 | \brief 接続 64 | 65 | 指定されたデバイスに接続する。 66 | 67 | \param[in,out] connection 通信リソース 68 | \param[in] connection_type 接続タイプ 69 | \param[in] device 接続名 70 | \param[in] baudrate_or_port ボーレート / ポート番号 71 | 72 | \retval 0 正常 73 | \retval <0 エラー 74 | 75 | connection_type には 76 | 77 | - URG_SERIAL ... シリアル通信 78 | - URG_ETHERNET .. イーサーネット通信 79 | 80 | を指定する。 81 | 82 | device, baudrate_or_port の指定は connection_type により指定できる値が異なる。 83 | 例えば、シリアル通信の場合は以下のようになる。 84 | 85 | \~english 86 | \brief Connection 87 | 88 | Connects to the specified device 89 | 90 | \param[in,out] connection Connection resource 91 | \param[in] connection_type Connection type 92 | \param[in] device Device name 93 | \param[in] baudrate_or_port Baudrate or port number 94 | 95 | \retval 0 Success 96 | \retval <0 Error 97 | 98 | The connection_type is either of: 99 | 100 | - URG_SERIAL ... Serial connection 101 | - URG_ETHERNET .. Ethernet connection 102 | 103 | device and baudrate_or_port arguments are defined according to connection_type 104 | For example, in case of serial connection: 105 | 106 | \~ 107 | Example 108 | \code 109 | connection_t connection; 110 | if (! connection_open(&connection, URG_SERIAL, "COM1", 115200)) { 111 | return 1; 112 | } \endcode 113 | 114 | And, in case of ethernet connection: 115 | 116 | \~ 117 | Example 118 | \code 119 | connection_t connection; 120 | if (! connection_open(&connection, URG_ETHERNET, "192.168.0.10", 10940)) { 121 | return 1; 122 | } \endcode 123 | 124 | \~ 125 | \see connection_close() 126 | */ 127 | extern int connection_open(urg_connection_t *connection, 128 | urg_connection_type_t connection_type, 129 | const char *device, long baudrate_or_port); 130 | 131 | 132 | /*! 133 | \~japanese 134 | \brief 切断 135 | 136 | デバイスとの接続を切断する。 137 | 138 | \param[in,out] connection 通信リソース 139 | \~english 140 | \brief Disconnection 141 | 142 | Closes the connection with the device 143 | 144 | \param[in,out] connection Connection resource 145 | \~ 146 | \code 147 | connection_close(&connection); \endcode 148 | \~ 149 | \see connection_open() 150 | */ 151 | extern void connection_close(urg_connection_t *connection); 152 | 153 | 154 | /*! 155 | \~japanese 156 | \brief ボーレートを設定する 157 | \~english 158 | \brief Configures the baudrate 159 | */ 160 | extern int connection_set_baudrate(urg_connection_t *connection, long baudrate); 161 | 162 | 163 | /*! 164 | \~japanese 165 | \brief 送信 166 | 167 | データを送信する。 168 | 169 | \param[in,out] connection 通信リソース 170 | \param[in] data 送信データ 171 | \param[in] size 送信バイト数 172 | 173 | \retval >=0 送信データ数 174 | \retval <0 エラー 175 | 176 | \~english 177 | \brief Send 178 | 179 | Writes data over the communication channel 180 | 181 | \param[in,out] connection Connection resource 182 | \param[in] data Data to send 183 | \param[in] size Number of bytes to send 184 | 185 | \retval >=0 Number of bytes sent 186 | \retval <0 Error 187 | \~ 188 | Example 189 | \code 190 | n = connection_write(&connection, "QT\n", 3); \endcode 191 | 192 | \~ 193 | \see connection_read(), connection_readline() 194 | */ 195 | extern int connection_write(urg_connection_t *connection, 196 | const char *data, int size); 197 | 198 | 199 | /*! 200 | \~japanese 201 | \brief 受信 202 | 203 | データを受信する。 204 | 205 | \param[in,out] connection 通信リソース 206 | \param[in] data 受信データを格納するバッファ 207 | \param[in] max_size 受信データを格納できるバイト数 208 | \param[in] timeout タイムアウト時間 [msec] 209 | 210 | \retval >=0 受信データ数 211 | \retval <0 エラー 212 | 213 | timeout に負の値を指定した場合、タイムアウトは発生しない。 214 | 215 | 1 文字も受信しなかったときは #URG_CONNECTION_TIMEOUT を返す。 216 | 217 | \~english 218 | \brief Receive 219 | 220 | Reads data from the communication channel 221 | 222 | \param[in,out] connection Connection resource 223 | \param[in] data Buffer to store received data 224 | \param[in] max_size Maximum size of the buffer 225 | \param[in] timeout Timeout [msec] 226 | 227 | \retval >=0 Number of bytes received 228 | \retval <0 Error 229 | 230 | If timeout argument is negative then the function waits until some data is received 231 | 232 | In case no data is received #URG_CONNECTION_TIMEOUT is returned. 233 | \~ 234 | Example 235 | \code 236 | enum { 237 | BUFFER_SIZE = 256, 238 | TIMEOUT_MSEC = 1000, 239 | }; 240 | char buffer[BUFFER_SIZE]; 241 | n = connection_read(&connection, buffer, BUFFER_SIZE, TIMEOUT_MSEC); \endcode 242 | 243 | \~ 244 | \see connection_write(), connection_readline() 245 | */ 246 | extern int connection_read(urg_connection_t *connection, 247 | char *data, int max_size, int timeout); 248 | 249 | 250 | /*! 251 | \~japanese 252 | \brief 改行文字までの受信 253 | 254 | 改行文字までのデータを受信する。 255 | 256 | \param[in,out] connection 通信リソース 257 | \param[in] data 受信データを格納するバッファ 258 | \param[in] max_size 受信データを格納できるバイト数 259 | \param[in] timeout タイムアウト時間 [msec] 260 | 261 | \retval >=0 受信データ数 262 | \retval <0 エラー 263 | 264 | data には、'\\0' 終端された文字列が max_size を越えないバイト数だけ格納される。 つまり、受信できる文字のバイト数は、最大で max_size - 1 となる。 265 | 266 | 改行文字は '\\r' または '\\n' とする。 267 | 268 | 受信した最初の文字が改行の場合は、0 を返し、1 文字も受信しなかったときは #URG_CONNECTION_TIMEOUT を返す。 269 | 270 | \~english 271 | \brief Receive until end-of-line 272 | 273 | Reads data until the end-of-line character is detected. 274 | 275 | \param[in,out] connection Connection resource 276 | \param[in] data Buffer to store received data 277 | \param[in] max_size Maximum size of the buffer 278 | \param[in] timeout Timeout [msec] 279 | 280 | \retval >=0 Number of bytes received 281 | \retval <0 Error 282 | 283 | If timeout argument is negative then the function waits until some data is received 284 | 285 | The null terminator character '\\0' is used at the end of data so that the number of bytes does not exceed max_size. 286 | This is, the maximum number of received characters is max_size - 1. 287 | 288 | The end-of-line character is either '\\r' or '\\n' 289 | 290 | In case no end-of-line is received then returns 0, if no data is received #URG_CONNECTION_TIMEOUT is returned. 291 | \~ 292 | \see connection_write(), connection_read() 293 | */ 294 | extern int connection_readline(urg_connection_t *connection, 295 | char *data, int max_size, int timeout); 296 | 297 | #ifdef __cplusplus 298 | } 299 | #endif 300 | 301 | #endif /* !URG_CONNECTION_H */ 302 | -------------------------------------------------------------------------------- /current/include/c/urg_debug.h: -------------------------------------------------------------------------------- 1 | #ifndef URG_DEBUG_H 2 | #define URG_DEBUG_H 3 | 4 | /*! 5 | \file 6 | \brief URG debugging functions 7 | 8 | \author Satofumi KAMIMURA 9 | 10 | \~japanese 11 | \attention 使う必要はありません。 12 | 13 | \~english 14 | \attention It is not necessary to use these functions. 15 | 16 | $Id$ 17 | */ 18 | 19 | #ifdef __cplusplus 20 | extern "C" { 21 | #endif 22 | 23 | #include "urg_sensor.h" 24 | 25 | 26 | /*! 27 | \~japanese 28 | \brief センサにデータを直接送信する 29 | \~english 30 | \brief Directly send raw data to the sensor 31 | */ 32 | extern int urg_raw_write(urg_t *urg, const char *data, int data_size); 33 | 34 | 35 | /*! 36 | \~japanese 37 | \brief センサからデータを直接受信する 38 | \~english 39 | \brief Directly get raw data from the sensor 40 | */ 41 | extern int urg_raw_read(urg_t *urg, char *data, int max_data_size, 42 | int timeout); 43 | 44 | /*! 45 | \~japanese 46 | \brief センサから改行までのデータを直接受信する 47 | \~english 48 | \brief Directly get raw data from the sensor until end-of-line 49 | */ 50 | extern int urg_raw_readline(urg_t *urg,char *data, int max_data_size, 51 | int timeout); 52 | 53 | #ifdef __cplusplus 54 | } 55 | #endif 56 | 57 | #endif /* !URG_DEBUG_H */ 58 | -------------------------------------------------------------------------------- /current/include/c/urg_detect_os.h: -------------------------------------------------------------------------------- 1 | #ifndef URG_DETECT_OS_H 2 | #define URG_DETECT_OS_H 3 | 4 | /*! 5 | \file 6 | \~japanese 7 | \brief OS の検出 8 | \~english 9 | \brief Detects the current OS 10 | \~ 11 | \author Satofumi KAMIMURA 12 | 13 | $Id$ 14 | */ 15 | 16 | #if defined(_WIN32) 17 | #define URG_WINDOWS_OS 18 | 19 | #if defined(_MSC_VER) || defined(__BORLANDC__) 20 | #define URG_MSC 21 | #endif 22 | 23 | #elif defined(__linux__) 24 | #define URG_LINUX_OS 25 | 26 | #else 27 | // \~japanese 検出できないときを、Mac 扱いにしてしまう 28 | // \~english If cannot detect the OS, assumes it is a Mac 29 | #define URG_MAC_OS 30 | #endif 31 | 32 | #endif /* !URG_DETECT_OS_H */ 33 | -------------------------------------------------------------------------------- /current/include/c/urg_errno.h: -------------------------------------------------------------------------------- 1 | #ifndef URG_ERRNO_H 2 | #define URG_ERRNO_H 3 | 4 | /*! 5 | \file 6 | \~japanese 7 | \brief URG ライブラリのエラー定義 8 | \~english 9 | \brief Definition of error codes of URG library 10 | \~ 11 | \author Satofumi KAMIMURA 12 | 13 | $Id$ 14 | */ 15 | 16 | enum { 17 | URG_NO_ERROR = 0, 18 | URG_UNKNOWN_ERROR = -1, 19 | URG_NOT_CONNECTED = -2, 20 | URG_NOT_IMPLEMENTED = -3, 21 | URG_INVALID_RESPONSE = -4, 22 | URG_NO_RESPONSE = -5, 23 | 24 | URG_SEND_ERROR = -6, 25 | URG_RECEIVE_ERROR = -7, 26 | URG_CHECKSUM_ERROR = -8, 27 | URG_INVALID_PARAMETER = -9, 28 | URG_MEASUREMENT_TYPE_MISMATCH = -10, 29 | URG_COMMON_ERROR_LAST, 30 | 31 | URG_SERIAL_OPEN_ERROR = (URG_COMMON_ERROR_LAST -1) -1, 32 | URG_NOT_DETECT_BAUDRATE_ERROR = (URG_COMMON_ERROR_LAST -1) -2, 33 | URG_ETHERNET_OPEN_ERROR = (URG_COMMON_ERROR_LAST -1) -3, 34 | URG_SCANNING_PARAMETER_ERROR = (URG_COMMON_ERROR_LAST -1) -4, 35 | URG_DATA_SIZE_PARAMETER_ERROR = (URG_COMMON_ERROR_LAST -1) -5, 36 | }; 37 | 38 | #endif /* !URG_ERRNO_H */ 39 | -------------------------------------------------------------------------------- /current/include/c/urg_ring_buffer.h: -------------------------------------------------------------------------------- 1 | #ifndef URG_RING_BUFFER_H 2 | #define URG_RING_BUFFER_H 3 | 4 | /*! 5 | \file 6 | \~japanese 7 | \brief リングバッファ 8 | \~english 9 | \brief Ring buffer functions 10 | \~ 11 | \author Satofumi KAMIMURA 12 | 13 | $Id$ 14 | */ 15 | 16 | 17 | //! \~japanese リングバッファの管理情報 \~english Control structure of the ring buffer 18 | typedef struct 19 | { 20 | char *buffer; //!< \~japanese バッファへのポインタ \~english Pointer to the data buffer 21 | int buffer_size; //!< \~japanese バッファサイズ \~english Buffer size 22 | int first; //!< \~japanese バッファの先頭位置 \~english Index of the first entry of the buffer 23 | int last; //!< \~japanese バッファの最終位置 \~english Index of the last entry of the buffer 24 | } ring_buffer_t; 25 | 26 | 27 | /*! 28 | \~japanese 29 | \brief 初期化 30 | 31 | \param[in] ring リングバッファの構造体 32 | \param[in] buffer 割り当てるバッファ 33 | \param[in] shift_length バッファサイズの 2 の乗数 34 | 35 | \~english 36 | \brief Initialization 37 | 38 | \param[in] ring Pointer to the ring buffer data structure 39 | \param[in] buffer Actual buffer to use 40 | \param[in] shift_length Buffer size as multiple of 2 41 | */ 42 | extern void ring_initialize(ring_buffer_t *ring, 43 | char *buffer, const int shift_length); 44 | 45 | 46 | /*! 47 | \~japanese 48 | \brief リングバッファのクリア 49 | 50 | \param[in] ring リングバッファの構造体 51 | 52 | \~english 53 | \brief Clears the ring buffer 54 | 55 | \param[in] ring Pointer to the ring buffer data structure 56 | */ 57 | extern void ring_clear(ring_buffer_t *ring); 58 | 59 | 60 | /*! 61 | \~japanese 62 | \brief 格納データ数を返す 63 | 64 | \param[in] ring リングバッファの構造体 65 | 66 | \~english 67 | \brief Returns the number of elements on the buffer 68 | 69 | \param[in] ring Pointer to the ring buffer data structure 70 | */ 71 | extern int ring_size(const ring_buffer_t *ring); 72 | 73 | 74 | /*! 75 | \~japanese 76 | \brief 最大の格納データ数を返す 77 | 78 | \param[in] ring リングバッファの構造体 79 | 80 | \~english 81 | \brief Returns the maximum number of elements of the ring buffer 82 | 83 | \param[in] ring Pointer to the ring buffer data structure 84 | */ 85 | extern int ring_capacity(const ring_buffer_t *ring); 86 | 87 | 88 | /*! 89 | \~japanese 90 | \brief データの格納 91 | 92 | \param[in] ring リングバッファの構造体 93 | \param[in] data データ 94 | \param[in] size データサイズ 95 | 96 | \return 格納したデータ数 97 | 98 | \~english 99 | \brief Stores data on the ring buffer 100 | 101 | \param[in] ring Pointer to the ring buffer data structure 102 | \param[in] data Data to store 103 | \param[in] size Number of elements to store 104 | 105 | \return The number of elements written to the ring buffer 106 | */ 107 | extern int ring_write(ring_buffer_t *ring, const char *data, int size); 108 | 109 | 110 | /*! 111 | \~japanese 112 | \brief データの取り出し 113 | 114 | \param[in] ring リングバッファの構造体 115 | \param[out] buffer データ 116 | \param[in] size 最大のデータサイズ 117 | 118 | \return 取り出したデータ数 119 | 120 | \~english 121 | \brief Extracts data from the ring buffer 122 | 123 | \param[in] ring Pointer to the ring buffer data structure 124 | \param[out] buffer Buffer to hold the extracted data 125 | \param[in] size Maximum size of the buffer 126 | 127 | \return The number of elements read from the ring buffer 128 | */ 129 | extern int ring_read(ring_buffer_t *ring, char *buffer, int size); 130 | 131 | #endif /* ! RING_BUFFER_H */ 132 | -------------------------------------------------------------------------------- /current/include/c/urg_serial.h: -------------------------------------------------------------------------------- 1 | #ifndef URG_SERIAL_H 2 | #define URG_SERIAL_H 3 | 4 | /*! 5 | \file 6 | \~japanese 7 | \brief シリアル通信 8 | \~english 9 | \brief Serial communications 10 | \~ 11 | \author Satofumi KAMIMURA 12 | 13 | $Id$ 14 | */ 15 | 16 | #ifdef __cplusplus 17 | extern "C" { 18 | #endif 19 | 20 | #include "urg_detect_os.h" 21 | 22 | #if defined(URG_WINDOWS_OS) 23 | #include 24 | #else 25 | #include 26 | #endif 27 | #include "urg_ring_buffer.h" 28 | 29 | 30 | enum { 31 | RING_BUFFER_SIZE_SHIFT = 7, 32 | RING_BUFFER_SIZE = 1 << RING_BUFFER_SIZE_SHIFT, 33 | 34 | ERROR_MESSAGE_SIZE = 256, 35 | }; 36 | 37 | 38 | //! \~japanese シリアル通信用 \~english Control information for serial connection 39 | typedef struct 40 | { 41 | #if defined(URG_WINDOWS_OS) 42 | HANDLE hCom; //!< \~japanese 接続リソース \~english Connection resource 43 | int current_timeout; //!< \~japanese タイムアウトの設定時間 [msec] \~english Timeout configuration value 44 | #else 45 | int fd; //!< \~japanese ファイルディスクリプタ \~english File descriptor 46 | struct termios sio; //!< \~japanese 通信設定 \~english Connection configuration 47 | #endif 48 | 49 | ring_buffer_t ring; //!< \~japanese リングバッファ \~english Ring buffer structure 50 | char buffer[RING_BUFFER_SIZE]; //!< \~japanese バッファ領域 \~english Data buffer 51 | char has_last_ch; //!< \~japanese 書き戻した文字があるかのフラグ \~english Whether the last character was received or not 52 | char last_ch; //!< \~japanese 書き戻した1文字 \~english Last character received 53 | } urg_serial_t; 54 | 55 | 56 | //! \~japanese 接続を開く \~english Opens the connection 57 | extern int serial_open(urg_serial_t *serial, const char *device, long baudrate); 58 | 59 | 60 | //! \~japanese 接続を閉じる \~english Closes the connection 61 | extern void serial_close(urg_serial_t *serial); 62 | 63 | 64 | //! \~japanese ボーレートを設定する \~english Configures the baudrate 65 | extern int serial_set_baudrate(urg_serial_t *serial, long baudrate); 66 | 67 | 68 | //! \~japanese データを送信する \~english Sends data over serial connection 69 | extern int serial_write(urg_serial_t *serial, const char *data, int size); 70 | 71 | 72 | //! \~japanese データを受信する \~english Gets data from serial connection 73 | extern int serial_read(urg_serial_t *serial, 74 | char *data, int max_size, int timeout); 75 | 76 | 77 | //! \~japanese 改行までのデータを受信する \~english Gets data from serial connection until end-of-line 78 | extern int serial_readline(urg_serial_t *serial, 79 | char *data, int max_size, int timeout); 80 | 81 | 82 | //! \~japanese エラー文字列を格納して返す \~english Stores the serial error message 83 | extern int serial_error(urg_serial_t *serial, 84 | char *error_message, int max_size); 85 | 86 | #ifdef __cplusplus 87 | } 88 | #endif 89 | 90 | #endif /* !URG_SERIAL_H */ 91 | -------------------------------------------------------------------------------- /current/include/c/urg_serial_utils.h: -------------------------------------------------------------------------------- 1 | #ifndef URG_SERIAL_UTILS_H 2 | #define URG_SERIAL_UTILS_H 3 | 4 | /*! 5 | \file 6 | \~japanese 7 | \brief シリアル用の補助関数 8 | \~english 9 | \brief Auxiliary functions for serial communications 10 | \~ 11 | \author Satofumi KAMIMURA 12 | 13 | $Id$ 14 | */ 15 | 16 | 17 | //! \~japanese シリアルポートを検索する \~english Finds the serial port 18 | extern int urg_serial_find_port(void); 19 | 20 | 21 | //! \~japanese 検索したシリアルポート名を返す \~english Returns the name of the serial port found 22 | extern const char *urg_serial_port_name(int index); 23 | 24 | 25 | /*! 26 | \~japanese 27 | \brief ポートが URG かどうか 28 | 29 | \retval 1 URG のポート 30 | \retval 0 不明 31 | \retval <0 エラー 32 | 33 | \~english 34 | \brief Checks whether the serial port corresponds to a URG or not 35 | 36 | \retval 1 It is a URG 37 | \retval 0 Unknown 38 | \retval <0 Error 39 | */ 40 | extern int urg_serial_is_urg_port(int index); 41 | 42 | #endif /* !URG_SERIAL_UTILS_H */ 43 | -------------------------------------------------------------------------------- /current/include/c/urg_tcpclient.h: -------------------------------------------------------------------------------- 1 | #ifndef URG_TCPCLIENT_H 2 | #define URG_TCPCLIENT_H 3 | 4 | /*! 5 | \file 6 | \brief TCP/IP read/write functions 7 | 8 | \author Katsumi Kimoto 9 | 10 | $Id: urg_tcpclient.h,v 1d233c7a2240 2011/02/19 03:08:45 Satofumi $ 11 | */ 12 | 13 | #ifdef __cplusplus 14 | extern "C" { 15 | #endif 16 | 17 | #include "urg_ring_buffer.h" 18 | #include "urg_detect_os.h" 19 | #include 20 | #if defined(URG_WINDOWS_OS) 21 | #include 22 | #else 23 | #include 24 | #include 25 | #include 26 | #endif 27 | 28 | 29 | // -- NOT INTERFACE, for internal use only -- 30 | // For urg_ringbuffer.h 31 | // The size of buffer must be specified by the power of 2 32 | // i.e. ring buffer size = two to the RB_BITSHIFT-th power. 33 | enum { 34 | RB_BITSHIFT = 8, 35 | RB_SIZE = 1 << RB_BITSHIFT, 36 | 37 | // caution ! available buffer size is less than the 38 | // size given to the ring buffer(RB_SIZE). 39 | BUFSIZE = RB_SIZE - 1, 40 | }; 41 | 42 | 43 | //! TCP/IP connection 44 | typedef struct { 45 | // socket 46 | struct sockaddr_in server_addr; 47 | int sock_desc; 48 | int sock_addr_size; 49 | 50 | // buffer 51 | ring_buffer_t rb; 52 | char buf[RB_SIZE]; 53 | 54 | // line reading functions 55 | int pushed_back; // for pushded back char 56 | 57 | } urg_tcpclient_t; 58 | // -- end of NON INTERFACE definitions -- 59 | 60 | 61 | // -- belows are MODULE INTERFACES -- 62 | /*! 63 | \brief constructor of tcp client module 64 | 65 | \param[in,out] cli tcp client type variable which must be allocated by a caller. 66 | \param[in] server_ip_str IP address expressed in string, i.e. "192.168.0.1" 67 | \param[in] port_num port number expressed in integer, i.e. port_num = 10200 68 | 69 | \retval 0 succeeded. 70 | \retval -1 error 71 | */ 72 | extern int tcpclient_open(urg_tcpclient_t* cli, 73 | const char* server_ip_str, int port_num); 74 | 75 | 76 | /*! 77 | \brief destructor of tcp client module 78 | 79 | \param[in,out] cli : tcp client type variable which must be deallocated by a caller after closing. 80 | */ 81 | extern void tcpclient_close(urg_tcpclient_t* cli); 82 | 83 | 84 | /*! 85 | \brief read from socket. 86 | 87 | \param[in,out] cli : tcp client type variable which must be deallocated by a caller after closing. 88 | \param[out] userbuf : buffer to store read data which must be allocated by a caller. 89 | \param[in] req_size: data size requested to read in byte. 90 | \param[in] timeout : time out specification which unit is microsecond. 91 | 92 | \return the number of data read, -1 when error. 93 | */ 94 | extern int tcpclient_read(urg_tcpclient_t* cli, 95 | char* userbuf, int req_size, int timeout); 96 | 97 | 98 | /*! 99 | \brief write to socket. 100 | 101 | \param[in,out] cli : tcp client type variable which must be deallocated by a caller after closing. 102 | \param[in] userbuf : data to write. 103 | \param[in] req_size: data size requested to write in byte. 104 | 105 | \return returns the number of data wrote, -1 when error. 106 | */ 107 | extern int tcpclient_write(urg_tcpclient_t* cli, 108 | const char* userbuf, int req_size); 109 | 110 | 111 | //! \attention not implemented yet. 112 | extern int tcpclient_error(urg_tcpclient_t* cli, 113 | char* error_message, int max_size); 114 | 115 | 116 | /*! 117 | \brief read one line from socket. 118 | 119 | \param[in,out] cli : tcp client type variable which must be deallocated by a caller after closing. 120 | \param[out] userbuf : buffer to store read data which must be allocated by a caller. 121 | \param[in] buf_size: data size requested to read in byte. 122 | \param[in] timeout : time out specification which unit is microsecond. 123 | 124 | \return the number of data read, -1 when error. 125 | */ 126 | extern int tcpclient_readline(urg_tcpclient_t* cli, 127 | char* userbuf, int buf_size, int timeout); 128 | 129 | #ifdef __cplusplus 130 | } 131 | #endif 132 | 133 | #endif /* !URG_TCPCLIENT_H */ 134 | -------------------------------------------------------------------------------- /current/include/cpp/Lidar.h: -------------------------------------------------------------------------------- 1 | #ifndef QRK_LIDAR_H 2 | #define QRK_LIDAR_H 3 | 4 | /*! 5 | \file 6 | \~japanese 7 | \brief Lidar インターフェース 8 | \~english 9 | \brief Lidar interface 10 | \~ 11 | \author Satofumi KAMIMURA 12 | 13 | $Id$ 14 | */ 15 | 16 | #include 17 | #include 18 | 19 | 20 | namespace qrk 21 | { 22 | //! \~japanese Lidar インターフェース \~english Lidar interface 23 | class Lidar 24 | { 25 | public: 26 | typedef enum { 27 | Distance, //!< \~japanese 距離 \~english Range 28 | Distance_intensity, //!< \~japanese 距離 + 強度 \~english Distance (range) and intensity (strength) 29 | Multiecho, //!< \~japanese マルチエコーの距離 \~english Multiecho distance 30 | Multiecho_intensity, //!< \~japanese マルチエコーの(距離 + 強度) \~english Multiecho distance and intensity 31 | Distance_io, //!< \~japanese 距離 + IO \~english Distance (range) and io(input/output) 32 | Distance_intensity_io, //!< \~japanese 距離 + 強度 + IO \~english Distance (range), intensity and io(input/output) 33 | } measurement_type_t; 34 | 35 | typedef enum { 36 | Serial, 37 | Ethernet, 38 | } connection_type_t; 39 | 40 | virtual ~Lidar(void) 41 | { 42 | } 43 | 44 | virtual const char* what(void) const = 0; 45 | 46 | virtual bool open(const char* device_name, long baudrate, 47 | connection_type_t type) = 0; 48 | virtual void close(void) = 0; 49 | virtual bool is_open(void) const = 0; 50 | 51 | virtual void set_timeout_msec(int msec) = 0; 52 | 53 | virtual bool laser_on(void) = 0; 54 | virtual bool laser_off(void) = 0; 55 | 56 | virtual bool reboot(void) = 0; 57 | 58 | virtual void sleep(void) = 0; 59 | virtual void wakeup(void) = 0; 60 | virtual bool is_stable(void) = 0; 61 | 62 | //! \~japanese データ取得の開始 \~english Starts data measurement process 63 | virtual bool start_measurement(measurement_type_t type, 64 | int scan_times, int skip_scan) = 0; 65 | 66 | //! \~japanese 受信データの受け取り \~english Receives measurement data 67 | virtual bool get_distance(std::vector& data, 68 | long *time_stamp) = 0; 69 | virtual bool get_distance_intensity(std::vector& data, 70 | std::vector& 71 | intensity, 72 | long *time_stamp) = 0; 73 | 74 | virtual bool get_multiecho(std::vector& data_multi, 75 | long* time_stamp) = 0; 76 | 77 | virtual bool get_multiecho_intensity(std::vector& data_multiecho, 78 | std::vector& 79 | intensity_multiecho, 80 | long* time_stamp) = 0; 81 | 82 | virtual bool set_scanning_parameter(int first_step, int last_step, 83 | int skip_step) = 0; 84 | 85 | //! \~japanese データ取得の中断 \~english Stops data measurement process 86 | virtual void stop_measurement(void) = 0; 87 | 88 | //! \~japanese タイムスタンプの同期 \~english Synchronization of timestamps 89 | virtual bool set_sensor_time_stamp(long time_stamp) = 0; 90 | 91 | //! \~japanese 角度変換 \~english Angle conversion functions 92 | virtual double index2rad(int index) const = 0; 93 | virtual double index2deg(int index) const = 0; 94 | virtual int rad2index(double radian) const = 0; 95 | virtual int deg2index(double degree) const = 0; 96 | virtual int rad2step(double radian) const = 0; 97 | virtual int deg2step(double degree) const = 0; 98 | virtual double step2rad(int step) const = 0; 99 | virtual double step2deg(int step) const = 0; 100 | virtual int step2index(int step) const = 0; 101 | 102 | virtual int min_step(void) const = 0; 103 | virtual int max_step(void) const = 0; 104 | virtual long min_distance(void) const = 0; 105 | virtual long max_distance(void) const = 0; 106 | virtual long scan_usec(void) const = 0; 107 | virtual int max_data_size(void) const = 0; 108 | virtual int max_echo_size(void) const = 0; 109 | 110 | virtual const char* product_type(void) const = 0; 111 | virtual const char* firmware_version(void) const = 0; 112 | virtual const char* serial_id(void) const = 0; 113 | virtual const char* status(void) const = 0; 114 | virtual const char* state(void) const = 0; 115 | 116 | virtual int raw_write(const char* data, size_t data_size) = 0; 117 | virtual int raw_read(char* data, size_t max_data_size, int timeout) = 0; 118 | virtual int raw_readline(char* data, size_t max_data_size, 119 | int timeout) = 0; 120 | }; 121 | } 122 | 123 | #endif /* !QRK_LIDAR_H */ 124 | -------------------------------------------------------------------------------- /current/include/cpp/Urg_driver.h: -------------------------------------------------------------------------------- 1 | #ifndef QRK_URG_DRIVER_H 2 | #define QRK_URG_DRIVER_H 3 | 4 | /*! 5 | \file 6 | \~japanese 7 | \brief URG ドライバ 8 | \~english 9 | \brief URG driver 10 | \~ 11 | \author Satofumi KAMIMURA 12 | 13 | $Id$ 14 | */ 15 | 16 | #include 17 | #include 18 | #include "Lidar.h" 19 | 20 | namespace qrk 21 | { 22 | //! \~japanese URG ドライバ \~english URG driver 23 | class Urg_driver : public Lidar 24 | { 25 | public: 26 | enum { 27 | Default_baudrate = 115200, 28 | Default_port = 10940, 29 | Infinity_times = -1, 30 | }; 31 | 32 | Urg_driver(void); 33 | virtual ~Urg_driver(void); 34 | 35 | static std::vector find_ports(void); 36 | static std::vector find_ports(std::vector& 37 | is_urg_ports); 38 | const char* what(void) const; 39 | 40 | bool open(const char* device_name, long baudrate = Default_baudrate, 41 | connection_type_t type = Serial); 42 | void close(void); 43 | bool is_open(void) const; 44 | 45 | void set_timeout_msec(int msec); 46 | 47 | bool laser_on(void); 48 | bool laser_off(void); 49 | 50 | bool reboot(void); 51 | 52 | void sleep(void); 53 | void wakeup(void); 54 | bool is_stable(void); 55 | 56 | //! \~japanese データ取得の開始 \~english Starts data measurement process 57 | bool start_measurement(measurement_type_t type = Distance, 58 | int scan_times = Infinity_times, 59 | int skip_scan = 0); 60 | 61 | void set_ignore_checkSumError(bool ignore = true); 62 | 63 | //! \~japanese 受信データの受け取り \~english Receives measurement data 64 | bool get_distance(std::vector& data, long *time_stamp = NULL); 65 | bool get_distance_intensity(std::vector& data, 66 | std::vector& intensity, 67 | long *time_stamp = NULL); 68 | 69 | bool get_distance_io(std::vector& data, std::vector& io, long *time_stamp = NULL); 70 | 71 | bool get_distance_intensity_io(std::vector& data, 72 | std::vector& intensity, 73 | std::vector& io, 74 | long *time_stamp = NULL); 75 | 76 | bool get_multiecho(std::vector& data_multi, 77 | long* time_stamp = NULL); 78 | 79 | bool get_multiecho_intensity(std::vector& data_multiecho, 80 | std::vector& 81 | intensity_multiecho, 82 | long* time_stamp = NULL); 83 | 84 | bool set_scanning_parameter(int first_step, int last_step, 85 | int skip_step = 1); 86 | 87 | //! \~japanese データ取得の中断 \~english Stops data measurement process 88 | void stop_measurement(void); 89 | 90 | //! \~japanese タイムスタンプの同期 \~english Synchronization of timestamps 91 | bool start_time_stamp_mode(void); 92 | bool stop_time_stamp_mode(void); 93 | bool set_sensor_time_stamp(long time_stamp); 94 | long get_sensor_time_stamp(void); 95 | 96 | //! \~japanese 角度変換 \~english Angle conversion functions 97 | double index2rad(int index) const; 98 | double index2deg(int index) const; 99 | int rad2index(double radian) const; 100 | int deg2index(double degree) const; 101 | int rad2step(double radian) const; 102 | int deg2step(double degree) const; 103 | double step2rad(int step) const; 104 | double step2deg(int step) const; 105 | int step2index(int step) const; 106 | 107 | int min_step(void) const; 108 | int max_step(void) const; 109 | long min_distance(void) const; 110 | long max_distance(void) const; 111 | long scan_usec(void) const; 112 | int max_data_size(void) const; 113 | int max_echo_size(void) const; 114 | int max_io_size(void) const; 115 | 116 | const char* product_type(void) const; 117 | const char* firmware_version(void) const; 118 | const char* serial_id(void) const; 119 | const char* status(void) const; 120 | const char* state(void) const; 121 | 122 | int raw_write(const char* data, size_t data_size); 123 | int raw_read(char* data, size_t max_data_size, int timeout); 124 | int raw_readline(char* data, size_t max_data_size, int timeout); 125 | void* raw_urg(void); 126 | void set_measurement_type(measurement_type_t type); 127 | 128 | private: 129 | Urg_driver(const Urg_driver& rhs); 130 | Urg_driver& operator = (const Urg_driver& rhs); 131 | 132 | struct pImpl; 133 | std::unique_ptr pimpl; 134 | }; 135 | } 136 | 137 | #endif /* !QRK_URG_DRIVER_H */ 138 | -------------------------------------------------------------------------------- /current/include/cpp/detect_os.h: -------------------------------------------------------------------------------- 1 | #ifndef QRK_DETECT_OS_H 2 | #define QRK_DETECT_OS_H 3 | 4 | /*! 5 | \file 6 | \~japanese 7 | \brief 動作OSの検出 8 | \~english 9 | \brief Detects the operating system 10 | \~ 11 | \author Satofumi KAMIMURA 12 | 13 | $Id$ 14 | */ 15 | 16 | #if defined(_WIN32) 17 | #define QRK_WINDOWS_OS 18 | 19 | #if defined(_MSC_VER) || defined(__BORLANDC__) 20 | #define QRK_MSC 21 | #elif defined __CYGWIN__ 22 | #define QRK_CYGWIN 23 | #elif defined __MINGW32__ 24 | #define QRK_MINGW 25 | #endif 26 | 27 | #elif defined __linux__ 28 | #define QRK_LINUX_OS 29 | 30 | #else 31 | // \~japanese 検出できないときを、Mac 扱いにしてしまう 32 | // \~english If cannot detect the OS, assumes it is a Mac 33 | #define QRK_MAC_OS 34 | #endif 35 | 36 | #endif /* !QRK_DETECT_OS_H */ 37 | -------------------------------------------------------------------------------- /current/include/cpp/math_utilities.h: -------------------------------------------------------------------------------- 1 | #ifndef QRK_MATH_UTILITIES_H 2 | #define QRK_MATH_UTILITIES_H 3 | 4 | /*! 5 | \file 6 | \~japanese 7 | \brief 数学関数の補助ファイル 8 | \~english 9 | \brief Auxiliary math functions 10 | \~ 11 | \author Satofumi KAMIMURA 12 | 13 | $Id$ 14 | */ 15 | 16 | #include "detect_os.h" 17 | #if defined(WINDOWS_OS) 18 | #define _USE_MATH_DEFINES 19 | #endif 20 | #include 21 | 22 | 23 | #ifndef M_PI 24 | //! \~japanese 円周率 (Visual C++ 6.0 用) 25 | //! \~english PI approximation (for Visual C++ 6.0) 26 | #define M_PI 3.14159265358979323846 27 | #endif 28 | 29 | #if defined(MSC) 30 | extern long lrint(double x); 31 | #endif 32 | 33 | #endif /* !QRK_MATH_UTILITIES_H */ 34 | -------------------------------------------------------------------------------- /current/include/cpp/ticks.h: -------------------------------------------------------------------------------- 1 | #ifndef QRK_TICKS_H 2 | #define QRK_TICKS_H 3 | 4 | /*! 5 | \file 6 | \~japanese 7 | \brief タイムスタンプの取得 8 | \~english 9 | \brief Gets timestamp values 10 | \~ 11 | \author Satofumi KAMIMURA 12 | 13 | $Id$ 14 | */ 15 | 16 | 17 | namespace qrk 18 | { 19 | long ticks(void); 20 | } 21 | 22 | #endif /* !QRK_TICKS_H */ 23 | -------------------------------------------------------------------------------- /current/samples/Makefile: -------------------------------------------------------------------------------- 1 | all : 2 | cd c/ && $(MAKE) 3 | cd cpp/ && $(MAKE) 4 | 5 | clean : 6 | cd c/ && $(MAKE) clean 7 | cd cpp/ && $(MAKE) clean 8 | 9 | .PHONY : all clean 10 | -------------------------------------------------------------------------------- /current/samples/Makefile.release: -------------------------------------------------------------------------------- 1 | TARGET = sensor_parameter get_distance get_distance_intensity get_multiecho get_multiecho_intensity sync_time_stamp calculate_xy find_port 2 | 3 | URG_LIB = ../src/liburg_c.a 4 | 5 | include ../build_rule.mk 6 | 7 | CFLAGS = -O2 $(INCLUDES) -I../include 8 | LDLIBS = -lm $(shell if test `echo $(OS) | grep Windows`; then echo "-lwsock32 -lsetupapi"; fi) 9 | 10 | all : $(TARGET) 11 | 12 | clean : 13 | $(RM) *.o $(TARGET) 14 | 15 | $(TARGET) : open_urg_sensor.o $(URG_LIB) 16 | 17 | $(URG_LIB) : 18 | cd $(@D)/ && $(MAKE) $(@F) 19 | -------------------------------------------------------------------------------- /current/samples/c/Makefile: -------------------------------------------------------------------------------- 1 | # Makefile for c/urg/samples 2 | # $Id$ 3 | 4 | # Compile options 5 | SRCDIR = ../../src 6 | INCLUDEDIR = ../../include/c 7 | CC = gcc 8 | CFLAGS = -g -O0 -Wall -Werror -W $(INCLUDES) 9 | INCLUDES = -I$(INCLUDEDIR) 10 | LDFLAGS = 11 | LDLIBS = -lm $(shell if test `echo $(OS) | grep Windows`; then echo "-lwsock32 -lsetupapi"; fi) 12 | 13 | # Target 14 | TARGET = \ 15 | get_distance \ 16 | get_distance_handshake \ 17 | get_distance_intensity \ 18 | get_multiecho \ 19 | get_multiecho_intensity \ 20 | calculate_xy \ 21 | sync_time_stamp \ 22 | sensor_parameter \ 23 | find_port \ 24 | timeout_test \ 25 | reboot_test \ 26 | angle_convert_test \ 27 | 28 | all : $(TARGET) 29 | 30 | clean : 31 | $(RM) *.o $(TARGET) *.exe 32 | 33 | depend : 34 | makedepend -Y -- $(INCLUDES) -- $(wildcard *.h *.c) 35 | 36 | .PHONY : all depend clean 37 | 38 | ###################################################################### 39 | REQUIRE_LIB = $(SRCDIR)/liburg_c.a 40 | $(REQUIRE_LIB) : $(wildcard $(SRCDIR)/*.[ch]) 41 | cd $(@D)/ && $(MAKE) $(@F) 42 | 43 | get_distance get_distance_handshake get_distance_intensity get_multiecho get_multiecho_intensity calculate_xy sync_time_stamp sensor_parameter timeout_test reboot_test angle_convert_test : open_urg_sensor.o $(REQUIRE_LIB) 44 | find_port : $(REQUIRE_LIB) 45 | -------------------------------------------------------------------------------- /current/samples/c/Makefile.release: -------------------------------------------------------------------------------- 1 | TARGET = sensor_parameter get_distance get_distance_handshake get_distance_intensity get_multiecho get_multiecho_intensity sync_time_stamp calculate_xy find_port 2 | 3 | URG_LIB = ../../src/liburg_c.a 4 | 5 | include ../../build_rule.mk 6 | 7 | CFLAGS = -O2 $(INCLUDES) -I../../include/c 8 | LDLIBS = -lm $(shell if test `echo $(OS) | grep Windows`; then echo "-lwsock32 -lsetupapi"; fi) 9 | 10 | all : $(TARGET) 11 | 12 | clean : 13 | $(RM) *.o $(TARGET) *.exe 14 | 15 | $(TARGET) : open_urg_sensor.o $(URG_LIB) 16 | 17 | $(URG_LIB) : 18 | cd $(@D)/ && $(MAKE) $(@F) 19 | -------------------------------------------------------------------------------- /current/samples/c/angle_convert_test.c: -------------------------------------------------------------------------------- 1 | /*! 2 | \~japanese 3 | \example angle_convert_test.c 角度変換の結果を表示する 4 | \~english 5 | \example angle_convert_test.c Some cases of angle conversion 6 | \~ 7 | \author Satofumi KAMIMURA 8 | 9 | $Id$ 10 | */ 11 | 12 | #include "urg_sensor.h" 13 | #include "urg_utils.h" 14 | #include "open_urg_sensor.h" 15 | #include 16 | 17 | 18 | int main(int argc, char *argv[]) 19 | { 20 | urg_t urg; 21 | int min_step; 22 | int max_step; 23 | 24 | if (open_urg_sensor(&urg, argc, argv) < 0) { 25 | return 1; 26 | } 27 | 28 | urg_step_min_max(&urg, &min_step, &max_step); 29 | 30 | printf("urg_step2deg(%d): %f\n", min_step, urg_step2deg(&urg, min_step)); 31 | printf("urg_step2deg(%d): %f\n", max_step, urg_step2deg(&urg, max_step)); 32 | 33 | printf("urg_step2rad(%d): %f\n", min_step, urg_step2rad(&urg, min_step)); 34 | printf("urg_step2rad(%d): %f\n", max_step, urg_step2rad(&urg, max_step)); 35 | 36 | return 0; 37 | } 38 | -------------------------------------------------------------------------------- /current/samples/c/calculate_xy.c: -------------------------------------------------------------------------------- 1 | /*! 2 | \~japanese 3 | \example calculate_xy.c X-Y 座標系での位置を計算する 4 | 5 | センサ前方が X 軸の方向とみなした直行座標上で、距離データを位置を出力する。 6 | 7 | \~english 8 | \example calculate_xy.c Calculates X-Y coordinates 9 | 10 | Having the X axis aligned to the front step of the sensor, calculates the coordinates for measurement data 11 | \~ 12 | \author Satofumi KAMIMURA 13 | 14 | $Id$ 15 | */ 16 | 17 | #include "urg_sensor.h" 18 | #include "urg_utils.h" 19 | #include "open_urg_sensor.h" 20 | #include 21 | #include 22 | #include 23 | 24 | 25 | int main(int argc, char *argv[]) 26 | { 27 | urg_t urg; 28 | long *data; 29 | long max_distance; 30 | long min_distance; 31 | long time_stamp; 32 | int i; 33 | int n; 34 | 35 | if (open_urg_sensor(&urg, argc, argv) < 0) { 36 | return 1; 37 | } 38 | 39 | data = (long *)malloc(urg_max_data_size(&urg) * sizeof(data[0])); 40 | if (!data) { 41 | perror("urg_max_index()"); 42 | return 1; 43 | } 44 | 45 | // \~japanese データ取得 46 | // \~english Gets measurement data 47 | urg_start_measurement(&urg, URG_DISTANCE, 1, 0, 1); 48 | n = urg_get_distance(&urg, data, &time_stamp); 49 | if (n < 0) { 50 | printf("urg_get_distance: %s\n", urg_error(&urg)); 51 | urg_close(&urg); 52 | return 1; 53 | } 54 | 55 | // \~japanese X-Y 座標系の値を出力 56 | // \~english Outputs X-Y coordinates 57 | urg_distance_min_max(&urg, &min_distance, &max_distance); 58 | for (i = 0; i < n; ++i) { 59 | long distance = data[i]; 60 | double radian; 61 | long x; 62 | long y; 63 | 64 | if ((distance < min_distance) || (distance > max_distance)) { 65 | continue; 66 | } 67 | 68 | radian = urg_index2rad(&urg, i); 69 | x = (long)(distance * cos(radian)); 70 | y = (long)(distance * sin(radian)); 71 | 72 | printf("%ld, %ld\n", x, y); 73 | } 74 | printf("\n"); 75 | 76 | // \~japanese 切断 77 | // \~english Disconnects 78 | free(data); 79 | urg_close(&urg); 80 | 81 | #if defined(URG_MSC) 82 | getchar(); 83 | #endif 84 | return 0; 85 | } 86 | -------------------------------------------------------------------------------- /current/samples/c/find_port.c: -------------------------------------------------------------------------------- 1 | /*! 2 | \~japanese 3 | \example find_port.c ポートの探索 4 | \~english 5 | \example find_port.c Finds out the port 6 | \~ 7 | \author Satofumi KAMIMURA 8 | 9 | $Id$ 10 | */ 11 | 12 | #include "urg_serial_utils.h" 13 | #include 14 | 15 | 16 | int main(void) 17 | { 18 | int found_port_size = urg_serial_find_port(); 19 | int i; 20 | 21 | if (found_port_size == 0) { 22 | printf("could not found ports.\n"); 23 | return 1; 24 | } 25 | 26 | for (i = 0; i < found_port_size; ++i) { 27 | printf("%s", urg_serial_port_name(i)); 28 | if (urg_serial_is_urg_port(i)) { 29 | printf(" [URG]"); 30 | } 31 | printf("\n"); 32 | } 33 | 34 | return 0; 35 | } 36 | -------------------------------------------------------------------------------- /current/samples/c/get_distance.c: -------------------------------------------------------------------------------- 1 | /*! 2 | \~japanese 3 | \example get_distance.c 距離データを取得する 4 | \~english 5 | \example get_distance.c Obtains distance data 6 | \~ 7 | \author Satofumi KAMIMURA 8 | 9 | $Id$ 10 | */ 11 | 12 | #include "urg_sensor.h" 13 | #include "urg_utils.h" 14 | #include "open_urg_sensor.h" 15 | #include 16 | #include 17 | 18 | 19 | static void print_data(urg_t *urg, long data[], int data_n, long time_stamp) 20 | { 21 | #if 1 22 | int front_index; 23 | 24 | (void)data_n; 25 | 26 | // \~japanese 前方のデータのみを表示 27 | // \~english Shows only the front step 28 | front_index = urg_step2index(urg, 0); 29 | printf("%ld [mm], (%ld [msec])\n", data[front_index], time_stamp); 30 | 31 | #else 32 | (void)time_stamp; 33 | 34 | int i; 35 | long min_distance; 36 | long max_distance; 37 | 38 | // \~japanese 全てのデータの X-Y の位置を表示 39 | // \~english Prints the X-Y coordinates for all the measurement points 40 | urg_distance_min_max(urg, &min_distance, &max_distance); 41 | for (i = 0; i < data_n; ++i) { 42 | long l = data[i]; 43 | double radian; 44 | long x; 45 | long y; 46 | 47 | if ((l <= min_distance) || (l >= max_distance)) { 48 | continue; 49 | } 50 | radian = urg_index2rad(urg, i); 51 | x = (long)(l * cos(radian)); 52 | y = (long)(l * sin(radian)); 53 | printf("(%ld, %ld), ", x, y); 54 | } 55 | printf("\n"); 56 | #endif 57 | } 58 | 59 | 60 | int main(int argc, char *argv[]) 61 | { 62 | enum { 63 | CAPTURE_TIMES = 10, 64 | }; 65 | urg_t urg; 66 | long *data = NULL; 67 | long time_stamp; 68 | int n; 69 | int i; 70 | 71 | if (open_urg_sensor(&urg, argc, argv) < 0) { 72 | return 1; 73 | } 74 | 75 | data = (long *)malloc(urg_max_data_size(&urg) * sizeof(data[0])); 76 | if (!data) { 77 | perror("urg_max_index()"); 78 | return 1; 79 | } 80 | 81 | // \~japanese データ取得 82 | // \~english Gets measurement data 83 | #if 0 84 | // \~japanese データの取得範囲を変更する場合 85 | // \~english Case where the measurement range (start/end steps) is defined 86 | urg_set_scanning_parameter(&urg, 87 | urg_deg2step(&urg, -90), 88 | urg_deg2step(&urg, +90), 0); 89 | #endif 90 | 91 | urg_start_measurement(&urg, URG_DISTANCE, URG_SCAN_INFINITY, 0, 1); 92 | for (i = 0; i < CAPTURE_TIMES; ++i) { 93 | n = urg_get_distance(&urg, data, &time_stamp); 94 | if (n <= 0) { 95 | printf("urg_get_distance: %s\n", urg_error(&urg)); 96 | free(data); 97 | urg_close(&urg); 98 | return 1; 99 | } 100 | print_data(&urg, data, n, time_stamp); 101 | } 102 | 103 | // \~japanese 切断 104 | // \~english Disconnects 105 | free(data); 106 | urg_close(&urg); 107 | 108 | #if defined(URG_MSC) 109 | getchar(); 110 | #endif 111 | return 0; 112 | } 113 | -------------------------------------------------------------------------------- /current/samples/c/get_distance_handshake.c: -------------------------------------------------------------------------------- 1 | /*! 2 | \~japanese 3 | \example get_distance.c 距離データを取得する 4 | \~english 5 | \example get_distance.c Obtains distance data 6 | \~ 7 | \author Satofumi KAMIMURA 8 | 9 | $Id$ 10 | */ 11 | 12 | #include "urg_sensor.h" 13 | #include "urg_utils.h" 14 | #include "open_urg_sensor.h" 15 | #include 16 | #include 17 | 18 | 19 | static void print_data(urg_t *urg, long data[], int data_n, long time_stamp) 20 | { 21 | #if 1 22 | int front_index; 23 | 24 | (void)data_n; 25 | 26 | // \~japanese 前方のデータのみを表示 27 | // \~english Shows only the front step 28 | front_index = urg_step2index(urg, 0); 29 | printf("%ld [mm], (%ld [msec])\n", data[front_index], time_stamp); 30 | 31 | #else 32 | (void)time_stamp; 33 | 34 | int i; 35 | long min_distance; 36 | long max_distance; 37 | 38 | // \~japanese 全てのデータの X-Y の位置を表示 39 | // \~english Prints the X-Y coordinates for all the measurement points 40 | urg_distance_min_max(urg, &min_distance, &max_distance); 41 | for (i = 0; i < data_n; ++i) { 42 | long l = data[i]; 43 | double radian; 44 | long x; 45 | long y; 46 | 47 | if ((l <= min_distance) || (l >= max_distance)) { 48 | continue; 49 | } 50 | radian = urg_index2rad(urg, i); 51 | x = (long)(l * cos(radian)); 52 | y = (long)(l * sin(radian)); 53 | printf("(%ld, %ld), ", x, y); 54 | } 55 | printf("\n"); 56 | #endif 57 | } 58 | 59 | 60 | int main(int argc, char *argv[]) 61 | { 62 | enum { 63 | CAPTURE_TIMES = 10, 64 | }; 65 | urg_t urg; 66 | long *data = NULL; 67 | long time_stamp; 68 | int n; 69 | int i; 70 | 71 | if (open_urg_sensor(&urg, argc, argv) < 0) { 72 | return 1; 73 | } 74 | 75 | data = (long *)malloc(urg_max_data_size(&urg) * sizeof(data[0])); 76 | if (!data) { 77 | perror("urg_max_index()"); 78 | return 1; 79 | } 80 | 81 | // \~japanese データ取得 82 | // \~english Gets measurement data 83 | #if 0 84 | // \~japanese データの取得範囲を変更する場合 85 | // \~english Case where the measurement range (start/end steps) is defined 86 | urg_set_scanning_parameter(&urg, 87 | urg_deg2step(&urg, -90), 88 | urg_deg2step(&urg, +90), 0); 89 | #endif 90 | 91 | for (i = 0; i < CAPTURE_TIMES; ++i) { 92 | urg_start_measurement(&urg, URG_DISTANCE, 1, 0 ,1); 93 | n = urg_get_distance(&urg, data, &time_stamp); 94 | if (n <= 0) { 95 | printf("urg_get_distance: %s\n", urg_error(&urg)); 96 | free(data); 97 | urg_close(&urg); 98 | return 1; 99 | } 100 | print_data(&urg, data, n, time_stamp); 101 | } 102 | 103 | // \~japanese 切断 104 | // \~english Disconnects 105 | free(data); 106 | urg_close(&urg); 107 | 108 | #if defined(URG_MSC) 109 | getchar(); 110 | #endif 111 | return 0; 112 | } 113 | -------------------------------------------------------------------------------- /current/samples/c/get_distance_intensity.c: -------------------------------------------------------------------------------- 1 | /*! 2 | \~japanese 3 | \example get_distance_intensity.c 距離・強度データを取得する 4 | \~english 5 | \example get_distance_intensity.c Obtains distance and intensity data 6 | \~ 7 | \author Satofumi KAMIMURA 8 | 9 | $Id$ 10 | */ 11 | 12 | #include "urg_sensor.h" 13 | #include "urg_utils.h" 14 | #include "open_urg_sensor.h" 15 | #include 16 | #include 17 | 18 | 19 | static void print_data(urg_t *urg, long data[], unsigned short intensity[], 20 | int data_n, long time_stamp) 21 | { 22 | #if 1 23 | int front_index; 24 | (void)data_n; 25 | 26 | // \~japanese 前方のデータのみを表示 27 | // \~english Shows only the front step 28 | front_index = urg_step2index(urg, 0); 29 | printf("%ld [mm], %d [1], (%ld [msec])\n", 30 | data[front_index], intensity[front_index], time_stamp); 31 | 32 | #else 33 | (void)urg; 34 | 35 | int i; 36 | 37 | // \~japanese 全てのデータを表示 38 | // \~english Prints the range/intensity values for all the measurement points 39 | printf("# n = %d, time_stamp = %ld\n", data_n, time_stamp); 40 | for (i = 0; i < data_n; ++i) { 41 | printf("%d, %ld, %d\n", i, data[i], intensity[i]); 42 | } 43 | #endif 44 | } 45 | 46 | 47 | int main(int argc, char *argv[]) 48 | { 49 | enum { 50 | CAPTURE_TIMES = 10, 51 | }; 52 | urg_t urg; 53 | int max_data_size; 54 | long *data = NULL; 55 | unsigned short *intensity = NULL; 56 | long time_stamp; 57 | int n; 58 | int i; 59 | 60 | if (open_urg_sensor(&urg, argc, argv) < 0) { 61 | return 1; 62 | } 63 | 64 | max_data_size = urg_max_data_size(&urg); 65 | data = (long *)malloc(max_data_size * sizeof(data[0])); 66 | if (!data) { 67 | perror("urg_max_index()"); 68 | return 1; 69 | } 70 | intensity = malloc(max_data_size * sizeof(intensity[0])); 71 | if (!intensity) { 72 | perror("urg_max_index()"); 73 | return 1; 74 | } 75 | 76 | // \~japanese データ取得 77 | // \~english Gets measurement data 78 | urg_start_measurement(&urg, URG_DISTANCE_INTENSITY, URG_SCAN_INFINITY, 0 , 1); 79 | for (i = 0; i < CAPTURE_TIMES; ++i) { 80 | n = urg_get_distance_intensity(&urg, data, intensity, &time_stamp); 81 | if (n <= 0) { 82 | printf("urg_get_distance_intensity: %s\n", urg_error(&urg)); 83 | free(data); 84 | urg_close(&urg); 85 | return 1; 86 | } 87 | print_data(&urg, data, intensity, n, time_stamp); 88 | } 89 | 90 | // \~japanese 切断 91 | // \~english Disconnects 92 | free(intensity); 93 | free(data); 94 | urg_close(&urg); 95 | 96 | #if defined(URG_MSC) 97 | getchar(); 98 | #endif 99 | return 0; 100 | } 101 | -------------------------------------------------------------------------------- /current/samples/c/get_distance_intensity_io.c: -------------------------------------------------------------------------------- 1 | /*! 2 | \~japanese 3 | \example get_distance_intensity.c 距離・強度・IOデータを取得する 4 | \~english 5 | \example get_distance_intensity.c Obtains distance, intensity and IO(input/output) data 6 | \~ 7 | 8 | $Id$ 9 | */ 10 | 11 | #include "urg_sensor.h" 12 | #include "urg_utils.h" 13 | #include "open_urg_sensor.h" 14 | #include 15 | #include 16 | 17 | 18 | static void print_data(urg_t *urg, long data[], unsigned short intensity[], 19 | long io[], long time_stamp) 20 | { 21 | enum { 22 | IO_BIT_SIZE = 18, 23 | }; 24 | 25 | printf("timestamp: %ld\n", time_stamp); 26 | 27 | // \~japanese IO情報を表示 28 | // \~english Display IO information 29 | unsigned long mask = (int)1 << (IO_BIT_SIZE - 1); 30 | char in[IO_BIT_SIZE + 1]; 31 | char out[IO_BIT_SIZE + 1]; 32 | int i; 33 | for (i = 0; i < IO_BIT_SIZE; ++i) { 34 | in[i] = (mask & io[0] ? '1' : '0'); 35 | out[i] = (mask & io[1] ? '1' : '0'); 36 | mask >>= 1; 37 | } 38 | in[IO_BIT_SIZE] = '\0'; 39 | out[IO_BIT_SIZE] = '\0'; 40 | printf("input : %s (%ld)\n", in, io[0]); 41 | printf("output : %s (%ld)\n", out, io[1]); 42 | 43 | // \~japanese 前方のデータのみを表示 44 | // \~english Shows only the front step 45 | int front_index = urg_step2index(urg, 0); 46 | printf("distance : %ld [mm]\n", data[front_index]); 47 | printf("intensity: %ld [1]\n\n", intensity[front_index]); 48 | } 49 | 50 | 51 | int main(int argc, char *argv[]) 52 | { 53 | enum { 54 | CAPTURE_TIMES = 10, 55 | }; 56 | urg_t urg; 57 | int max_data_size; 58 | long *io = malloc(2 * sizeof(long)); 59 | long *data = NULL; 60 | unsigned short *intensity = NULL; 61 | long time_stamp; 62 | int n; 63 | int i; 64 | 65 | if (open_urg_sensor(&urg, argc, argv) < 0) { 66 | return 1; 67 | } 68 | 69 | max_data_size = urg_max_data_size(&urg); 70 | data = (long *)malloc(max_data_size * sizeof(data[0])); 71 | if (!data) { 72 | perror("urg_max_index()"); 73 | return 1; 74 | } 75 | intensity = malloc(max_data_size * sizeof(intensity[0])); 76 | if (!intensity) { 77 | perror("urg_max_index()"); 78 | return 1; 79 | } 80 | 81 | // \~japanese データ取得 82 | // \~english Gets measurement data 83 | urg_start_measurement(&urg, URG_DISTANCE_INTENSITY_IO, URG_SCAN_INFINITY, 0); 84 | for (i = 0; i < CAPTURE_TIMES; ++i) { 85 | n = urg_get_distance_intensity_io(&urg, data, intensity, io, &time_stamp); 86 | if (n <= 0) { 87 | printf("urg_get_distance_intensity_io: %s\n", urg_error(&urg)); 88 | free(data); 89 | urg_close(&urg); 90 | return 1; 91 | } 92 | print_data(&urg, data, intensity, io, time_stamp); 93 | } 94 | 95 | // \~japanese 切断 96 | // \~english Disconnects 97 | free(intensity); 98 | free(data); 99 | urg_close(&urg); 100 | 101 | #if defined(URG_MSC) 102 | getchar(); 103 | #endif 104 | return 0; 105 | } 106 | -------------------------------------------------------------------------------- /current/samples/c/get_distance_io.c: -------------------------------------------------------------------------------- 1 | /*! 2 | \~japanese 3 | \example get_distance_io.c 距離・IOデータを取得する 4 | \~english 5 | \example get_distance_io.c Obtains distance and IO(input/output) data 6 | \~ 7 | 8 | $Id$ 9 | */ 10 | 11 | #include "urg_sensor.h" 12 | #include "urg_utils.h" 13 | #include "open_urg_sensor.h" 14 | #include 15 | #include 16 | 17 | 18 | static void print_data(urg_t *urg, long data[], long io[], long time_stamp) 19 | { 20 | enum { 21 | IO_BIT_SIZE = 18, 22 | }; 23 | 24 | printf("timestamp: %ld\n", time_stamp); 25 | 26 | // \~japanese IO情報を表示 27 | // \~english Display IO information 28 | unsigned long mask = (int)1 << (IO_BIT_SIZE - 1); 29 | char in[IO_BIT_SIZE + 1]; 30 | char out[IO_BIT_SIZE + 1]; 31 | int i; 32 | for (i = 0; i < IO_BIT_SIZE; ++i) { 33 | in[i] = (mask & io[0] ? '1' : '0'); 34 | out[i] = (mask & io[1] ? '1' : '0'); 35 | mask >>= 1; 36 | } 37 | in[IO_BIT_SIZE] = '\0'; 38 | out[IO_BIT_SIZE] = '\0'; 39 | printf("input : %s (%ld)\n", in, io[0]); 40 | printf("output : %s (%ld)\n", out, io[1]); 41 | 42 | // \~japanese 前方のデータのみを表示 43 | // \~english Shows only the front step 44 | int front_index = urg_step2index(urg, 0); 45 | printf("distance : %ld [mm]\n\n", data[front_index]); 46 | } 47 | 48 | 49 | int main(int argc, char *argv[]) 50 | { 51 | enum { 52 | CAPTURE_TIMES = 10, 53 | }; 54 | urg_t urg; 55 | long *data = NULL; 56 | long *io = malloc(2 * sizeof(long)); 57 | long time_stamp; 58 | int n; 59 | int i; 60 | 61 | if (open_urg_sensor(&urg, argc, argv) < 0) { 62 | return 1; 63 | } 64 | 65 | data = (long *)malloc(urg_max_data_size(&urg) * sizeof(data[0])); 66 | if (!data) { 67 | perror("urg_max_index()"); 68 | return 1; 69 | } 70 | 71 | // \~japanese データ取得 72 | // \~english Gets measurement data 73 | #if 0 74 | // \~japanese データの取得範囲を変更する場合 75 | // \~english Case where the measurement range (start/end steps) is defined 76 | urg_set_scanning_parameter(&urg, 77 | urg_deg2step(&urg, -90), 78 | urg_deg2step(&urg, +90), 0); 79 | #endif 80 | 81 | urg_start_measurement(&urg, URG_DISTANCE_IO, URG_SCAN_INFINITY, 0); 82 | for (i = 0; i < CAPTURE_TIMES; ++i) { 83 | n = urg_get_distance_io(&urg, data, io, &time_stamp); 84 | if (n <= 0) { 85 | printf("urg_get_distance_io: %s\n", urg_error(&urg)); 86 | free(data); 87 | urg_close(&urg); 88 | return 1; 89 | } 90 | print_data(&urg, data, io, time_stamp); 91 | } 92 | 93 | // \~japanese 切断 94 | // \~english Disconnects 95 | free(data); 96 | urg_close(&urg); 97 | 98 | #if defined(URG_MSC) 99 | getchar(); 100 | #endif 101 | return 0; 102 | } 103 | -------------------------------------------------------------------------------- /current/samples/c/get_multiecho.c: -------------------------------------------------------------------------------- 1 | /*! 2 | \~japanese 3 | \example get_multiecho.c 距離データ(マルチエコー)を取得する 4 | \~english 5 | \example get_multiecho.c Obtains multiecho distance data 6 | \~ 7 | \author Satofumi KAMIMURA 8 | 9 | $Id$ 10 | */ 11 | 12 | #include "urg_sensor.h" 13 | #include "urg_utils.h" 14 | #include "open_urg_sensor.h" 15 | #include 16 | #include 17 | 18 | 19 | static void print_echo_data(long data[], int index) 20 | { 21 | int i; 22 | 23 | // [mm] 24 | for (i = 0; i < URG_MAX_ECHO; ++i) { 25 | printf("%ld, ", data[(URG_MAX_ECHO * index) + i]); 26 | } 27 | } 28 | 29 | 30 | static void print_data(urg_t *urg, long data[], int data_n, long time_stamp) 31 | { 32 | #if 1 33 | int front_index; 34 | 35 | (void)data_n; 36 | 37 | // \~japanese 前方のデータのみを表示 38 | // \~english Shows only the front step 39 | front_index = urg_step2index(urg, 0); 40 | print_echo_data(data, front_index); 41 | printf("%ld\n", time_stamp); 42 | 43 | #else 44 | (void)urg; 45 | 46 | int i; 47 | 48 | // \~japanese 全てのデータを表示 49 | // \~english Prints the multiecho distance for all the measurement points 50 | printf("# n = %d, time_stamp = %ld\n", data_n, time_stamp); 51 | for (i = 0; i < data_n; ++i) { 52 | print_echo_data(data, i); 53 | printf("\n"); 54 | } 55 | #endif 56 | } 57 | 58 | 59 | int main(int argc, char *argv[]) 60 | { 61 | enum { 62 | CAPTURE_TIMES = 10, 63 | }; 64 | urg_t urg; 65 | long *data = NULL; 66 | long time_stamp; 67 | int n; 68 | int i; 69 | 70 | if (open_urg_sensor(&urg, argc, argv) < 0) { 71 | return 1; 72 | } 73 | 74 | data = (long *)malloc(urg_max_data_size(&urg) * 3 * sizeof(data[0])); 75 | if (!data) { 76 | perror("urg_max_index()"); 77 | return 1; 78 | } 79 | 80 | // \~japanese データ取得 81 | // \~english Gets measurement data 82 | urg_start_measurement(&urg, URG_MULTIECHO, URG_SCAN_INFINITY, 0, 1); 83 | for (i = 0; i < CAPTURE_TIMES; ++i) { 84 | n = urg_get_multiecho(&urg, data, &time_stamp); 85 | if (n <= 0) { 86 | printf("urg_get_multiecho: %s\n", urg_error(&urg)); 87 | free(data); 88 | urg_close(&urg); 89 | return 1; 90 | } 91 | print_data(&urg, data, n, time_stamp); 92 | } 93 | 94 | // \~japanese 切断 95 | // \~english Disconnects 96 | free(data); 97 | urg_close(&urg); 98 | 99 | #if defined(URG_MSC) 100 | getchar(); 101 | #endif 102 | return 0; 103 | } 104 | -------------------------------------------------------------------------------- /current/samples/c/get_multiecho_intensity.c: -------------------------------------------------------------------------------- 1 | /*! 2 | \~japanese 3 | \example get_multiecho_intensity.c 距離・強度データ(マルチエコー)を取得する 4 | \~english 5 | \example get_multiecho_intensity.c Obtains multiecho distance and intensity data 6 | \~ 7 | \author Satofumi KAMIMURA 8 | 9 | $Id$ 10 | */ 11 | 12 | #include "urg_sensor.h" 13 | #include "urg_utils.h" 14 | #include "open_urg_sensor.h" 15 | #include 16 | #include 17 | 18 | 19 | static void print_echo_data(long data[], unsigned short intensity[], 20 | int index) 21 | { 22 | int i; 23 | 24 | // [mm] 25 | for (i = 0; i < URG_MAX_ECHO; ++i) { 26 | printf("%ld, ", data[(URG_MAX_ECHO * index) + i]); 27 | } 28 | 29 | // [1] 30 | for (i = 0; i < URG_MAX_ECHO; ++i) { 31 | printf("%d, ", intensity[(URG_MAX_ECHO * index) + i]); 32 | } 33 | } 34 | 35 | 36 | // \~japanese 距離、強度のデータを表示する 37 | // \~english Prints distance and intensity data 38 | static void print_data(urg_t *urg, long data[], 39 | unsigned short intensity[], int data_n, long time_stamp) 40 | { 41 | #if 1 42 | int front_index; 43 | 44 | (void)data_n; 45 | 46 | // \~japanese 前方のデータのみを表示 47 | // \~english Shows only the front step 48 | front_index = urg_step2index(urg, 0); 49 | print_echo_data(data, intensity, front_index); 50 | printf("%ld\n", time_stamp); 51 | 52 | #else 53 | (void)urg; 54 | int i; 55 | 56 | // \~japanese 全てのデータを表示 57 | // \~english Prints the multiecho range/intensity values for all the measurement points 58 | printf("# n = %d, time_stamp = %ld\n", data_n, time_stamp); 59 | for (i = 0; i < data_n; ++i) { 60 | print_echo_data(data, intensity, i); 61 | printf("\n"); 62 | } 63 | #endif 64 | } 65 | 66 | 67 | int main(int argc, char *argv[]) 68 | { 69 | enum { 70 | CAPTURE_TIMES = 10, 71 | }; 72 | urg_t urg; 73 | int max_data_size; 74 | long *data = NULL; 75 | unsigned short *intensity = NULL; 76 | long time_stamp; 77 | int n; 78 | int i; 79 | 80 | if (open_urg_sensor(&urg, argc, argv) < 0) { 81 | return 1; 82 | } 83 | 84 | max_data_size = urg_max_data_size(&urg); 85 | data = (long *)malloc(max_data_size * 3 * sizeof(data[0])); 86 | intensity = (unsigned short *)malloc(max_data_size * 3 * 87 | sizeof(intensity[0])); 88 | 89 | if (!data) { 90 | perror("urg_max_index()"); 91 | return 1; 92 | } 93 | 94 | // \~japanese データ取得 95 | // \~english Gets measurement data 96 | urg_start_measurement(&urg, URG_MULTIECHO_INTENSITY, URG_SCAN_INFINITY, 0, 1); 97 | for (i = 0; i < CAPTURE_TIMES; ++i) { 98 | n = urg_get_multiecho_intensity(&urg, data, intensity, &time_stamp); 99 | if (n <= 0) { 100 | printf("urg_get_multiecho_intensity: %s\n", urg_error(&urg)); 101 | free(data); 102 | free(intensity); 103 | urg_close(&urg); 104 | return 1; 105 | } 106 | print_data(&urg, data, intensity, n, time_stamp); 107 | } 108 | 109 | // \~japanese 切断 110 | // \~english Disconnects 111 | free(data); 112 | free(intensity); 113 | urg_close(&urg); 114 | 115 | #if defined(URG_MSC) 116 | getchar(); 117 | #endif 118 | return 0; 119 | } 120 | -------------------------------------------------------------------------------- /current/samples/c/open_urg_sensor.c: -------------------------------------------------------------------------------- 1 | /*! 2 | \~japanese 3 | \brief URG との接続 4 | \~english 5 | \brief Connects to URG 6 | \~ 7 | \author Satofumi KAMIMURA 8 | 9 | $Id$ 10 | */ 11 | 12 | #include "open_urg_sensor.h" 13 | #include "urg_utils.h" 14 | #include "urg_detect_os.h" 15 | #include 16 | #include 17 | 18 | 19 | int open_urg_sensor(urg_t *urg, int argc, char *argv[]) 20 | { 21 | #if defined(URG_WINDOWS_OS) 22 | const char *device = "COM3"; 23 | #elif defined(URG_LINUX_OS) 24 | const char *device = "/dev/ttyACM0"; 25 | //const char *device = "/dev/ttyUSB0"; 26 | #else 27 | const char *device = "/dev/tty.usbmodemfa131"; 28 | #endif 29 | urg_connection_type_t connection_type = URG_SERIAL; 30 | long baudrate_or_port = 115200; 31 | const char *ip_address = "192.168.0.10"; 32 | //const char *ip_address = "localhost"; 33 | int i; 34 | 35 | // \~japanese 接続タイプの切替え 36 | // \~english Changes connection type 37 | for (i = 1; i < argc; ++i) { 38 | if (!strcmp(argv[i], "-e")) { 39 | connection_type = URG_ETHERNET; 40 | baudrate_or_port = 10940; 41 | device = ip_address; 42 | } 43 | if (!strcmp(argv[i], "-e") || !strcmp(argv[i], "-s")) { 44 | if (argc > i + 1) { 45 | ++i; 46 | device = argv[i]; 47 | } 48 | } 49 | } 50 | 51 | // \~japanese 接続 52 | // \~english Connection 53 | if (urg_open(urg, connection_type, device, baudrate_or_port) < 0) { 54 | printf("urg_open: %s, %ld: %s\n", 55 | device, baudrate_or_port, urg_error(urg)); 56 | return -1; 57 | } 58 | 59 | return 0; 60 | } 61 | -------------------------------------------------------------------------------- /current/samples/c/open_urg_sensor.h: -------------------------------------------------------------------------------- 1 | #ifndef OPEN_URG_SENSOR_H 2 | #define OPEN_URG_SENSOR_H 3 | 4 | /*! 5 | \~japanese 6 | \brief URG との接続 7 | \~english 8 | \brief Connects to URG 9 | \~ 10 | \author Satofumi KAMIMURA 11 | 12 | $Id$ 13 | */ 14 | 15 | #include "urg_sensor.h" 16 | 17 | 18 | extern int open_urg_sensor(urg_t *urg, int argc, char *argv[]); 19 | 20 | #endif /* !OPEN_URG_SENSOR_H */ 21 | -------------------------------------------------------------------------------- /current/samples/c/reboot_test.c: -------------------------------------------------------------------------------- 1 | /*! 2 | \example reboot_test.c reboot test 3 | 4 | \author Satofumi KAMIMURA 5 | 6 | $Id$ 7 | */ 8 | 9 | #include "urg_sensor.h" 10 | #include "urg_utils.h" 11 | #include "open_urg_sensor.h" 12 | #include 13 | 14 | 15 | int main(int argc, char *argv[]) 16 | { 17 | enum { DATA_SIZE = 1081 }; 18 | urg_t urg; 19 | 20 | if (open_urg_sensor(&urg, argc, argv) < 0) { 21 | return 1; 22 | } 23 | 24 | urg_reboot(&urg); 25 | 26 | return 0; 27 | } 28 | -------------------------------------------------------------------------------- /current/samples/c/sensor_parameter.c: -------------------------------------------------------------------------------- 1 | /*! 2 | \~japanese 3 | \example sensor_parameter.c センサ情報の出力 4 | \~english 5 | \example sensor_parameter.c Outputs sensor information fields 6 | \~ 7 | \author Satofumi KAMIMURA 8 | 9 | $Id$ 10 | */ 11 | 12 | #include "urg_sensor.h" 13 | #include "urg_utils.h" 14 | #include "open_urg_sensor.h" 15 | #include 16 | 17 | 18 | int main(int argc, char *argv[]) 19 | { 20 | urg_t urg; 21 | int min_step; 22 | int max_step; 23 | long min_distance; 24 | long max_distance; 25 | 26 | if (open_urg_sensor(&urg, argc, argv) < 0) { 27 | return 1; 28 | } 29 | 30 | printf("Sensor product type: %s\n", urg_sensor_product_type(&urg)); 31 | printf("Sensor firmware version: %s\n", urg_sensor_firmware_version(&urg)); 32 | printf("Sensor serial ID: %s\n", urg_sensor_serial_id(&urg)); 33 | printf("Sensor status: %s\n", urg_sensor_status(&urg)); 34 | printf("Sensor state: %s\n", urg_sensor_state(&urg)); 35 | 36 | urg_step_min_max(&urg, &min_step, &max_step); 37 | printf("step: [%d, %d]\n", min_step, max_step); 38 | 39 | urg_distance_min_max(&urg, &min_distance, &max_distance); 40 | printf("distance: [%ld, %ld)\n", min_distance, max_distance); 41 | 42 | printf("scan interval: %ld [usec]\n", urg_scan_usec(&urg)); 43 | printf("sensor data size: %d\n", urg_max_data_size(&urg)); 44 | 45 | urg_close(&urg); 46 | 47 | #if defined(URG_MSC) 48 | getchar(); 49 | #endif 50 | return 0; 51 | } 52 | -------------------------------------------------------------------------------- /current/samples/c/sync_time_stamp.c: -------------------------------------------------------------------------------- 1 | /*! 2 | \~japanese 3 | \example sync_time_stamp.c センサと PC のタイムスタンプを同期する 4 | \~english 5 | \example sync_time_stamp.c Timestamp synchronization between PC and sensor 6 | \~ 7 | \author Satofumi KAMIMURA 8 | 9 | $Id$ 10 | */ 11 | 12 | #include "urg_sensor.h" 13 | #include "urg_utils.h" 14 | #include "open_urg_sensor.h" 15 | #include 16 | #if defined(URG_WINDOWS_OS) 17 | #include 18 | #else 19 | #include 20 | #endif 21 | 22 | static int pc_msec_time(void) 23 | { 24 | static int is_initialized = 0; 25 | #if defined(URG_WINDOWS_OS) 26 | static clock_t first_clock; 27 | clock_t current_clock; 28 | #else 29 | static struct timeval first_time; 30 | struct timeval current_time; 31 | #endif 32 | long msec_time; 33 | 34 | #if defined(URG_WINDOWS_OS) 35 | if (!is_initialized) { 36 | first_clock = clock(); 37 | is_initialized = 1; 38 | } 39 | current_clock = clock(); 40 | msec_time = (current_clock - first_clock) * 1000 / CLOCKS_PER_SEC; 41 | #else 42 | if (!is_initialized) { 43 | gettimeofday(&first_time, NULL); 44 | is_initialized = 1; 45 | } 46 | gettimeofday(¤t_time, NULL); 47 | 48 | msec_time = 49 | ((current_time.tv_sec - first_time.tv_sec) * 1000) + 50 | ((current_time.tv_usec - first_time.tv_usec) / 1000); 51 | #endif 52 | return msec_time; 53 | } 54 | 55 | 56 | /*! 57 | \~japanese 58 | \brief PC のタイムスタンプに補正するための値を返す 59 | \~english 60 | \brief Returns the timestamp (offset) necessary to correct the PC time 61 | */ 62 | static long print_time_stamp(urg_t *urg, long time_stamp_offset) 63 | { 64 | long sensor_time_stamp; 65 | long pc_time_stamp; 66 | long before_pc_time_stamp; 67 | long after_pc_time_stamp; 68 | long delay; 69 | 70 | urg_start_time_stamp_mode(urg); 71 | 72 | before_pc_time_stamp = pc_msec_time(); 73 | sensor_time_stamp = urg_time_stamp(urg); 74 | after_pc_time_stamp = pc_msec_time(); 75 | delay = (after_pc_time_stamp - before_pc_time_stamp) / 2; 76 | 77 | if (sensor_time_stamp < 0) { 78 | printf("urg_time_stamp: %s\n", urg_error(urg)); 79 | return -1; 80 | } 81 | sensor_time_stamp -= time_stamp_offset; 82 | 83 | pc_time_stamp = pc_msec_time(); 84 | urg_stop_time_stamp_mode(urg); 85 | 86 | printf("%ld,\t%ld\n", pc_time_stamp, sensor_time_stamp); 87 | 88 | return sensor_time_stamp - (pc_time_stamp - delay); 89 | } 90 | 91 | 92 | int main(int argc, char *argv[]) 93 | { 94 | enum { 95 | TIME_STAMP_PRINT_TIMES = 5, 96 | }; 97 | 98 | urg_t urg; 99 | long time_stamp_offset; 100 | int i; 101 | 102 | if (open_urg_sensor(&urg, argc, argv) < 0) { 103 | return 1; 104 | } 105 | 106 | printf("# pc,\tsensor\n"); 107 | 108 | // \~japanese URG のタイムスタンプと PC のタイムスタンプを表示 109 | // \~english Prints the URG timestamp and the PC timestamp 110 | time_stamp_offset = print_time_stamp(&urg, 0); 111 | 112 | printf("\n"); 113 | 114 | // \~japanese URG の補正後のタイムスタンプと PC タイムスタンプを表示 115 | // \~english Prints the URG timestamp and the PC timestamp after correction 116 | for (i = 0; i < TIME_STAMP_PRINT_TIMES; ++i) { 117 | print_time_stamp(&urg, time_stamp_offset); 118 | } 119 | 120 | urg_close(&urg); 121 | 122 | #if defined(URG_MSC) 123 | getchar(); 124 | #endif 125 | return 0; 126 | } 127 | -------------------------------------------------------------------------------- /current/samples/c/timeout_test.c: -------------------------------------------------------------------------------- 1 | /*! 2 | \example timeout_test.c timeout test 3 | 4 | \author Satofumi KAMIMURA 5 | 6 | $Id$ 7 | */ 8 | 9 | #include "urg_sensor.h" 10 | #include "urg_utils.h" 11 | #include "urg_debug.h" 12 | #include "open_urg_sensor.h" 13 | #include 14 | 15 | 16 | int main(int argc, char *argv[]) 17 | { 18 | enum { TIMEOUT_MSEC = 3000 }; 19 | char buffer; 20 | int n; 21 | urg_t urg; 22 | 23 | if (open_urg_sensor(&urg, argc, argv) < 0) { 24 | return 1; 25 | } 26 | 27 | printf("read\n"); 28 | n = urg_raw_read(&urg, &buffer, 1, TIMEOUT_MSEC); 29 | printf("n = %d\n", n); 30 | 31 | return 0; 32 | } 33 | -------------------------------------------------------------------------------- /current/samples/cpp/Connection_information.cpp: -------------------------------------------------------------------------------- 1 | /*! 2 | \file 3 | \~japanese 4 | \brief 接続情報の管理 5 | \~english 6 | \brief Maintains connection information 7 | \~ 8 | \author Satofumi KAMIMURA 9 | 10 | $Id$ 11 | */ 12 | 13 | #include "Connection_information.h" 14 | #include "detect_os.h" 15 | #include 16 | #include 17 | 18 | using namespace std; 19 | using namespace qrk; 20 | 21 | 22 | struct Connection_information::pImpl 23 | { 24 | Urg_driver::connection_type_t connection_type_; 25 | string device_or_ip_name_; 26 | long baudrate_or_port_number_; 27 | 28 | 29 | void set_serial_connection(const char* device = NULL) 30 | { 31 | connection_type_ = Urg_driver::Serial; 32 | if (device != NULL) { 33 | device_or_ip_name_ = device; 34 | } else { 35 | #if defined(QRK_WINDOWS_OS) 36 | device_or_ip_name_ = "COM3"; 37 | #elif defined(QRK_LINUX_OS) 38 | device_or_ip_name_ = "/dev/ttyACM0"; 39 | #else 40 | device_or_ip_name_ = "/dev/tty.usbmodemfa131"; 41 | #endif 42 | } 43 | baudrate_or_port_number_ = 115200; 44 | } 45 | 46 | 47 | void set_ethernet_connection(const char* ip_address = NULL) 48 | { 49 | connection_type_ = Urg_driver::Ethernet; 50 | if (ip_address != NULL) { 51 | device_or_ip_name_ = ip_address; 52 | } else { 53 | //device_or_ip_name_ = "localhost"; 54 | device_or_ip_name_ = "192.168.0.10"; 55 | } 56 | baudrate_or_port_number_ = 10940; 57 | } 58 | }; 59 | 60 | 61 | Connection_information::Connection_information(int argc, 62 | const char*const argv[]) 63 | : pimpl(new pImpl) 64 | { 65 | for (int i = 1; i < argc; ++i) { 66 | const char* device = NULL; 67 | if (!strcmp(argv[i], "-e")) { 68 | if (argc > i + 1) { 69 | device = argv[i + 1]; 70 | } 71 | pimpl->set_ethernet_connection(device); 72 | return; 73 | } 74 | if (!strcmp(argv[i], "-s")) { 75 | if (argc > i + 1) { 76 | device = argv[i + 1]; 77 | } 78 | pimpl->set_serial_connection(device); 79 | return; 80 | } 81 | } 82 | pimpl->set_serial_connection(); 83 | } 84 | 85 | 86 | Connection_information::~Connection_information(void) 87 | { 88 | } 89 | 90 | 91 | Urg_driver::connection_type_t 92 | Connection_information::connection_type(void) const 93 | { 94 | return pimpl->connection_type_; 95 | } 96 | 97 | 98 | const char* Connection_information::device_or_ip_name(void) const 99 | { 100 | return pimpl->device_or_ip_name_.c_str(); 101 | } 102 | 103 | 104 | long Connection_information::baudrate_or_port_number(void) const 105 | { 106 | return pimpl->baudrate_or_port_number_; 107 | } 108 | -------------------------------------------------------------------------------- /current/samples/cpp/Connection_information.h: -------------------------------------------------------------------------------- 1 | #ifndef QRK_CONNECTION_INFORMATION_H 2 | #define QRK_CONNECTION_INFORMATION_H 3 | 4 | /*! 5 | \file 6 | \~japanese 7 | \brief 接続情報の管理 8 | \~english 9 | \brief Maintains connection information 10 | \~ 11 | \author Satofumi KAMIMURA 12 | 13 | $Id$ 14 | */ 15 | 16 | #include "Urg_driver.h" 17 | #include 18 | 19 | 20 | namespace qrk 21 | { 22 | class Connection_information 23 | { 24 | public: 25 | Connection_information(int argc, const char*const argv[]); 26 | ~Connection_information(void); 27 | 28 | Lidar::connection_type_t connection_type() const; 29 | const char* device_or_ip_name(void) const; 30 | long baudrate_or_port_number(void) const; 31 | 32 | private: 33 | Connection_information(void); 34 | struct pImpl; 35 | std::unique_ptr pimpl; 36 | }; 37 | } 38 | 39 | #endif /* !QRK_CONNECTION_INFORMATION_H */ 40 | -------------------------------------------------------------------------------- /current/samples/cpp/Makefile: -------------------------------------------------------------------------------- 1 | # Makefile for c/urg/samples 2 | # $Id$ 3 | 4 | # Compile options 5 | SRCDIR = ../../src 6 | INCLUDEDIR = ../../include/cpp 7 | CC = gcc 8 | CXX = g++ 9 | CFLAGS = -g -O0 -Wall -Werror -W $(INCLUDES) 10 | CXXFLAGS = $(CFLAGS) 11 | INCLUDES = -I$(INCLUDEDIR) 12 | LDFLAGS = 13 | LDLIBS = -lm $(shell if test `echo $(OS) | grep Windows`; then echo "-lwsock32 -lsetupapi"; else if test `uname -s | grep Darwin`; then echo ""; else echo "-lrt"; fi; fi) -L$(SRCDIR) 14 | 15 | # Target 16 | TARGET = \ 17 | get_distance \ 18 | get_distance_handshake \ 19 | get_distance_intensity \ 20 | get_multiecho \ 21 | get_multiecho_intensity \ 22 | sync_time_stamp \ 23 | sensor_parameter \ 24 | 25 | all : $(TARGET) 26 | 27 | clean : 28 | $(RM) *.o $(TARGET) *.exe 29 | 30 | depend : 31 | makedepend -Y -- $(INCLUDES) -- $(wildcard *.h *.c) 32 | 33 | .PHONY : all depend clean 34 | 35 | ###################################################################### 36 | REQUIRE_LIB = $(SRCDIR)/liburg_cpp.a 37 | $(REQUIRE_LIB) : $(wildcard $(SRCDIR)/*.[ch]) 38 | cd $(@D)/ && $(MAKE) $(@F) 39 | 40 | get_distance get_distance_handshake get_distance_intensity get_multiecho get_multiecho_intensity sync_time_stamp sensor_parameter : Connection_information.o $(REQUIRE_LIB) 41 | -------------------------------------------------------------------------------- /current/samples/cpp/Makefile.release: -------------------------------------------------------------------------------- 1 | TARGET = sensor_parameter get_distance get_distance_handshake get_distance_intensity get_multiecho get_multiecho_intensity sync_time_stamp 2 | 3 | SRCDIR = ../../src 4 | URG_CPP_LIB = ../../src/liburg_cpp.a 5 | 6 | include ../../build_rule.mk 7 | 8 | CXXFLAGS = -O2 $(INCLUDES) -I../../include/cpp 9 | LDLIBS = -lm $(shell if test `echo $(OS) | grep Windows`; then echo "-lwsock32 -lsetupapi"; else if test `uname -s | grep Darwin`; then echo ""; else echo "-lrt"; fi; fi) -L$(SRCDIR) 10 | 11 | # 12 | 13 | all : $(TARGET) 14 | 15 | clean : 16 | $(RM) *.o $(TARGET) *.exe 17 | 18 | $(TARGET) : Connection_information.o $(URG_CPP_LIB) 19 | 20 | $(URG_CPP_LIB) : 21 | cd $(@D)/ && $(MAKE) $(@F) 22 | -------------------------------------------------------------------------------- /current/samples/cpp/get_distance.cpp: -------------------------------------------------------------------------------- 1 | /*! 2 | \~japanese 3 | \example get_distance.cpp 距離データを取得する 4 | \~english 5 | \example get_distance.cpp Obtains distance data 6 | \~ 7 | \author Satofumi KAMIMURA 8 | 9 | $Id$ 10 | */ 11 | 12 | #include "Urg_driver.h" 13 | #include "Connection_information.h" 14 | #include "math_utilities.h" 15 | #include 16 | 17 | using namespace qrk; 18 | using namespace std; 19 | 20 | 21 | namespace 22 | { 23 | void print_data(const Urg_driver& urg, 24 | const vector& data, long time_stamp) 25 | { 26 | #if 1 27 | // \~japanese 前方のデータのみを表示 28 | // \~english Shows only the front step 29 | int front_index = urg.step2index(0); 30 | cout << data[front_index] << " [mm], (" 31 | << time_stamp << " [msec])" << endl; 32 | 33 | #else 34 | // \~japanese 全てのデータの X-Y の位置を表示 35 | // \~english Prints the X-Y coordinates for all the measurement points 36 | long min_distance = urg.min_distance(); 37 | long max_distance = urg.max_distance(); 38 | size_t data_n = data.size(); 39 | for (size_t i = 0; i < data_n; ++i) { 40 | long l = data[i]; 41 | if ((l <= min_distance) || (l >= max_distance)) { 42 | continue; 43 | } 44 | 45 | double radian = urg.index2rad(i); 46 | long x = static_cast(l * cos(radian)); 47 | long y = static_cast(l * sin(radian)); 48 | cout << "(" << x << ", " << y << ")" << endl; 49 | } 50 | cout << endl; 51 | #endif 52 | } 53 | } 54 | 55 | 56 | int main(int argc, char *argv[]) 57 | { 58 | Connection_information information(argc, argv); 59 | 60 | // \~japanese 接続 61 | // \~english Connects to the sensor 62 | Urg_driver urg; 63 | if (!urg.open(information.device_or_ip_name(), 64 | information.baudrate_or_port_number(), 65 | information.connection_type())) { 66 | cout << "Urg_driver::open(): " 67 | << information.device_or_ip_name() << ": " << urg.what() << endl; 68 | return 1; 69 | } 70 | 71 | // \~japanese データ取得 72 | // \~english Gets measurement data 73 | #if 1 74 | // \~japanese データの取得範囲を変更する場合 75 | // \~english Case where the measurement range (start/end steps) is defined 76 | urg.set_scanning_parameter(urg.deg2step(-90), urg.deg2step(+90), 0); 77 | #endif 78 | enum { Capture_times = 10 }; 79 | urg.start_measurement(Urg_driver::Distance, Urg_driver::Infinity_times, 0); 80 | for (int i = 0; i < Capture_times; ++i) { 81 | vector data; 82 | long time_stamp = 0; 83 | 84 | if (!urg.get_distance(data, &time_stamp)) { 85 | cout << "Urg_driver::get_distance(): " << urg.what() << endl; 86 | return 1; 87 | } 88 | print_data(urg, data, time_stamp); 89 | } 90 | 91 | #if defined(URG_MSC) 92 | getchar(); 93 | #endif 94 | return 0; 95 | } 96 | -------------------------------------------------------------------------------- /current/samples/cpp/get_distance_handshake.cpp: -------------------------------------------------------------------------------- 1 | /*! 2 | \~japanese 3 | \example get_distance.cpp 距離データを取得する 4 | \~english 5 | \example get_distance.cpp Obtains distance data 6 | \~ 7 | \author Satofumi KAMIMURA 8 | 9 | $Id$ 10 | */ 11 | 12 | #include "Urg_driver.h" 13 | #include "Connection_information.h" 14 | #include "math_utilities.h" 15 | #include 16 | 17 | using namespace qrk; 18 | using namespace std; 19 | 20 | 21 | namespace 22 | { 23 | void print_data(const Urg_driver& urg, 24 | const vector& data, long time_stamp) 25 | { 26 | #if 1 27 | // \~japanese 前方のデータのみを表示 28 | // \~english Shows only the front step 29 | int front_index = urg.step2index(0); 30 | cout << data[front_index] << " [mm], (" 31 | << time_stamp << " [msec])" << endl; 32 | 33 | #else 34 | // \~japanese 全てのデータの X-Y の位置を表示 35 | // \~english Prints the X-Y coordinates for all the measurement points 36 | long min_distance = urg.min_distance(); 37 | long max_distance = urg.max_distance(); 38 | size_t data_n = data.size(); 39 | for (size_t i = 0; i < data_n; ++i) { 40 | long l = data[i]; 41 | if ((l <= min_distance) || (l >= max_distance)) { 42 | continue; 43 | } 44 | 45 | double radian = urg.index2rad(i); 46 | long x = static_cast(l * cos(radian)); 47 | long y = static_cast(l * sin(radian)); 48 | cout << "(" << x << ", " << y << ")" << endl; 49 | } 50 | cout << endl; 51 | #endif 52 | } 53 | } 54 | 55 | 56 | int main(int argc, char *argv[]) 57 | { 58 | Connection_information information(argc, argv); 59 | 60 | // \~japanese 接続 61 | // \~english Connects to the sensor 62 | Urg_driver urg; 63 | if (!urg.open(information.device_or_ip_name(), 64 | information.baudrate_or_port_number(), 65 | information.connection_type())) { 66 | cout << "Urg_driver::open(): " 67 | << information.device_or_ip_name() << ": " << urg.what() << endl; 68 | return 1; 69 | } 70 | 71 | // \~japanese データ取得 72 | // \~english Gets measurement data 73 | #if 1 74 | // \~japanese データの取得範囲を変更する場合 75 | // \~english Case where the measurement range (start/end steps) is defined 76 | urg.set_scanning_parameter(urg.deg2step(-90), urg.deg2step(+90), 0); 77 | #endif 78 | enum { Capture_times = 10 }; 79 | for (int i = 0; i < Capture_times; ++i) { 80 | vector data; 81 | long time_stamp = 0; 82 | 83 | urg.start_measurement(Urg_driver::Distance, 1, 0); 84 | if (!urg.get_distance(data, &time_stamp)) { 85 | cout << "Urg_driver::get_distance(): " << urg.what() << endl; 86 | return 1; 87 | } 88 | print_data(urg, data, time_stamp); 89 | } 90 | 91 | #if defined(URG_MSC) 92 | getchar(); 93 | #endif 94 | return 0; 95 | } 96 | -------------------------------------------------------------------------------- /current/samples/cpp/get_distance_intensity.cpp: -------------------------------------------------------------------------------- 1 | /*! 2 | \~japanese 3 | \example get_distance_intensity.cpp 距離・強度データを取得する 4 | \~english 5 | \example get_distance_intensity.cpp Obtains distance and intensity data 6 | \~ 7 | \author Satofumi KAMIMURA 8 | 9 | $Id$ 10 | */ 11 | 12 | #include "Urg_driver.h" 13 | #include "Connection_information.h" 14 | #include 15 | 16 | using namespace qrk; 17 | using namespace std; 18 | 19 | 20 | namespace 21 | { 22 | void print_data(const Urg_driver& urg, 23 | const vector& data, 24 | const vector& intensity, 25 | long time_stamp) 26 | { 27 | #if 1 28 | // \~japanese 前方のデータのみを表示 29 | // \~english Shows only the front step 30 | int front_index = urg.step2index(0); 31 | cout << data[front_index] << " [mm], " 32 | << intensity[front_index] << " [1], (" 33 | << time_stamp << " [msec])" << endl; 34 | 35 | #else 36 | static_cast(urg); 37 | 38 | // \~japanese 全てのデータを表示 39 | // \~english Prints the range/intensity values for all the measurement points 40 | size_t data_n = data.size(); 41 | cout << "# n = " << data_n << ", timestamp = " << time_stamp << endl; 42 | for (size_t i = 0; i < data_n; ++i) { 43 | cout << i << ", " << data[i] << ", " << intensity[i] << endl; 44 | } 45 | #endif 46 | } 47 | } 48 | 49 | 50 | int main(int argc, char *argv[]) 51 | { 52 | Connection_information information(argc, argv); 53 | 54 | // \~japanese 接続 55 | // \~english Connects to the sensor 56 | Urg_driver urg; 57 | if (!urg.open(information.device_or_ip_name(), 58 | information.baudrate_or_port_number(), 59 | information.connection_type())) { 60 | cout << "Urg_driver::open(): " 61 | << information.device_or_ip_name() << ": " << urg.what() << endl; 62 | return 1; 63 | } 64 | 65 | // \~japanese データ取得 66 | // \~english Gets measurement data 67 | enum { Capture_times = 10 }; 68 | urg.start_measurement(Urg_driver::Distance_intensity, Urg_driver::Infinity_times, 0); 69 | for (int i = 0; i < Capture_times; ++i) { 70 | vector data; 71 | vector intensity; 72 | long time_stamp = 0; 73 | 74 | if (!urg.get_distance_intensity(data, intensity, &time_stamp)) { 75 | cout << "Urg_driver::get_distance(): " << urg.what() << endl; 76 | return 1; 77 | } 78 | print_data(urg, data, intensity, time_stamp); 79 | } 80 | 81 | #if defined(URG_MSC) 82 | getchar(); 83 | #endif 84 | return 0; 85 | } 86 | -------------------------------------------------------------------------------- /current/samples/cpp/get_distance_intensity_io.cpp: -------------------------------------------------------------------------------- 1 | /*! 2 | \~japanese 3 | \example get_distance_io.cpp 距離・強度・IOデータを取得する 4 | \~english 5 | \example get_distance_io.cpp Obtains distance, intensity and IO(input/output) data 6 | \~ 7 | 8 | $Id$ 9 | */ 10 | 11 | #include "Urg_driver.h" 12 | #include "Connection_information.h" 13 | #include "math_utilities.h" 14 | #include 15 | #include 16 | #include 17 | 18 | using namespace qrk; 19 | using namespace std; 20 | 21 | 22 | namespace 23 | { 24 | void print_data(const Urg_driver& urg, 25 | const vector& data, 26 | const vector& intensity, 27 | const vector& io, 28 | long time_stamp) 29 | { 30 | cout << "timestamp: " << time_stamp << " [msec]" << endl; 31 | 32 | // \~japanese IO情報を表示 33 | // \~english Display IO information 34 | stringstream ss; 35 | ss << bitset<18>(io[0]); 36 | string input = ss.str(); 37 | stringstream ss2; 38 | ss2 << bitset<18>(io[1]); 39 | string output = ss2.str(); 40 | cout << "input : " << input << " (" << io[0] << ")" << endl; 41 | cout << "output : " << output << " (" << io[1] << ")" << endl; 42 | 43 | // \~japanese 前方のデータのみを表示 44 | // \~english Shows only the front step 45 | int front_index = urg.step2index(0); 46 | cout << "distance : " << data[front_index] << " [mm]" << endl; 47 | cout << "intensity: " << data[front_index] << " [1]" << endl; 48 | 49 | cout << endl; 50 | } 51 | } 52 | 53 | 54 | int main(int argc, char *argv[]) 55 | { 56 | Connection_information information(argc, argv); 57 | 58 | // \~japanese 接続 59 | // \~english Connects to the sensor 60 | Urg_driver urg; 61 | if (!urg.open(information.device_or_ip_name(), 62 | information.baudrate_or_port_number(), 63 | information.connection_type())) { 64 | cout << "Urg_driver::open(): " 65 | << information.device_or_ip_name() << ": " << urg.what() << endl; 66 | return 1; 67 | } 68 | 69 | // \~japanese データ取得 70 | // \~english Gets measurement data 71 | #if 1 72 | // \~japanese データの取得範囲を変更する場合 73 | // \~english Case where the measurement range (start/end steps) is defined 74 | urg.set_scanning_parameter(urg.deg2step(-90), urg.deg2step(+90), 0); 75 | #endif 76 | enum { Capture_times = 10 }; 77 | urg.start_measurement(Urg_driver::Distance_intensity_io, Urg_driver::Infinity_times, 0); 78 | for (int i = 0; i < Capture_times; ++i) { 79 | vector data; 80 | vector intensity; 81 | vector io; 82 | long time_stamp = 0; 83 | 84 | if (!urg.get_distance_intensity_io(data, intensity, io, &time_stamp)) { 85 | cout << "Urg_driver::get_distance_intensity_io(): " << urg.what() << endl; 86 | return 1; 87 | } 88 | print_data(urg, data, intensity, io, time_stamp); 89 | } 90 | 91 | #if defined(URG_MSC) 92 | getchar(); 93 | #endif 94 | return 0; 95 | } 96 | -------------------------------------------------------------------------------- /current/samples/cpp/get_distance_io.cpp: -------------------------------------------------------------------------------- 1 | /*! 2 | \~japanese 3 | \example get_distance_io.cpp 距離・IOデータを取得する 4 | \~english 5 | \example get_distance_io.cpp Obtains distance and IO(input/output) data 6 | \~ 7 | 8 | $Id$ 9 | */ 10 | 11 | #include "Urg_driver.h" 12 | #include "Connection_information.h" 13 | #include "math_utilities.h" 14 | #include 15 | #include 16 | #include 17 | 18 | using namespace qrk; 19 | using namespace std; 20 | 21 | 22 | namespace 23 | { 24 | void print_data(const Urg_driver& urg, 25 | const vector& data, const vector& io, long time_stamp) 26 | { 27 | cout << "timestamp: " << time_stamp << " [msec]" << endl; 28 | 29 | // \~japanese IO情報を表示 30 | // \~english Display IO information 31 | stringstream ss; 32 | ss << bitset<18>(io[0]); 33 | string input = ss.str(); 34 | stringstream ss2; 35 | ss2 << bitset<18>(io[1]); 36 | string output = ss2.str(); 37 | cout << "input : " << input << " (" << io[0] << ")" << endl; 38 | cout << "output : " << output << " (" << io[1] << ")" << endl; 39 | 40 | // \~japanese 前方のデータのみを表示 41 | // \~english Shows only the front step 42 | int front_index = urg.step2index(0); 43 | cout << "distance : " << data[front_index] << " [mm]" << endl; 44 | 45 | cout << endl; 46 | } 47 | } 48 | 49 | 50 | int main(int argc, char *argv[]) 51 | { 52 | Connection_information information(argc, argv); 53 | 54 | // \~japanese 接続 55 | // \~english Connects to the sensor 56 | Urg_driver urg; 57 | if (!urg.open(information.device_or_ip_name(), 58 | information.baudrate_or_port_number(), 59 | information.connection_type())) { 60 | cout << "Urg_driver::open(): " 61 | << information.device_or_ip_name() << ": " << urg.what() << endl; 62 | return 1; 63 | } 64 | 65 | // \~japanese データ取得 66 | // \~english Gets measurement data 67 | #if 1 68 | // \~japanese データの取得範囲を変更する場合 69 | // \~english Case where the measurement range (start/end steps) is defined 70 | urg.set_scanning_parameter(urg.deg2step(-90), urg.deg2step(+90), 0); 71 | #endif 72 | enum { Capture_times = 10 }; 73 | urg.start_measurement(Urg_driver::Distance_io, Urg_driver::Infinity_times, 0); 74 | for (int i = 0; i < Capture_times; ++i) { 75 | vector data; 76 | vector io; 77 | long time_stamp = 0; 78 | 79 | if (!urg.get_distance_io(data, io, &time_stamp)) { 80 | cout << "Urg_driver::get_distance_io(): " << urg.what() << endl; 81 | return 1; 82 | } 83 | print_data(urg, data, io, time_stamp); 84 | } 85 | 86 | #if defined(URG_MSC) 87 | getchar(); 88 | #endif 89 | return 0; 90 | } 91 | -------------------------------------------------------------------------------- /current/samples/cpp/get_multiecho.cpp: -------------------------------------------------------------------------------- 1 | /*! 2 | \~japanese 3 | \example get_multiecho.cpp 距離データ(マルチエコー)を取得する 4 | \~english 5 | \example get_multiecho.cpp Obtains multiecho distance data 6 | \~ 7 | \author Satofumi KAMIMURA 8 | 9 | $Id$ 10 | */ 11 | 12 | #include "Urg_driver.h" 13 | #include "Connection_information.h" 14 | #include 15 | 16 | using namespace qrk; 17 | using namespace std; 18 | 19 | 20 | namespace 21 | { 22 | void print_echo_data(const vector& data, int index, 23 | int max_echo_size) 24 | { 25 | // [mm] 26 | for (int i = 0; i < max_echo_size; ++i) { 27 | cout << data[(max_echo_size * index) + i] << ", "; 28 | } 29 | } 30 | 31 | 32 | void print_data(const Urg_driver& urg, 33 | const vector& data, long time_stamp) 34 | { 35 | #if 1 36 | // \~japanese 前方のデータのみを表示 37 | // \~english Shows only the front step 38 | int front_index = urg.step2index(0); 39 | print_echo_data(data, front_index, urg.max_echo_size()); 40 | cout << time_stamp << endl; 41 | 42 | #else 43 | static_cast(urg); 44 | 45 | // \~japanese 全てのデータを表示 46 | // \~english Prints the multiecho distance for all the measurement points 47 | size_t data_n = data.size(); 48 | cout << "# n = " << data_n << ", timestamp = " << time_stamp << endl; 49 | 50 | int max_echo_size = urg.max_echo_size(); 51 | for (size_t i = 0; i < data_n; ++i) { 52 | print_echo_data(data, i, max_echo_size); 53 | cout << endl; 54 | } 55 | cout << endl; 56 | #endif 57 | } 58 | } 59 | 60 | 61 | int main(int argc, char *argv[]) 62 | { 63 | Connection_information information(argc, argv); 64 | 65 | // \~japanese 接続 66 | // \~english Connects to the sensor 67 | Urg_driver urg; 68 | if (!urg.open(information.device_or_ip_name(), 69 | information.baudrate_or_port_number(), 70 | information.connection_type())) { 71 | cout << "Urg_driver::open(): " 72 | << information.device_or_ip_name() << ": " << urg.what() << endl; 73 | return 1; 74 | } 75 | 76 | // \~japanese データ取得 77 | // \~english Gets measurement data 78 | enum { Capture_times = 10 }; 79 | urg.start_measurement(Urg_driver::Multiecho, Urg_driver::Infinity_times, 0); 80 | for (int i = 0; i < Capture_times; ++i) { 81 | vector data; 82 | long time_stamp = 0; 83 | 84 | if (!urg.get_multiecho(data, &time_stamp)) { 85 | cout << "Urg_driver::get_distance(): " << urg.what() << endl; 86 | return 1; 87 | } 88 | print_data(urg, data, time_stamp); 89 | } 90 | 91 | #if defined(URG_MSC) 92 | getchar(); 93 | #endif 94 | return 0; 95 | } 96 | -------------------------------------------------------------------------------- /current/samples/cpp/get_multiecho_intensity.cpp: -------------------------------------------------------------------------------- 1 | /*! 2 | \~japanese 3 | \example get_multiecho_intensity.cpp 距離・強度データ(マルチエコー)を取得する 4 | \~english 5 | \example get_multiecho_intensity.cpp Obtains multiecho distance and intensity data 6 | \~ 7 | \author Satofumi KAMIMURA 8 | 9 | $Id$ 10 | */ 11 | 12 | #include "Urg_driver.h" 13 | #include "Connection_information.h" 14 | #include 15 | 16 | using namespace qrk; 17 | using namespace std; 18 | 19 | 20 | // \~japanese 距離、強度のデータを表示する 21 | // \~english Prints distance and intensity data 22 | namespace 23 | { 24 | void print_echo_data(const vector& data, 25 | const vector intensity, 26 | int index, int max_echo_size) 27 | { 28 | // [mm] 29 | for (int i = 0; i < max_echo_size; ++i) { 30 | cout << data[(max_echo_size * index) + i] << ", "; 31 | } 32 | 33 | // [1] 34 | for (int i = 0; i < max_echo_size; ++i) { 35 | cout << intensity[(max_echo_size * index) + i] << ", "; 36 | } 37 | } 38 | 39 | 40 | void print_data(const Urg_driver& urg, 41 | const vector& data, 42 | const vector& intensity, 43 | long time_stamp) 44 | { 45 | #if 1 46 | // \~japanese 前方のデータのみを表示 47 | // \~english Shows only the front step 48 | int front_index = urg.step2index(0); 49 | print_echo_data(data, intensity, front_index, urg.max_echo_size()); 50 | cout << time_stamp << endl; 51 | 52 | #else 53 | static_cast(urg); 54 | 55 | // \~japanese 全てのデータを表示 56 | // \~english Prints the multiecho range/intensity values for all the measurement points 57 | size_t data_n = data.size(); 58 | cout << "# n = " << data_n << ", timestamp = " << time_stamp << endl; 59 | 60 | int max_echo_size = urg.max_echo_size(); 61 | for (size_t i = 0; i < data_n; ++i) { 62 | print_echo_data(data, intensity, i, max_echo_size); 63 | cout << endl; 64 | } 65 | cout << endl; 66 | #endif 67 | } 68 | } 69 | 70 | 71 | int main(int argc, char *argv[]) 72 | { 73 | Connection_information information(argc, argv); 74 | 75 | // \~japanese 接続 76 | // \~english Connects to the sensor 77 | Urg_driver urg; 78 | if (!urg.open(information.device_or_ip_name(), 79 | information.baudrate_or_port_number(), 80 | information.connection_type())) { 81 | cout << "Urg_driver::open(): " 82 | << information.device_or_ip_name() << ": " << urg.what() << endl; 83 | return 1; 84 | } 85 | 86 | // \~japanese データ取得 87 | // \~english Gets measurement data 88 | enum { Capture_times = 10 }; 89 | urg.start_measurement(Urg_driver::Multiecho_intensity, Urg_driver::Infinity_times, 0); 90 | for (int i = 0; i < Capture_times; ++i) { 91 | vector data; 92 | vector intensity; 93 | long time_stamp = 0; 94 | 95 | if (!urg.get_multiecho_intensity(data, intensity, &time_stamp)) { 96 | cout << "Urg_driver::get_distance(): " << urg.what() << endl; 97 | return 1; 98 | } 99 | print_data(urg, data, intensity, time_stamp); 100 | } 101 | 102 | #if defined(URG_MSC) 103 | getchar(); 104 | #endif 105 | return 0; 106 | } 107 | -------------------------------------------------------------------------------- /current/samples/cpp/sensor_parameter.cpp: -------------------------------------------------------------------------------- 1 | /*! 2 | \~japanese 3 | \example sensor_parameter.cpp センサ情報の出力 4 | \~english 5 | \example sensor_parameter.cpp Outputs sensor information fields 6 | \~ 7 | \author Satofumi KAMIMURA 8 | 9 | $Id$ 10 | */ 11 | 12 | #include "Urg_driver.h" 13 | #include "Connection_information.h" 14 | #include 15 | 16 | using namespace qrk; 17 | using namespace std; 18 | 19 | 20 | int main(int argc, char *argv[]) 21 | { 22 | Connection_information information(argc, argv); 23 | 24 | // \~japanese 接続 25 | // \~english Connects to the sensor 26 | Urg_driver urg; 27 | if (!urg.open(information.device_or_ip_name(), 28 | information.baudrate_or_port_number(), 29 | information.connection_type())) { 30 | cout << "Urg_driver::open():" 31 | << information.device_or_ip_name() << ": " << urg.what() << endl; 32 | return 1; 33 | } 34 | 35 | // \~japanese パラメータ情報の表示 36 | // \~english Displays sensor parameters 37 | cout << "Sensor product type: " << urg.product_type() << endl; 38 | cout << "Sensor firmware version: " << urg.firmware_version() << endl; 39 | cout << "Sensor serial ID: " << urg.serial_id() << endl; 40 | cout << "Sensor status: " << urg.status() << endl; 41 | cout << "Sensor state: " << urg.state() << endl; 42 | 43 | cout << "step: [" 44 | << urg.min_step() << ", " 45 | << urg.max_step() << "]" << endl; 46 | cout << "distance: [" 47 | << urg.min_distance() 48 | << ", " << urg.max_distance() << endl; 49 | 50 | cout << "scan interval: " << urg.scan_usec() << " [usec]" << endl; 51 | cout << "sensor data size: " << urg.max_data_size() << endl; 52 | 53 | urg.close(); 54 | 55 | #if defined(URG_MSC) 56 | getchar(); 57 | #endif 58 | return 0; 59 | } 60 | -------------------------------------------------------------------------------- /current/samples/cpp/sync_time_stamp.cpp: -------------------------------------------------------------------------------- 1 | /*! 2 | \~japanese 3 | \example sync_time_stamp.cpp センサと PC のタイムスタンプを同期する 4 | \~english 5 | \example sync_time_stamp.cpp Timestamp synchronization between PC and sensor 6 | \~ 7 | \author Satofumi KAMIMURA 8 | 9 | $Id$ 10 | */ 11 | 12 | #include "Urg_driver.h" 13 | #include "Connection_information.h" 14 | #include "ticks.h" 15 | #include 16 | 17 | using namespace qrk; 18 | using namespace std; 19 | 20 | 21 | namespace 22 | { 23 | void print_timestamp(Urg_driver& urg) 24 | { 25 | enum { Print_times = 3 }; 26 | urg.start_time_stamp_mode(); 27 | 28 | for (int i = 0; i < Print_times; ++i) { 29 | cout << ticks() << ", " << urg.get_sensor_time_stamp() << endl; 30 | } 31 | 32 | urg.stop_time_stamp_mode(); 33 | } 34 | } 35 | 36 | 37 | int main(int argc, char *argv[]) 38 | { 39 | Connection_information information(argc, argv); 40 | 41 | // \~japanese 接続 42 | // \~english Connects to the sensor 43 | Urg_driver urg; 44 | if (!urg.open(information.device_or_ip_name(), 45 | information.baudrate_or_port_number(), 46 | information.connection_type())) { 47 | cout << "Urg_driver::open(): " 48 | << information.device_or_ip_name() << ": " << urg.what() << endl; 49 | return 1; 50 | } 51 | 52 | cout << "# pc,\tsensor" << endl; 53 | 54 | // \~japanese 比較用に PC とセンサのタイムスタンプを表示する 55 | // \~english Just to compare, shows the current PC timestamp and sensor timestamp 56 | print_timestamp(urg); 57 | cout << endl; 58 | 59 | // \~japanese センサに PC のタイムスタンプを設定し、 60 | // \~japanese 距離データを取得したときに得られるタイムスタンプが、 61 | // \~japanese PC から得られるタイムスタンプと同じになるようにする 62 | // \~english Configures the PC timestamp into the sensor 63 | // \~english The timestamp value which comes in the measurement data 64 | // \~english will match the timestamp value from the PC 65 | urg.set_sensor_time_stamp(ticks()); 66 | 67 | // \~japanese 設定後に PC とセンサのタイムスタンプを表示する 68 | // \~english Displays the PC timestamp and sensor timestamp after configuration 69 | print_timestamp(urg); 70 | 71 | return 0; 72 | } 73 | -------------------------------------------------------------------------------- /current/src/Makefile: -------------------------------------------------------------------------------- 1 | # Makefile for libs/c 2 | # $Id$ 3 | 4 | # Compile options 5 | CC = gcc 6 | CXX = g++ 7 | #CFLAGS = -O2 -Wall -Werror -W $(INCLUDES) 8 | CFLAGS = -g -O0 -Wall -Werror -W -I../include/c $(INCLUDES) 9 | CXXFLAGS = $(CFLAGS) -I../include/cpp 10 | INCLUDES = 11 | LDFLAGS = 12 | LDLIBS = 13 | 14 | # Target 15 | URG_C_LIB_STATIC = liburg_c.a 16 | URG_C_LIB_SHARED = $(shell if test `echo $(OS) | grep Windows`; then echo "urg_c.dll"; else echo "liburg_c.so"; fi) 17 | URG_CPP_LIB_STATIC = liburg_cpp.a 18 | URG_CPP_LIB_SHARED = $(shell if test `echo $(OS) | grep Windows`; then echo "urg_cpp.dll"; else echo "liburg_cpp.so"; fi) 19 | 20 | TARGET = $(URG_C_LIB_STATIC) $(URG_CPP_LIB_STATIC) \ 21 | $(URG_C_LIB_SHARED) $(URG_CPP_LIB_SHARED) 22 | 23 | OBJ_C = urg_sensor.o urg_utils.o urg_debug.o urg_connection.o \ 24 | urg_ring_buffer.o urg_serial.o urg_serial_utils.o urg_tcpclient.o 25 | OBJ_CPP = ticks.o Urg_driver.o 26 | 27 | CFLAGS = -g -O2 $(INCLUDES) -I../include/c -fPIC 28 | CXXFLAGS = $(CFLAGS) -I../include/cpp -std=c++11 29 | LDLIBS = -lm $(shell if test `echo $(OS) | grep Windows`; then echo "-lwsock32 -lsetupapi"; fi) 30 | 31 | all : $(TARGET) 32 | 33 | clean : 34 | $(RM) *.o $(TARGET) 35 | 36 | depend : 37 | makedepend -Y -- $(INCLUDES) -- $(wildcard *.h *.c) 38 | 39 | .PHONY : all clean depend 40 | ###################################################################### 41 | $(URG_C_LIB_STATIC) : $(OBJ_C) 42 | $(AR) rv $@ $(OBJ_C) 43 | 44 | $(URG_C_LIB_SHARED) : $(OBJ_C) 45 | $(CC) $(CFLAGS) -shared -o $@ $(OBJ_C) $(LDLIBS) 46 | 47 | $(URG_CPP_LIB_STATIC) : $(OBJ_C) $(OBJ_CPP) 48 | $(AR) rv $@ $(OBJ_C) $(OBJ_CPP) 49 | 50 | $(URG_CPP_LIB_SHARED) : $(OBJ_C) $(OBJ_CPP) 51 | $(CXX) $(CXXFLAGS) -shared -o $@ $(OBJ_C) $(OBJ_CPP) $(LDLIBS) 52 | 53 | urg_serial_utils.o : urg_serial_utils_windows.c urg_serial_utils_linux.c 54 | -------------------------------------------------------------------------------- /current/src/Makefile.release: -------------------------------------------------------------------------------- 1 | URG_C_LIB_STATIC = liburg_c.a 2 | URG_C_LIB_SHARED = $(shell if test `echo $(OS) | grep Windows`; then echo "urg_c.dll"; else echo "liburg_c.so"; fi) 3 | URG_CPP_LIB_STATIC = liburg_cpp.a 4 | URG_CPP_LIB_SHARED = $(shell if test `echo $(OS) | grep Windows`; then echo "urg_cpp.dll"; else echo "liburg_cpp.so"; fi) 5 | 6 | TARGET = $(URG_C_LIB_STATIC) $(URG_CPP_LIB_STATIC) \ 7 | $(URG_C_LIB_SHARED) $(URG_CPP_LIB_SHARED) 8 | 9 | OBJ_C = urg_sensor.o urg_utils.o urg_debug.o urg_connection.o \ 10 | urg_ring_buffer.o urg_serial.o urg_serial_utils.o urg_tcpclient.o 11 | OBJ_CPP = ticks.o Urg_driver.o 12 | 13 | include ../build_rule.mk 14 | 15 | CFLAGS = -g -O2 $(INCLUDES) -I../include/c -fPIC 16 | CXXFLAGS = $(CFLAGS) -I../include/cpp 17 | LDLIBS = -lm $(shell if test `echo $(OS) | grep Windows`; then echo "-lwsock32 -lsetupapi"; fi) 18 | 19 | all : $(TARGET) 20 | 21 | clean : 22 | $(RM) *.o $(TARGET) 23 | 24 | $(URG_C_LIB_STATIC) : $(OBJ_C) 25 | $(AR) rv $@ $(OBJ_C) 26 | 27 | $(URG_C_LIB_SHARED) : $(OBJ_C) 28 | $(CC) $(CFLAGS) -shared -o $@ $(OBJ_C) $(LDLIBS) 29 | 30 | $(URG_CPP_LIB_STATIC) : $(OBJ_C) $(OBJ_CPP) 31 | $(AR) rv $@ $(OBJ_C) $(OBJ_CPP) 32 | 33 | $(URG_CPP_LIB_SHARED) : $(OBJ_C) $(OBJ_CPP) 34 | $(CXX) $(CXXFLAGS) -shared -o $@ $(OBJ_C) $(OBJ_CPP) $(LDLIBS) 35 | 36 | urg_serial_utils.o : urg_serial_utils_windows.c urg_serial_utils_linux.c 37 | -------------------------------------------------------------------------------- /current/src/ticks.cpp: -------------------------------------------------------------------------------- 1 | /*! 2 | \file 3 | \~japanese 4 | \brief タイムスタンプの取得 5 | \~english 6 | \brief Gets computer timestamp 7 | \~ 8 | \author Satofumi KAMIMURA 9 | 10 | $Id$ 11 | */ 12 | 13 | #include "ticks.h" 14 | #include "detect_os.h" 15 | #include 16 | 17 | #ifdef __MACH__ 18 | #include 19 | #include 20 | #endif 21 | 22 | void gettime(struct timespec *ts) 23 | { 24 | #ifdef __MACH__ // OS X does not have clock_gettime, use clock_get_time 25 | clock_serv_t cclock; 26 | mach_timespec_t mts; 27 | host_get_clock_service(mach_host_self(), CALENDAR_CLOCK, &cclock); 28 | clock_get_time(cclock, &mts); 29 | mach_port_deallocate(mach_task_self(), cclock); 30 | ts->tv_sec = mts.tv_sec; 31 | ts->tv_nsec = mts.tv_nsec; 32 | 33 | #else 34 | #ifndef QRK_WINDOWS_OS 35 | clock_gettime(CLOCK_REALTIME, ts); 36 | #endif 37 | #endif 38 | } 39 | 40 | 41 | long qrk::ticks(void) 42 | { 43 | static bool is_initialized = false; 44 | #if defined(QRK_WINDOWS_OS) 45 | clock_t current_clock; 46 | #else 47 | static struct timespec first_spec; 48 | struct timespec current_spec; 49 | #endif 50 | long msec_time; 51 | 52 | #if defined(QRK_WINDOWS_OS) 53 | if (!is_initialized) { 54 | is_initialized = true; 55 | } 56 | current_clock = clock(); 57 | msec_time = current_clock / (CLOCKS_PER_SEC / 1000); 58 | #else 59 | if (!is_initialized) { 60 | gettime(&first_spec); 61 | is_initialized = true; 62 | } 63 | gettime(¤t_spec); 64 | msec_time = 65 | (current_spec.tv_sec - first_spec.tv_sec) * 1000 66 | + (current_spec.tv_nsec - first_spec.tv_nsec) / 1000000; 67 | #endif 68 | return msec_time; 69 | } 70 | -------------------------------------------------------------------------------- /current/src/urg_connection.c: -------------------------------------------------------------------------------- 1 | /*! 2 | \file 3 | \~japanese 4 | \brief 通信の処理 5 | \~english 6 | \brief Communication related functions 7 | \~ 8 | \author Satofumi KAMIMURA 9 | 10 | $Id$ 11 | */ 12 | 13 | #include "urg_connection.h" 14 | 15 | 16 | int connection_open(urg_connection_t *connection, 17 | urg_connection_type_t connection_type, 18 | const char *device, long baudrate_or_port) 19 | { 20 | connection->type = connection_type; 21 | 22 | switch (connection_type) { 23 | case URG_SERIAL: 24 | return serial_open(&connection->serial, device, baudrate_or_port); 25 | break; 26 | 27 | case URG_ETHERNET: 28 | return tcpclient_open(&connection->tcpclient, 29 | device, baudrate_or_port); 30 | break; 31 | } 32 | return -1; 33 | } 34 | 35 | 36 | void connection_close(urg_connection_t *connection) 37 | { 38 | switch (connection->type) { 39 | case URG_SERIAL: 40 | serial_close(&connection->serial); 41 | break; 42 | 43 | case URG_ETHERNET: 44 | tcpclient_close(&connection->tcpclient); 45 | break; 46 | } 47 | } 48 | 49 | 50 | int connection_set_baudrate(urg_connection_t *connection, long baudrate) 51 | { 52 | int ret = -1; 53 | 54 | switch (connection->type) { 55 | case URG_SERIAL: 56 | ret = serial_set_baudrate(&connection->serial, baudrate); 57 | break; 58 | 59 | case URG_ETHERNET: 60 | ret = 0; 61 | break; 62 | } 63 | 64 | return ret; 65 | } 66 | 67 | 68 | int connection_write(urg_connection_t *connection, 69 | const char *data, int size) 70 | { 71 | switch (connection->type) { 72 | case URG_SERIAL: 73 | return serial_write(&connection->serial, data, size); 74 | break; 75 | case URG_ETHERNET: 76 | return tcpclient_write(&connection->tcpclient, data, size); 77 | break; 78 | } 79 | return -1; 80 | } 81 | 82 | 83 | int connection_read(urg_connection_t *connection, 84 | char *data, int max_size, int timeout) 85 | { 86 | switch (connection->type) { 87 | case URG_SERIAL: 88 | return serial_read(&connection->serial, data, max_size, timeout); 89 | break; 90 | case URG_ETHERNET: 91 | return tcpclient_read(&connection->tcpclient, data, max_size, timeout); 92 | break; 93 | } 94 | return -1; 95 | } 96 | 97 | 98 | int connection_readline(urg_connection_t *connection, 99 | char *data, int max_size, int timeout) 100 | { 101 | switch (connection->type) { 102 | case URG_SERIAL: 103 | return serial_readline(&connection->serial, data, max_size, timeout); 104 | break; 105 | case URG_ETHERNET: 106 | return tcpclient_readline(&connection->tcpclient, 107 | data, max_size, timeout); 108 | break; 109 | } 110 | return -1; 111 | } 112 | -------------------------------------------------------------------------------- /current/src/urg_debug.c: -------------------------------------------------------------------------------- 1 | /*! 2 | \~japanese 3 | \brief URG センサ用の補助関数 4 | \~english Auxiliary functions (read and write raw data) 5 | \brief 6 | \~ 7 | \author Satofumi KAMIMURA 8 | 9 | $Id$ 10 | */ 11 | 12 | #include "urg_debug.h" 13 | 14 | 15 | int urg_raw_write(urg_t *urg, const char *data, int data_size) 16 | { 17 | return connection_write(&urg->connection, data, data_size); 18 | } 19 | 20 | 21 | int urg_raw_read(urg_t *urg, char *data, int max_data_size, int timeout) 22 | { 23 | return connection_read(&urg->connection, data, max_data_size, timeout); 24 | } 25 | 26 | 27 | int urg_raw_readline(urg_t *urg, char *data, int max_data_size, int timeout) 28 | { 29 | return connection_readline(&urg->connection, data, max_data_size, timeout); 30 | } 31 | -------------------------------------------------------------------------------- /current/src/urg_ring_buffer.c: -------------------------------------------------------------------------------- 1 | /*! 2 | \file 3 | \~japanese 4 | \brief リングバッファ 5 | \~english 6 | \brief Implements a ring buffer 7 | \~ 8 | \author Satofumi KAMIMURA 9 | 10 | $Id$ 11 | */ 12 | 13 | #include "urg_ring_buffer.h" 14 | 15 | 16 | void ring_initialize(ring_buffer_t *ring, char *buffer, const int shift_length) 17 | { 18 | ring->buffer = buffer; 19 | ring->buffer_size = 1 << shift_length; 20 | ring_clear(ring); 21 | } 22 | 23 | 24 | void ring_clear(ring_buffer_t *ring) 25 | { 26 | ring->first = 0; 27 | ring->last = 0; 28 | } 29 | 30 | 31 | int ring_size(const ring_buffer_t *ring) 32 | { 33 | int first = ring->first; 34 | int last = ring->last; 35 | 36 | return (last >= first) ? last - first : ring->buffer_size - (first - last); 37 | } 38 | 39 | 40 | int ring_capacity(const ring_buffer_t *ring) 41 | { 42 | return ring->buffer_size - 1; 43 | } 44 | 45 | 46 | static void byte_move(char *dest, const char *src, int n) 47 | { 48 | const char *last_p = dest + n; 49 | while (dest < last_p) { 50 | *dest++ = *src++; 51 | } 52 | } 53 | 54 | 55 | int ring_write(ring_buffer_t *ring, const char *data, int size) 56 | { 57 | int free_size = ring_capacity(ring) - ring_size(ring); 58 | int push_size = (size > free_size) ? free_size : size; 59 | 60 | // \~japanese データ配置 61 | // \~english Stores the data 62 | if (ring->first <= ring->last) { 63 | // \~japanese last から buffer_size 終端までに配置 64 | // \~english Stores data at the last element of the buffer and before buffer_size 65 | int left_size = 0; 66 | int to_end = ring->buffer_size - ring->last; 67 | int move_size = (to_end > push_size) ? push_size : to_end; 68 | 69 | byte_move(&ring->buffer[ring->last], data, move_size); 70 | ring->last += move_size; 71 | ring->last &= (ring->buffer_size -1); 72 | 73 | left_size = push_size - move_size; 74 | if (left_size > 0) { 75 | // \~japanese 0 から first の前までを配置 76 | // \~english Stores data before the first element 77 | byte_move(ring->buffer, &data[move_size], left_size); 78 | ring->last = left_size; 79 | } 80 | } else { 81 | // \~japanese last から first の前まで配置 82 | // \~english Stores data from last towards first 83 | byte_move(&ring->buffer[ring->last], data, size); 84 | ring->last += push_size; 85 | } 86 | return push_size; 87 | } 88 | 89 | 90 | int ring_read(ring_buffer_t *ring, char *buffer, int size) 91 | { 92 | // \~japanese データ取得 93 | // \~english Reads data 94 | int now_size = ring_size(ring); 95 | int pop_size = (size > now_size) ? now_size : size; 96 | 97 | if (ring->first <= ring->last) { 98 | byte_move(buffer, &ring->buffer[ring->first], pop_size); 99 | ring->first += pop_size; 100 | 101 | } else { 102 | // \~japanese first から buffer_size 終端までを配置 103 | // \~english Gets data from first element of the buffer and before buffer_size 104 | int left_size = 0; 105 | int to_end = ring->buffer_size - ring->first; 106 | int move_size = (to_end > pop_size) ? pop_size : to_end; 107 | byte_move(buffer, &ring->buffer[ring->first], move_size); 108 | 109 | ring->first += move_size; 110 | ring->first &= (ring->buffer_size -1); 111 | 112 | left_size = pop_size - move_size; 113 | if (left_size > 0) { 114 | // \~japanese 0 から last の前までを配置 115 | // \~english Gets data before the last element 116 | byte_move(&buffer[move_size], ring->buffer, left_size); 117 | 118 | ring->first = left_size; 119 | } 120 | } 121 | return pop_size; 122 | } 123 | -------------------------------------------------------------------------------- /current/src/urg_serial.c: -------------------------------------------------------------------------------- 1 | /*! 2 | \file 3 | \~japanese 4 | \brief シリアル通信 5 | \~english 6 | \brief Serial communications 7 | \~ 8 | \author Satofumi KAMIMURA 9 | 10 | $Id$ 11 | */ 12 | 13 | #include "urg_serial.h" 14 | 15 | 16 | enum { 17 | False = 0, 18 | True, 19 | }; 20 | 21 | 22 | #if defined(URG_WINDOWS_OS) 23 | #include "urg_serial_windows.c" 24 | #else 25 | #include "urg_serial_linux.c" 26 | #endif 27 | 28 | 29 | // \~japanese 改行かどうかの判定 30 | // \~english Checks wheter is is a EOL character 31 | static int is_linefeed(const char ch) 32 | { 33 | return ((ch == '\r') || (ch == '\n')) ? 1 : 0; 34 | } 35 | 36 | 37 | static void serial_ungetc(urg_serial_t *serial, char ch) 38 | { 39 | serial->has_last_ch = True; 40 | serial->last_ch = ch; 41 | } 42 | 43 | 44 | int serial_readline(urg_serial_t *serial, char *data, int max_size, int timeout) 45 | { 46 | /* \~japanese 1文字ずつ読み出して評価する */ 47 | /* \~english Reads and evaluates 1 character at a time */ 48 | int filled = 0; 49 | int is_timeout = 0; 50 | 51 | while (filled < max_size) { 52 | char recv_ch; 53 | int n = serial_read(serial, &recv_ch, 1, timeout); 54 | if (n <= 0) { 55 | is_timeout = 1; 56 | break; 57 | } else if (is_linefeed(recv_ch)) { 58 | break; 59 | } 60 | data[filled++] = recv_ch; 61 | } 62 | if (filled >= max_size) { 63 | --filled; 64 | serial_ungetc(serial, data[filled]); 65 | } 66 | data[filled] = '\0'; 67 | 68 | if ((filled == 0) && is_timeout) { 69 | return -1; 70 | } else { 71 | //fprintf(stderr, "%s\n", data); 72 | return filled; 73 | } 74 | } 75 | -------------------------------------------------------------------------------- /current/src/urg_serial_linux.c: -------------------------------------------------------------------------------- 1 | /*! 2 | \file 3 | \~japanese 4 | \brief シリアル通信 5 | \~english Serial communications in Linux 6 | \~ 7 | \author Satofumi KAMIMURA 8 | 9 | $Id$ 10 | */ 11 | 12 | #include "urg_ring_buffer.h" 13 | #include 14 | #include 15 | #include 16 | 17 | 18 | enum { 19 | INVALID_FD = -1, 20 | }; 21 | 22 | 23 | static void serial_initialize(urg_serial_t *serial) 24 | { 25 | serial->fd = INVALID_FD; 26 | serial->has_last_ch = False; 27 | 28 | ring_initialize(&serial->ring, serial->buffer, RING_BUFFER_SIZE_SHIFT); 29 | } 30 | 31 | 32 | static void serial_clear(urg_serial_t* serial) 33 | { 34 | tcdrain(serial->fd); 35 | tcflush(serial->fd, TCIOFLUSH); 36 | ring_clear(&serial->ring); 37 | serial->has_last_ch = False; 38 | } 39 | 40 | 41 | int serial_open(urg_serial_t *serial, const char *device, long baudrate) 42 | { 43 | int flags = 0; 44 | int ret = 0; 45 | 46 | serial_initialize(serial); 47 | 48 | #ifndef URG_MAC_OS 49 | enum { O_EXLOCK = 0x0 }; /* \~japanese Linux では使えないのでダミーを作成しておく \~english Not used in Linux, used as dummy */ 50 | #endif 51 | serial->fd = open(device, O_RDWR | O_EXLOCK | O_NONBLOCK | O_NOCTTY); 52 | if (serial->fd < 0) { 53 | /* \~japanese 接続に失敗 \~english Connection failed */ 54 | //strerror_r(errno, serial->error_string, ERROR_MESSAGE_SIZE); 55 | return -1; 56 | } 57 | 58 | flags = fcntl(serial->fd, F_GETFL, 0); 59 | fcntl(serial->fd, F_SETFL, flags & ~O_NONBLOCK); 60 | 61 | /* \~japanese シリアル通信の初期化 \~english Initializes serial communication */ 62 | tcgetattr(serial->fd, &serial->sio); 63 | serial->sio.c_iflag = 0; 64 | serial->sio.c_oflag = 0; 65 | serial->sio.c_cflag &= ~(CSIZE | PARENB | CSTOPB); 66 | serial->sio.c_cflag |= CS8 | CREAD | CLOCAL; 67 | serial->sio.c_lflag &= ~(ICANON | ECHO | ISIG | IEXTEN); 68 | 69 | serial->sio.c_cc[VMIN] = 0; 70 | serial->sio.c_cc[VTIME] = 0; 71 | 72 | /* \~japanese ボーレートの変更 ~\english Changes the baudrate */ 73 | ret = serial_set_baudrate(serial, baudrate); 74 | if (ret < 0) { 75 | return ret; 76 | } 77 | 78 | /* \~japanese シリアル制御構造体の初期化 \~english Initializes serial control structures */ 79 | serial->has_last_ch = False; 80 | 81 | return 0; 82 | } 83 | 84 | 85 | void serial_close(urg_serial_t *serial) 86 | { 87 | if (serial->fd >= 0) { 88 | close(serial->fd); 89 | serial->fd = INVALID_FD; 90 | } 91 | } 92 | 93 | 94 | int serial_set_baudrate(urg_serial_t *serial, long baudrate) 95 | { 96 | long baudrate_value = -1; 97 | 98 | switch (baudrate) { 99 | case 4800: 100 | baudrate_value = B4800; 101 | break; 102 | 103 | case 9600: 104 | baudrate_value = B9600; 105 | break; 106 | 107 | case 19200: 108 | baudrate_value = B19200; 109 | break; 110 | 111 | case 38400: 112 | baudrate_value = B38400; 113 | break; 114 | 115 | case 57600: 116 | baudrate_value = B57600; 117 | break; 118 | 119 | case 115200: 120 | baudrate_value = B115200; 121 | break; 122 | 123 | default: 124 | return -1; 125 | } 126 | 127 | /* \~japanese ボーレート変更 \~english Changes the baudrate */ 128 | cfsetospeed(&serial->sio, baudrate_value); 129 | cfsetispeed(&serial->sio, baudrate_value); 130 | tcsetattr(serial->fd, TCSADRAIN, &serial->sio); 131 | serial_clear(serial); 132 | 133 | return 0; 134 | } 135 | 136 | 137 | int serial_write(urg_serial_t *serial, const char *data, int size) 138 | { 139 | if (serial->fd == INVALID_FD) { 140 | return -1; 141 | } 142 | return write(serial->fd, data, size); 143 | } 144 | 145 | 146 | static int wait_receive(urg_serial_t* serial, int timeout) 147 | { 148 | fd_set rfds; 149 | struct timeval tv; 150 | 151 | // \~japanese タイムアウト設定 152 | // \~english Configures the timeout 153 | FD_ZERO(&rfds); 154 | FD_SET(serial->fd, &rfds); 155 | 156 | tv.tv_sec = timeout / 1000; 157 | tv.tv_usec = (timeout % 1000) * 1000; 158 | 159 | if (select(serial->fd + 1, &rfds, NULL, NULL, 160 | (timeout < 0) ? NULL : &tv) <= 0) { 161 | /* \~japanese タイムアウト発生 \~english Timeout occurred */ 162 | return 0; 163 | } 164 | return 1; 165 | } 166 | 167 | 168 | static int internal_receive(char data[], int data_size_max, 169 | urg_serial_t* serial, int timeout) 170 | { 171 | int filled = 0; 172 | 173 | if (data_size_max <= 0) { 174 | return 0; 175 | } 176 | 177 | while (filled < data_size_max) { 178 | int require_n; 179 | int read_n; 180 | 181 | if (! wait_receive(serial, timeout)) { 182 | break; 183 | } 184 | 185 | require_n = data_size_max - filled; 186 | read_n = read(serial->fd, &data[filled], require_n); 187 | if (read_n <= 0) { 188 | /* \~japanese 読み出しエラー。現在までの受信内容で戻る \~english Read error, returns all the data up to now */ 189 | break; 190 | } 191 | filled += read_n; 192 | } 193 | return filled; 194 | } 195 | 196 | 197 | int serial_read(urg_serial_t *serial, char *data, int max_size, int timeout) 198 | { 199 | int buffer_size; 200 | int read_n; 201 | int filled = 0; 202 | 203 | if (max_size <= 0) { 204 | return 0; 205 | } 206 | 207 | /* \~japanese 書き戻した1文字があれば、書き出す \~english If there is a single character return it */ 208 | if (serial->has_last_ch != False) { 209 | data[0] = serial->last_ch; 210 | serial->has_last_ch = False; 211 | ++filled; 212 | } 213 | if (serial->fd == INVALID_FD) { 214 | if (filled > 0) { 215 | return filled; 216 | } else { 217 | return -1; 218 | } 219 | } 220 | 221 | buffer_size = ring_size(&serial->ring); 222 | read_n = max_size - filled; 223 | if (buffer_size < read_n) { 224 | // \~japanese リングバッファ内のデータで足りなければ、データを読み足す 225 | // \~english Reads data if there is space in the ring buffer 226 | char buffer[RING_BUFFER_SIZE]; 227 | int n = internal_receive(buffer, 228 | ring_capacity(&serial->ring) - buffer_size, 229 | serial, 0); 230 | if (n > 0) { 231 | ring_write(&serial->ring, buffer, n); 232 | buffer_size += n; 233 | } 234 | } 235 | 236 | // \~japanese リングバッファ内のデータを返す 237 | // \~english Returns the data stored in the ring buffer 238 | if (read_n > buffer_size) { 239 | read_n = buffer_size; 240 | } 241 | if (read_n > 0) { 242 | ring_read(&serial->ring, &data[filled], read_n); 243 | filled += read_n; 244 | } 245 | 246 | // \~japanese データをタイムアウト付きで読み出す 247 | // \~english Reads data within the given timeout 248 | filled += internal_receive(&data[filled], max_size - filled, 249 | serial, timeout); 250 | return filled; 251 | } 252 | -------------------------------------------------------------------------------- /current/src/urg_serial_utils.c: -------------------------------------------------------------------------------- 1 | /*! 2 | \file 3 | \~japanese 4 | \brief シリアル用の補助関数 5 | \~english 6 | \brief Serial communications auxiliary functions 7 | \~ 8 | \author Satofumi KAMIMURA 9 | 10 | $Id$ 11 | */ 12 | 13 | #include "urg_serial_utils.h" 14 | #include "urg_detect_os.h" 15 | 16 | 17 | #if defined(URG_WINDOWS_OS) 18 | #include "urg_serial_utils_windows.c" 19 | #else 20 | #include "urg_serial_utils_linux.c" 21 | #endif 22 | -------------------------------------------------------------------------------- /current/src/urg_serial_utils_linux.c: -------------------------------------------------------------------------------- 1 | /*! 2 | \file 3 | \~japanese 4 | \brief シリアル用の補助関数 5 | \~english 6 | \brief Serial communication auxiliary functions for Linux 7 | \~ 8 | 9 | \author Satofumi KAMIMURA 10 | 11 | $Id$ 12 | */ 13 | 14 | #include "urg_serial_utils.h" 15 | #include 16 | #include 17 | #include 18 | #include 19 | 20 | 21 | enum { 22 | MAX_PORTS = 16, 23 | DEVICE_NAME_SIZE = 255, 24 | }; 25 | 26 | 27 | static char found_ports[MAX_PORTS][DEVICE_NAME_SIZE]; 28 | static int found_ports_size = 0; 29 | 30 | static const char *search_dir_names[] = { 31 | "/dev", 32 | "/dev/usb", 33 | }; 34 | static const char *search_base_names[] = { 35 | "ttyACM", 36 | "ttyUSB", 37 | "tty.usbmodem", 38 | }; 39 | 40 | 41 | static void check_base_name(const char* dir_name, const char *file_name) 42 | { 43 | int n = sizeof(search_base_names) / sizeof(search_base_names[0]); 44 | int i; 45 | 46 | for (i = 0; i < n; ++i) { 47 | const char *base_name = search_base_names[i]; 48 | if (!strncmp(base_name, file_name, strlen(base_name))) { 49 | snprintf(found_ports[found_ports_size], DEVICE_NAME_SIZE, 50 | "%s/%s", dir_name, file_name); 51 | ++found_ports_size; 52 | } 53 | } 54 | } 55 | 56 | 57 | int urg_serial_find_port(void) 58 | { 59 | int n = sizeof(search_dir_names) / sizeof(search_dir_names[0]); 60 | int i; 61 | 62 | found_ports_size = 0; 63 | for (i = 0; i < n; ++i) { 64 | struct dirent* dir; 65 | const char *dir_name = search_dir_names[i]; 66 | DIR *dp = opendir(dir_name); 67 | if (!dp) { 68 | continue; 69 | } 70 | 71 | while ((dir = readdir(dp))) { 72 | check_base_name(dir_name, dir->d_name); 73 | } 74 | } 75 | return found_ports_size; 76 | } 77 | 78 | 79 | const char *urg_serial_port_name(int index) 80 | { 81 | if ((index < 0) || (index >= found_ports_size)) { 82 | return ""; 83 | } else { 84 | return found_ports[index]; 85 | } 86 | } 87 | 88 | 89 | int urg_serial_is_urg_port(int index) 90 | { 91 | // \~japanese Linux の場合、ポートが URG かどうかは断定できない 92 | // \~japanese !!! 余力があれば、dmesg などの出力から判定するようにしてもよい 93 | // \~english In Linux we cannot check if the port is an URG or not 94 | // \~english With some spare time we may get this from dmesg or something 95 | (void)index; 96 | return 0; 97 | } 98 | -------------------------------------------------------------------------------- /current/src/urg_serial_utils_windows.c: -------------------------------------------------------------------------------- 1 | /*! 2 | \file 3 | \~japanese 4 | \brief シリアル用の補助関数 5 | \~english 6 | \brief Serial communication auxiliary functions for Windows 7 | \author Satofumi KAMIMURA 8 | 9 | $Id$ 10 | 11 | \~japanese 12 | \todo 変数名を '_' 区切りの形式に変更する 13 | \todo C90 相当で動作するように調整する。ただし、"//" コメントは使う 14 | \~english 15 | \todo Change variable names to use the "_" convention 16 | \todo Fix the code to be C90 compliant, but keeping the "//" comments 17 | */ 18 | 19 | #include "urg_serial_utils.h" 20 | #include "urg_detect_os.h" 21 | #include 22 | #include 23 | #include 24 | #include 25 | 26 | 27 | #if defined(URG_MSC) 28 | #define snprintf _snprintf 29 | #endif 30 | 31 | 32 | enum { 33 | MAX_PORTS = 16, 34 | DEVICE_NAME_SIZE = 7, 35 | }; 36 | 37 | 38 | static char found_ports[MAX_PORTS][DEVICE_NAME_SIZE]; 39 | static int is_urg_ports[MAX_PORTS]; 40 | static int found_ports_size = 0; 41 | 42 | static char *search_driver_names[] = { 43 | "URG Series USB Device Driver", 44 | "URG-X002 USB Device Driver", 45 | }; 46 | 47 | 48 | static void swap_item(int from_index, int to_index) 49 | { 50 | char buffer[DEVICE_NAME_SIZE]; 51 | int is_urg_port; 52 | 53 | if (from_index == to_index) { 54 | return; 55 | } 56 | 57 | strncpy(buffer, found_ports[to_index], DEVICE_NAME_SIZE); 58 | strncpy(found_ports[to_index], found_ports[from_index], DEVICE_NAME_SIZE); 59 | strncpy(found_ports[from_index], buffer, DEVICE_NAME_SIZE); 60 | 61 | is_urg_port = is_urg_ports[to_index]; 62 | is_urg_ports[to_index] = is_urg_ports[from_index]; 63 | is_urg_ports[from_index] = is_urg_port; 64 | } 65 | 66 | 67 | static void sort_ports(void) 68 | { 69 | int last_index = 0; 70 | int i; 71 | 72 | for (i = 0; i < found_ports_size; ++i) { 73 | if ((is_urg_ports[i] == 1) && (last_index < i)) { 74 | swap_item(i, last_index); 75 | last_index = i + 1; 76 | } 77 | } 78 | } 79 | 80 | 81 | int urg_serial_find_port(void) 82 | { 83 | // \~japanese デバイスマネージャの一覧から COM デバイスを探す 84 | // \~english Searchs for COM devices from the list of device manager 85 | 86 | //4D36E978-E325-11CE-BFC1-08002BE10318 87 | GUID GUID_DEVINTERFACE_COM_DEVICE = { 88 | 0x4D36E978L, 0xE325, 0x11CE, 89 | {0xBF, 0xC1, 0x08, 0x00, 0x2B, 0xE1, 0x03, 0x18 } 90 | }; 91 | 92 | HDEVINFO hdi; 93 | SP_DEVINFO_DATA sDevInfo; 94 | int i; 95 | 96 | found_ports_size = 0; 97 | hdi = SetupDiGetClassDevs(&GUID_DEVINTERFACE_COM_DEVICE, 0, 0, 98 | DIGCF_PRESENT | DIGCF_INTERFACEDEVICE); 99 | if (hdi == INVALID_HANDLE_VALUE) { 100 | return 0; 101 | } 102 | 103 | sDevInfo.cbSize = sizeof(SP_DEVINFO_DATA); 104 | for (i = 0; SetupDiEnumDeviceInfo(hdi, i, &sDevInfo); ++i){ 105 | 106 | enum { 107 | BufferSize = 256, 108 | ComNameLengthMax = 7, 109 | }; 110 | char buffer[BufferSize + 1]; 111 | DWORD dwRegType; 112 | DWORD dwSize; 113 | int is_urg_port; 114 | char *p; 115 | int n; 116 | int j; 117 | 118 | // \~japanese フレンドリーネームを取得して COM 番号を取り出す 119 | // \~english Gets the Friendly name property and gets the COM port number 120 | SetupDiGetDeviceRegistryPropertyA(hdi, &sDevInfo, SPDRP_FRIENDLYNAME, 121 | &dwRegType, (BYTE*)buffer, BufferSize, 122 | &dwSize); 123 | n = (int)strlen(buffer); 124 | if (n < ComNameLengthMax) { 125 | // \~japanese COM 名が短過ぎた場合、処理しない 126 | // \~japanese 問題がある場合は、修正する 127 | // \~english If the COM name is too small, ignore it 128 | // \~english (fix this in case of problems) 129 | continue; 130 | } 131 | 132 | // \~japanese (COMx) の最後の括弧の位置に '\0' を代入する 133 | // \~english Adds '\0' at the end of the string 134 | p = strrchr(buffer, ')'); 135 | if (p) { 136 | *p = '\0'; 137 | } 138 | 139 | // \~japanese COM と番号までの文字列を抜き出す 140 | // \~english Split name into "COM" and the number 141 | p = strstr(&buffer[n - ComNameLengthMax], "COM"); 142 | if (! p) { 143 | continue; 144 | } 145 | 146 | snprintf(found_ports[found_ports_size], DEVICE_NAME_SIZE, "%s", p); 147 | 148 | // \~japanese デバイス名を取得し、URG ポートかの判定に用いる 149 | // \~english Get the device names and detect the URG port 150 | SetupDiGetDeviceRegistryPropertyA(hdi, &sDevInfo, SPDRP_DEVICEDESC, 151 | &dwRegType, (BYTE*)buffer, BufferSize, 152 | &dwSize); 153 | is_urg_port = 0; 154 | n = sizeof(search_driver_names) / sizeof(search_driver_names[0]); 155 | for (j = 0; j < n; ++j) { 156 | if (! strcmp(search_driver_names[j], buffer)) { 157 | is_urg_port = 1; 158 | break; 159 | } 160 | } 161 | is_urg_ports[found_ports_size] = is_urg_port; 162 | ++found_ports_size; 163 | } 164 | SetupDiDestroyDeviceInfoList(hdi); 165 | 166 | // \~japanese is_urg_port の要素が先頭に来るようにソートする 167 | // \~english sort the elements in is_urg_port array 168 | sort_ports(); 169 | 170 | return found_ports_size; 171 | } 172 | 173 | 174 | const char *urg_serial_port_name(int index) 175 | { 176 | if ((index < 0) || (index >= found_ports_size)) { 177 | return ""; 178 | } else { 179 | return found_ports[index]; 180 | } 181 | } 182 | 183 | 184 | int urg_serial_is_urg_port(int index) 185 | { 186 | if ((index < 0) || (index >= found_ports_size)) { 187 | return -1; 188 | } else { 189 | return is_urg_ports[index]; 190 | } 191 | } 192 | -------------------------------------------------------------------------------- /current/src/urg_serial_windows.c: -------------------------------------------------------------------------------- 1 | /*! 2 | \file 3 | \~japanese 4 | \brief シリアル通信 5 | \~english 6 | \brief Serial communications on Windows 7 | \~ 8 | \author Satofumi KAMIMURA 9 | 10 | $Id$ 11 | */ 12 | 13 | #include "urg_serial.h" 14 | #include 15 | 16 | #if defined(URG_MSC) 17 | #define False 0 18 | #endif 19 | 20 | 21 | static void serial_initialize(urg_serial_t *serial) 22 | { 23 | serial->hCom = INVALID_HANDLE_VALUE; 24 | serial->has_last_ch = False; 25 | 26 | ring_initialize(&serial->ring, serial->buffer, RING_BUFFER_SIZE_SHIFT); 27 | } 28 | 29 | 30 | static void set_timeout(urg_serial_t *serial, int timeout) 31 | { 32 | COMMTIMEOUTS timeouts; 33 | GetCommTimeouts(serial->hCom, &timeouts); 34 | 35 | timeouts.ReadIntervalTimeout = (timeout == 0) ? MAXDWORD : 0; 36 | timeouts.ReadTotalTimeoutConstant = timeout; 37 | timeouts.ReadTotalTimeoutMultiplier = 0; 38 | 39 | SetCommTimeouts(serial->hCom, &timeouts); 40 | } 41 | 42 | 43 | int serial_open(urg_serial_t *serial, const char *device, long baudrate) 44 | { 45 | // \~japanese COM10 以降への対応用 46 | // \~english To deal with port names over COM10 47 | enum { NameLength = 11 }; 48 | char adjusted_device[NameLength]; 49 | 50 | serial_initialize(serial); 51 | 52 | /* \~japanese COM ポートを開く \~english Opens the COM port */ 53 | _snprintf(adjusted_device, NameLength, "\\\\.\\%s", device); 54 | serial->hCom = CreateFileA(adjusted_device, GENERIC_READ | GENERIC_WRITE, 55 | 0, NULL, OPEN_EXISTING, 56 | FILE_ATTRIBUTE_NORMAL, NULL); 57 | 58 | if (serial->hCom == INVALID_HANDLE_VALUE) { 59 | // !!! store error_message buffer 60 | //printf("open failed: %s\n", device); 61 | return -1; 62 | } 63 | 64 | /* \~japanese 通信サイズの更新 \~english Configures the transmission size */ 65 | SetupComm(serial->hCom, 4096 * 8, 4096); 66 | 67 | /* \~japanese ボーレートの変更 ~\english Changes the baudrate */ 68 | serial_set_baudrate(serial, baudrate); 69 | 70 | /* \~japanese シリアル制御構造体の初期化 \~english Initializes serial control structures */ 71 | serial->has_last_ch = False; 72 | 73 | /* \~japanese タイムアウトの設定 \~english Configures the timeout */ 74 | serial->current_timeout = 0; 75 | set_timeout(serial, serial->current_timeout); 76 | 77 | return 0; 78 | } 79 | 80 | 81 | void serial_close(urg_serial_t *serial) 82 | { 83 | if (serial->hCom != INVALID_HANDLE_VALUE) { 84 | CloseHandle(serial->hCom); 85 | serial->hCom = INVALID_HANDLE_VALUE; 86 | } 87 | } 88 | 89 | 90 | int serial_set_baudrate(urg_serial_t *serial, long baudrate) 91 | { 92 | long baudrate_value; 93 | DCB dcb; 94 | 95 | switch (baudrate) { 96 | 97 | case 4800: 98 | baudrate_value = CBR_4800; 99 | break; 100 | 101 | case 9600: 102 | baudrate_value = CBR_9600; 103 | break; 104 | 105 | case 19200: 106 | baudrate_value = CBR_19200; 107 | break; 108 | 109 | case 38400: 110 | baudrate_value = CBR_38400; 111 | break; 112 | 113 | case 57600: 114 | baudrate_value = CBR_57600; 115 | break; 116 | 117 | case 115200: 118 | baudrate_value = CBR_115200; 119 | break; 120 | 121 | default: 122 | baudrate_value = baudrate; 123 | } 124 | 125 | GetCommState(serial->hCom, &dcb); 126 | dcb.BaudRate = baudrate_value; 127 | dcb.ByteSize = 8; 128 | dcb.Parity = NOPARITY; 129 | dcb.fParity = FALSE; 130 | dcb.StopBits = ONESTOPBIT; 131 | 132 | dcb.fBinary = TRUE; //If this member is TRUE, binary mode is enabled. Windows does not support nonbinary mode transfers, so this member must be TRUE. 133 | dcb.fInX = FALSE; 134 | dcb.fOutX = FALSE; 135 | dcb.fAbortOnError = FALSE; 136 | dcb.fNull = FALSE; 137 | dcb.fDtrControl = DTR_CONTROL_ENABLE; 138 | dcb.fRtsControl = RTS_CONTROL_DISABLE; 139 | /* 140 | if (SetCommState(serial->hCom, &dcb) == 0) { 141 | flush(); 142 | return -1; 143 | } else { 144 | return 0; 145 | } 146 | */ 147 | SetCommState(serial->hCom, &dcb); 148 | return 0; 149 | } 150 | 151 | 152 | int serial_write(urg_serial_t *serial, const char *data, int size) 153 | { 154 | DWORD n; 155 | 156 | if (size < 0) { 157 | return 0; 158 | } 159 | 160 | if (serial->hCom == INVALID_HANDLE_VALUE) { 161 | return -1; 162 | } 163 | 164 | WriteFile(serial->hCom, data, (DWORD)size, &n, NULL); 165 | return n; 166 | } 167 | 168 | 169 | static int internal_receive(char data[], int max_size, 170 | urg_serial_t* serial, int timeout) 171 | { 172 | int filled = 0; 173 | DWORD n; 174 | 175 | if (timeout != serial->current_timeout) { 176 | set_timeout(serial, timeout); 177 | serial->current_timeout = timeout; 178 | } 179 | 180 | ReadFile(serial->hCom, &data[filled], (DWORD)max_size - filled, &n, NULL); 181 | 182 | return filled + n; 183 | } 184 | 185 | 186 | int serial_read(urg_serial_t *serial, char *data, int max_size, int timeout) 187 | { 188 | int filled = 0; 189 | int buffer_size; 190 | int read_n; 191 | 192 | if (max_size <= 0) { 193 | return 0; 194 | } 195 | 196 | /* \~japanese 書き戻した1文字があれば、書き出す \~english If there is a single character return it */ 197 | if (serial->has_last_ch) { 198 | data[0] = serial->last_ch; 199 | serial->has_last_ch = False; 200 | ++filled; 201 | } 202 | 203 | if (serial->hCom == INVALID_HANDLE_VALUE) { 204 | if (filled > 0) { 205 | return filled; 206 | } 207 | return -1; 208 | } 209 | 210 | buffer_size = ring_size(&serial->ring); 211 | read_n = max_size - filled; 212 | if (buffer_size < read_n) { 213 | // \~japanese リングバッファ内のデータで足りなければ、データを読み足す 214 | // \~english Reads data if there is space in the ring buffer 215 | char buffer[RING_BUFFER_SIZE]; 216 | int n = internal_receive(buffer, 217 | ring_capacity(&serial->ring) - buffer_size, 218 | serial, 0); 219 | ring_write(&serial->ring, buffer, n); 220 | } 221 | buffer_size = ring_size(&serial->ring); 222 | 223 | // \~japanese リングバッファ内のデータを返す 224 | // \~english Returns the data stored in the ring buffer 225 | if (read_n > buffer_size) { 226 | read_n = buffer_size; 227 | } 228 | if (read_n > 0) { 229 | ring_read(&serial->ring, &data[filled], read_n); 230 | filled += read_n; 231 | } 232 | 233 | // \~japanese データをタイムアウト付きで読み出す 234 | // \~english Reads data within the given timeout 235 | filled += internal_receive(&data[filled], 236 | max_size - filled, serial, timeout); 237 | return filled; 238 | } 239 | -------------------------------------------------------------------------------- /current/src/urg_utils.c: -------------------------------------------------------------------------------- 1 | /*! 2 | \file 3 | \~japanese 4 | \brief URG センサ用の補助関数 5 | \~english 6 | \brief Auxiliary functions for the sensor 7 | \~ 8 | \author Satofumi KAMIMURA 9 | 10 | $Id$ 11 | */ 12 | 13 | #include "urg_utils.h" 14 | #include "urg_errno.h" 15 | #include "urg_detect_os.h" 16 | #if !defined(URG_WINDOWS_OS) 17 | #include 18 | #endif 19 | #define _USE_MATH_DEFINES 20 | #include 21 | 22 | #undef max 23 | #undef min 24 | 25 | static int max(int a, int b) 26 | { 27 | return (a > b) ? a : b; 28 | } 29 | 30 | 31 | static int min(int a, int b) 32 | { 33 | return (a < b) ? a : b; 34 | } 35 | 36 | 37 | const char *urg_error(const urg_t *urg) 38 | { 39 | typedef struct 40 | { 41 | int no; 42 | const char* message; 43 | } error_messages_t; 44 | 45 | 46 | error_messages_t errors[] = { 47 | { URG_NO_ERROR, "no error." }, 48 | { URG_UNKNOWN_ERROR, "unknown error." }, 49 | { URG_NOT_CONNECTED, "not connected." }, 50 | { URG_NOT_IMPLEMENTED, "not implemented." }, 51 | { URG_INVALID_RESPONSE, "invalid response." }, 52 | { URG_NO_RESPONSE, "no response." }, 53 | 54 | { URG_SEND_ERROR, "send error." }, 55 | { URG_RECEIVE_ERROR, "receive error." }, 56 | { URG_CHECKSUM_ERROR, "checksum error." }, 57 | { URG_INVALID_PARAMETER, "invalid parameter." }, 58 | { URG_MEASUREMENT_TYPE_MISMATCH, "measurement type mismatch." }, 59 | 60 | { URG_SERIAL_OPEN_ERROR, "could not open serial device." }, 61 | { URG_NOT_DETECT_BAUDRATE_ERROR, "could not detect serial baudrate." }, 62 | { URG_ETHERNET_OPEN_ERROR, "could not open ethernet port." }, 63 | { URG_SCANNING_PARAMETER_ERROR, "scanning parameter error." }, 64 | { URG_DATA_SIZE_PARAMETER_ERROR, "data size parameter error." }, 65 | }; 66 | 67 | int n = sizeof(errors) / sizeof(errors[0]); 68 | int i; 69 | 70 | for (i = 0; i < n; ++i) { 71 | if (errors[i].no == urg->last_errno) { 72 | return errors[i].message; 73 | } 74 | } 75 | 76 | return "Unknown error."; 77 | } 78 | 79 | 80 | void urg_distance_min_max(const urg_t *urg, 81 | long *min_distance, long *max_distance) 82 | { 83 | if (!urg->is_active) { 84 | *min_distance = 1; 85 | *max_distance = 0; 86 | return; 87 | } 88 | 89 | *min_distance = urg->min_distance; 90 | 91 | // \~japanese urg_set_measurement_data_size() を反映した距離を返す 92 | // \~english returns the size configured with urg_set_measurement_data_size() 93 | *max_distance = 94 | (urg->range_data_byte == URG_COMMUNICATION_2_BYTE) ? 95 | max(urg->max_distance, 4095) : urg->max_distance; 96 | } 97 | 98 | 99 | void urg_step_min_max(const urg_t *urg, int *min_index, int *max_index) 100 | { 101 | if (!urg->is_active) { 102 | *min_index = 1; 103 | *max_index = 0; 104 | return; 105 | } 106 | 107 | *min_index = urg->first_data_index - urg->front_data_index; 108 | *max_index = urg->last_data_index - urg->front_data_index; 109 | } 110 | 111 | 112 | long urg_scan_usec(const urg_t *urg) 113 | { 114 | if (!urg->is_active) { 115 | return URG_NOT_CONNECTED; 116 | } 117 | 118 | return urg->scan_usec; 119 | } 120 | 121 | 122 | int urg_max_data_size(const urg_t *urg) 123 | { 124 | if (!urg->is_active) { 125 | return URG_NOT_CONNECTED; 126 | } 127 | return urg->last_data_index + 1; 128 | } 129 | 130 | 131 | double urg_index2rad(const urg_t *urg, int index) 132 | { 133 | int actual_index; 134 | int step; 135 | 136 | if (!urg->is_active) { 137 | return URG_NOT_CONNECTED; 138 | } 139 | 140 | actual_index = min(max(0, index), urg->last_data_index); 141 | 142 | // \~japanese scanning_skip_step = 0 のときは scanning_skip_step = 1 とみなす 143 | // \~english "scanning_skip_step = 0" is equivalent to "scanning_skip_step = 1" 144 | step = actual_index * max(1, urg->scanning_skip_step) - urg->front_data_index + urg->received_first_index; 145 | 146 | return urg_step2rad(urg, step); 147 | } 148 | 149 | 150 | double urg_index2deg(const urg_t *urg, int index) 151 | { 152 | return urg_index2rad(urg, index) * 180.0 / M_PI; 153 | } 154 | 155 | 156 | int urg_rad2index(const urg_t *urg, double radian) 157 | { 158 | int index; 159 | 160 | if (!urg->is_active) { 161 | return URG_NOT_CONNECTED; 162 | } 163 | 164 | index = 165 | (int)(floor((urg->area_resolution * radian / (2.0 * M_PI) + 0.5))) 166 | + urg->front_data_index; 167 | 168 | return min(max(0, index), urg->last_data_index); 169 | } 170 | 171 | 172 | int urg_deg2index(const urg_t *urg, double degree) 173 | { 174 | return urg_rad2index(urg, degree * M_PI / 180.0); 175 | } 176 | 177 | 178 | int urg_rad2step(const urg_t *urg, double radian) 179 | { 180 | if (!urg->is_active) { 181 | return URG_NOT_CONNECTED; 182 | } 183 | 184 | return urg_rad2index(urg, radian) - urg->front_data_index; 185 | } 186 | 187 | 188 | int urg_deg2step(const urg_t *urg, double degree) 189 | { 190 | return urg_rad2step(urg, degree * M_PI / 180.0); 191 | } 192 | 193 | 194 | double urg_step2rad(const urg_t *urg, int step) 195 | { 196 | if (!urg->is_active) { 197 | return URG_NOT_CONNECTED; 198 | } 199 | 200 | return (2.0 * M_PI) * step / urg->area_resolution; 201 | } 202 | 203 | 204 | double urg_step2deg(const urg_t *urg, int step) 205 | { 206 | return urg_step2rad(urg, step) * 180.0 / M_PI; 207 | } 208 | 209 | 210 | int urg_step2index(const urg_t *urg, int step) 211 | { 212 | int measure_step; 213 | 214 | if (!urg->is_active) { 215 | return URG_NOT_CONNECTED; 216 | } 217 | 218 | measure_step = step - urg->received_first_index; 219 | return min(max(0, measure_step + urg->front_data_index), 220 | urg->last_data_index); 221 | } 222 | 223 | void urg_delay(int delay_msec) 224 | { 225 | #if defined(URG_WINDOWS_OS) 226 | Sleep(delay_msec); 227 | #else 228 | usleep(1000 * delay_msec); 229 | #endif 230 | } 231 | -------------------------------------------------------------------------------- /current/urg_c-config.in: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | version=VERSION 4 | prefix=PREFIX 5 | includedir=${prefix}/include/urg_c 6 | installlib=${prefix}/lib 7 | 8 | usage="Usage: urg_c-config [--version] [--cflags] [--libs]" 9 | 10 | if test $# -eq 0; then 11 | echo "${usage}" 1>&2 12 | exit 1 13 | fi 14 | 15 | while test $# -gt 0; do 16 | 17 | case $1 in 18 | --version) 19 | echo "${version}" 20 | ;; 21 | --cflags) 22 | echo -I${includedir} 23 | ;; 24 | --libs) 25 | echo -lurg_c LIBS -L${installlib} 26 | ;; 27 | *) 28 | echo "${usage}" 1>&2 29 | exit 1 30 | ;; 31 | esac 32 | shift 33 | done 34 | -------------------------------------------------------------------------------- /current/urg_cpp-config.in: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | version=VERSION 4 | prefix=PREFIX 5 | includedir=${prefix}/include/urg_cpp 6 | installlib=${prefix}/lib 7 | 8 | usage="Usage: urg_cpp-config [--version] [--cflags] [--libs]" 9 | 10 | if test $# -eq 0; then 11 | echo "${usage}" 1>&2 12 | exit 1 13 | fi 14 | 15 | while test $# -gt 0; do 16 | 17 | case $1 in 18 | --version) 19 | echo "${version}" 20 | ;; 21 | --cflags) 22 | echo -I${includedir} 23 | ;; 24 | --libs) 25 | echo -lurg_cpp LIBS -L${installlib} 26 | ;; 27 | *) 28 | echo "${usage}" 1>&2 29 | exit 1 30 | ;; 31 | esac 32 | shift 33 | done 34 | -------------------------------------------------------------------------------- /current/viewers/Makefile: -------------------------------------------------------------------------------- 1 | # viewers/ 2 | 3 | all : 4 | cd viewer_sdl/ && $(MAKE) 5 | 6 | clean : 7 | cd viewer_sdl/ && $(MAKE) clean 8 | -------------------------------------------------------------------------------- /current/viewers/viewer_sdl/Makefile: -------------------------------------------------------------------------------- 1 | # viewers/viewer_sdl/ 2 | 3 | # Compile options 4 | CC = gcc 5 | CFLAGS = -g -O0 -Wall -Werror -W `sdl-config --cflags` `urg_c-config --cflags` 6 | LDFLAGS = -L/usr/X11/lib 7 | ifeq ($(OS),Windows_NT) 8 | LDLIBS = `sdl-config --libs` -lopengl32 `urg_c-config --libs` 9 | else 10 | LDLIBS = `sdl-config --libs` -lGL `urg_c-config --libs` 11 | endif 12 | 13 | 14 | TARGET = viewer_sdl 15 | 16 | all : $(TARGET) 17 | 18 | clean : 19 | $(RM) $(TARGET) *.o 20 | 21 | depend : 22 | makedepend -Y -- $(INCLUDES) -- $(wildcard *.h *.c) 23 | 24 | .PHONY : all clean depend 25 | ###################################################################### 26 | 27 | viewer_sdl : plotter_sdl.o $(REQUIRE_LIB) 28 | 29 | # DO NOT DELETE 30 | 31 | plotter_sdl.o: plotter_sdl.h 32 | viewer_sdl.o: plotter_sdl.h 33 | -------------------------------------------------------------------------------- /current/viewers/viewer_sdl/plotter_sdl.c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/UrgNetwork/urg_library/c10c1dc78328feb5d62a0a8a1a3c2f87a253307a/current/viewers/viewer_sdl/plotter_sdl.c -------------------------------------------------------------------------------- /current/viewers/viewer_sdl/plotter_sdl.h: -------------------------------------------------------------------------------- 1 | #ifndef PLOTTER_SDL_H 2 | #define PLOTTER_SDL_H 3 | 4 | /*! 5 | \file 6 | \brief Plotter (SDL) 7 | 8 | \author Satofumi KAMIMURA 9 | 10 | $Id: plotter_sdl.h,v 2a8d923c70f3 2010/08/08 12:22:29 Satofumi $ 11 | */ 12 | 13 | #include 14 | 15 | 16 | extern bool plotter_initialize(int data_size); 17 | extern void plotter_terminate(void); 18 | extern void plotter_clear(void); 19 | extern void plotter_swap(void); 20 | extern void plotter_set_color(unsigned char r, unsigned g, unsigned b); 21 | extern void plotter_plot(float x, float y); 22 | extern bool plotter_is_quit(void); 23 | 24 | #endif /* !PLOTTER_SDL_H */ 25 | -------------------------------------------------------------------------------- /current/viewers/viewer_sdl/viewer_sdl.c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/UrgNetwork/urg_library/c10c1dc78328feb5d62a0a8a1a3c2f87a253307a/current/viewers/viewer_sdl/viewer_sdl.c -------------------------------------------------------------------------------- /current/vs2005/c/calculate_xy/calculate_xy.vcproj: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/UrgNetwork/urg_library/c10c1dc78328feb5d62a0a8a1a3c2f87a253307a/current/vs2005/c/calculate_xy/calculate_xy.vcproj -------------------------------------------------------------------------------- /current/vs2005/c/find_port/find_port.vcproj: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/UrgNetwork/urg_library/c10c1dc78328feb5d62a0a8a1a3c2f87a253307a/current/vs2005/c/find_port/find_port.vcproj -------------------------------------------------------------------------------- /current/vs2005/c/get_distance/get_distance.vcproj: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/UrgNetwork/urg_library/c10c1dc78328feb5d62a0a8a1a3c2f87a253307a/current/vs2005/c/get_distance/get_distance.vcproj -------------------------------------------------------------------------------- /current/vs2005/c/get_distance_intensity/get_distance_intensity.vcproj: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/UrgNetwork/urg_library/c10c1dc78328feb5d62a0a8a1a3c2f87a253307a/current/vs2005/c/get_distance_intensity/get_distance_intensity.vcproj -------------------------------------------------------------------------------- /current/vs2005/c/get_multiecho/get_multiecho.vcproj: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/UrgNetwork/urg_library/c10c1dc78328feb5d62a0a8a1a3c2f87a253307a/current/vs2005/c/get_multiecho/get_multiecho.vcproj -------------------------------------------------------------------------------- /current/vs2005/c/get_multiecho_intensity/get_multiecho_intensity.vcproj: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/UrgNetwork/urg_library/c10c1dc78328feb5d62a0a8a1a3c2f87a253307a/current/vs2005/c/get_multiecho_intensity/get_multiecho_intensity.vcproj -------------------------------------------------------------------------------- /current/vs2005/c/sensor_parameter/sensor_parameter.vcproj: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/UrgNetwork/urg_library/c10c1dc78328feb5d62a0a8a1a3c2f87a253307a/current/vs2005/c/sensor_parameter/sensor_parameter.vcproj -------------------------------------------------------------------------------- /current/vs2005/c/sync_time_stamp/sync_time_stamp.vcproj: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/UrgNetwork/urg_library/c10c1dc78328feb5d62a0a8a1a3c2f87a253307a/current/vs2005/c/sync_time_stamp/sync_time_stamp.vcproj -------------------------------------------------------------------------------- /current/vs2005/c/urg.sln: -------------------------------------------------------------------------------- 1 |  2 | Microsoft Visual Studio Solution File, Format Version 9.00 3 | # Visual Studio 2005 4 | Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "get_distance", "get_distance\get_distance.vcproj", "{8F73522C-18D0-4436-B444-3E17A2A84788}" 5 | ProjectSection(ProjectDependencies) = postProject 6 | {269630A6-5F78-484F-A729-5CD301B5CABA} = {269630A6-5F78-484F-A729-5CD301B5CABA} 7 | EndProjectSection 8 | EndProject 9 | Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "urg", "urg\urg.vcproj", "{269630A6-5F78-484F-A729-5CD301B5CABA}" 10 | EndProject 11 | Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "sensor_parameter", "sensor_parameter\sensor_parameter.vcproj", "{3347DEB1-A1EC-4242-8079-233B9E5EB0C3}" 12 | ProjectSection(ProjectDependencies) = postProject 13 | {269630A6-5F78-484F-A729-5CD301B5CABA} = {269630A6-5F78-484F-A729-5CD301B5CABA} 14 | EndProjectSection 15 | EndProject 16 | Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "get_distance_intensity", "get_distance_intensity\get_distance_intensity.vcproj", "{17A43425-7F91-4D65-A28A-C90B3E22863F}" 17 | ProjectSection(ProjectDependencies) = postProject 18 | {269630A6-5F78-484F-A729-5CD301B5CABA} = {269630A6-5F78-484F-A729-5CD301B5CABA} 19 | EndProjectSection 20 | EndProject 21 | Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "get_multiecho", "get_multiecho\get_multiecho.vcproj", "{0C8D756A-E46E-4EA0-8719-5807E6A7A5C0}" 22 | ProjectSection(ProjectDependencies) = postProject 23 | {269630A6-5F78-484F-A729-5CD301B5CABA} = {269630A6-5F78-484F-A729-5CD301B5CABA} 24 | EndProjectSection 25 | EndProject 26 | Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "get_multiecho_intensity", "get_multiecho_intensity\get_multiecho_intensity.vcproj", "{AFB48029-6ADD-4F7A-A36C-6F0A67BC0D2C}" 27 | ProjectSection(ProjectDependencies) = postProject 28 | {269630A6-5F78-484F-A729-5CD301B5CABA} = {269630A6-5F78-484F-A729-5CD301B5CABA} 29 | EndProjectSection 30 | EndProject 31 | Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "calculate_xy", "calculate_xy\calculate_xy.vcproj", "{64658378-45FE-4BA5-9C28-1A91CDC6C4EB}" 32 | ProjectSection(ProjectDependencies) = postProject 33 | {269630A6-5F78-484F-A729-5CD301B5CABA} = {269630A6-5F78-484F-A729-5CD301B5CABA} 34 | EndProjectSection 35 | EndProject 36 | Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "sync_time_stamp", "sync_time_stamp\sync_time_stamp.vcproj", "{EF96A9B9-81AE-4B35-81EC-68DB295963DB}" 37 | ProjectSection(ProjectDependencies) = postProject 38 | {269630A6-5F78-484F-A729-5CD301B5CABA} = {269630A6-5F78-484F-A729-5CD301B5CABA} 39 | EndProjectSection 40 | EndProject 41 | Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "find_port", "find_port\find_port.vcproj", "{B1E1DC1F-F6C1-4A11-8A7D-D30E0211A18E}" 42 | ProjectSection(ProjectDependencies) = postProject 43 | {269630A6-5F78-484F-A729-5CD301B5CABA} = {269630A6-5F78-484F-A729-5CD301B5CABA} 44 | EndProjectSection 45 | EndProject 46 | Global 47 | GlobalSection(SolutionConfigurationPlatforms) = preSolution 48 | Debug|Win32 = Debug|Win32 49 | Release|Win32 = Release|Win32 50 | EndGlobalSection 51 | GlobalSection(ProjectConfigurationPlatforms) = postSolution 52 | {269630A6-5F78-484F-A729-5CD301B5CABA}.Debug|Win32.ActiveCfg = Debug|Win32 53 | {269630A6-5F78-484F-A729-5CD301B5CABA}.Debug|Win32.Build.0 = Debug|Win32 54 | {269630A6-5F78-484F-A729-5CD301B5CABA}.Release|Win32.ActiveCfg = Release|Win32 55 | {269630A6-5F78-484F-A729-5CD301B5CABA}.Release|Win32.Build.0 = Release|Win32 56 | {3347DEB1-A1EC-4242-8079-233B9E5EB0C3}.Debug|Win32.ActiveCfg = Debug|Win32 57 | {3347DEB1-A1EC-4242-8079-233B9E5EB0C3}.Debug|Win32.Build.0 = Debug|Win32 58 | {3347DEB1-A1EC-4242-8079-233B9E5EB0C3}.Release|Win32.ActiveCfg = Release|Win32 59 | {3347DEB1-A1EC-4242-8079-233B9E5EB0C3}.Release|Win32.Build.0 = Release|Win32 60 | {8F73522C-18D0-4436-B444-3E17A2A84788}.Debug|Win32.ActiveCfg = Debug|Win32 61 | {8F73522C-18D0-4436-B444-3E17A2A84788}.Debug|Win32.Build.0 = Debug|Win32 62 | {8F73522C-18D0-4436-B444-3E17A2A84788}.Release|Win32.ActiveCfg = Release|Win32 63 | {8F73522C-18D0-4436-B444-3E17A2A84788}.Release|Win32.Build.0 = Release|Win32 64 | {17A43425-7F91-4D65-A28A-C90B3E22863F}.Debug|Win32.ActiveCfg = Debug|Win32 65 | {17A43425-7F91-4D65-A28A-C90B3E22863F}.Debug|Win32.Build.0 = Debug|Win32 66 | {17A43425-7F91-4D65-A28A-C90B3E22863F}.Release|Win32.ActiveCfg = Release|Win32 67 | {17A43425-7F91-4D65-A28A-C90B3E22863F}.Release|Win32.Build.0 = Release|Win32 68 | {0C8D756A-E46E-4EA0-8719-5807E6A7A5C0}.Debug|Win32.ActiveCfg = Debug|Win32 69 | {0C8D756A-E46E-4EA0-8719-5807E6A7A5C0}.Debug|Win32.Build.0 = Debug|Win32 70 | {0C8D756A-E46E-4EA0-8719-5807E6A7A5C0}.Release|Win32.ActiveCfg = Release|Win32 71 | {0C8D756A-E46E-4EA0-8719-5807E6A7A5C0}.Release|Win32.Build.0 = Release|Win32 72 | {AFB48029-6ADD-4F7A-A36C-6F0A67BC0D2C}.Debug|Win32.ActiveCfg = Debug|Win32 73 | {AFB48029-6ADD-4F7A-A36C-6F0A67BC0D2C}.Debug|Win32.Build.0 = Debug|Win32 74 | {AFB48029-6ADD-4F7A-A36C-6F0A67BC0D2C}.Release|Win32.ActiveCfg = Release|Win32 75 | {AFB48029-6ADD-4F7A-A36C-6F0A67BC0D2C}.Release|Win32.Build.0 = Release|Win32 76 | {64658378-45FE-4BA5-9C28-1A91CDC6C4EB}.Debug|Win32.ActiveCfg = Debug|Win32 77 | {64658378-45FE-4BA5-9C28-1A91CDC6C4EB}.Debug|Win32.Build.0 = Debug|Win32 78 | {64658378-45FE-4BA5-9C28-1A91CDC6C4EB}.Release|Win32.ActiveCfg = Release|Win32 79 | {64658378-45FE-4BA5-9C28-1A91CDC6C4EB}.Release|Win32.Build.0 = Release|Win32 80 | {EF96A9B9-81AE-4B35-81EC-68DB295963DB}.Debug|Win32.ActiveCfg = Debug|Win32 81 | {EF96A9B9-81AE-4B35-81EC-68DB295963DB}.Debug|Win32.Build.0 = Debug|Win32 82 | {EF96A9B9-81AE-4B35-81EC-68DB295963DB}.Release|Win32.ActiveCfg = Release|Win32 83 | {EF96A9B9-81AE-4B35-81EC-68DB295963DB}.Release|Win32.Build.0 = Release|Win32 84 | {B1E1DC1F-F6C1-4A11-8A7D-D30E0211A18E}.Debug|Win32.ActiveCfg = Debug|Win32 85 | {B1E1DC1F-F6C1-4A11-8A7D-D30E0211A18E}.Debug|Win32.Build.0 = Debug|Win32 86 | {B1E1DC1F-F6C1-4A11-8A7D-D30E0211A18E}.Release|Win32.ActiveCfg = Release|Win32 87 | {B1E1DC1F-F6C1-4A11-8A7D-D30E0211A18E}.Release|Win32.Build.0 = Release|Win32 88 | EndGlobalSection 89 | GlobalSection(SolutionProperties) = preSolution 90 | HideSolutionNode = FALSE 91 | EndGlobalSection 92 | EndGlobal 93 | -------------------------------------------------------------------------------- /current/vs2005/c/urg/urg.vcproj: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/UrgNetwork/urg_library/c10c1dc78328feb5d62a0a8a1a3c2f87a253307a/current/vs2005/c/urg/urg.vcproj -------------------------------------------------------------------------------- /current/vs2005/cpp/get_distance/get_distance.vcproj: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/UrgNetwork/urg_library/c10c1dc78328feb5d62a0a8a1a3c2f87a253307a/current/vs2005/cpp/get_distance/get_distance.vcproj -------------------------------------------------------------------------------- /current/vs2005/cpp/get_distance_intensity/get_distance_intensity.vcproj: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/UrgNetwork/urg_library/c10c1dc78328feb5d62a0a8a1a3c2f87a253307a/current/vs2005/cpp/get_distance_intensity/get_distance_intensity.vcproj -------------------------------------------------------------------------------- /current/vs2005/cpp/get_multiecho/get_multiecho.vcproj: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/UrgNetwork/urg_library/c10c1dc78328feb5d62a0a8a1a3c2f87a253307a/current/vs2005/cpp/get_multiecho/get_multiecho.vcproj -------------------------------------------------------------------------------- /current/vs2005/cpp/get_multiecho_intensity/get_multiecho_intensity.vcproj: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/UrgNetwork/urg_library/c10c1dc78328feb5d62a0a8a1a3c2f87a253307a/current/vs2005/cpp/get_multiecho_intensity/get_multiecho_intensity.vcproj -------------------------------------------------------------------------------- /current/vs2005/cpp/sensor_parameter/sensor_parameter.vcproj: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/UrgNetwork/urg_library/c10c1dc78328feb5d62a0a8a1a3c2f87a253307a/current/vs2005/cpp/sensor_parameter/sensor_parameter.vcproj -------------------------------------------------------------------------------- /current/vs2005/cpp/sync_time_stamp/sync_time_stamp.vcproj: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/UrgNetwork/urg_library/c10c1dc78328feb5d62a0a8a1a3c2f87a253307a/current/vs2005/cpp/sync_time_stamp/sync_time_stamp.vcproj -------------------------------------------------------------------------------- /current/vs2005/cpp/urg_cpp.sln: -------------------------------------------------------------------------------- 1 | Microsoft Visual Studio Solution File, Format Version 9.00 2 | # Visual Studio 2005 3 | Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "get_distance", "get_distance\get_distance.vcproj", "{D0564F14-3BE0-4741-8BD0-BC20EF661423}" 4 | ProjectSection(ProjectDependencies) = postProject 5 | {7758B3FF-07FF-4F8D-A2DD-83B0BBBEF8E5} = {7758B3FF-07FF-4F8D-A2DD-83B0BBBEF8E5} 6 | EndProjectSection 7 | EndProject 8 | Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "urg_cpp", "urg_cpp\urg_cpp.vcproj", "{7758B3FF-07FF-4F8D-A2DD-83B0BBBEF8E5}" 9 | ProjectSection(ProjectDependencies) = postProject 10 | {269630A6-5F78-484F-A729-5CD301B5CABA} = {269630A6-5F78-484F-A729-5CD301B5CABA} 11 | EndProjectSection 12 | EndProject 13 | Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "get_distance_intensity", "get_distance_intensity\get_distance_intensity.vcproj", "{F8E1DEF8-BF55-49FA-9055-13A8C94709A2}" 14 | ProjectSection(ProjectDependencies) = postProject 15 | {7758B3FF-07FF-4F8D-A2DD-83B0BBBEF8E5} = {7758B3FF-07FF-4F8D-A2DD-83B0BBBEF8E5} 16 | EndProjectSection 17 | EndProject 18 | Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "get_multiecho", "get_multiecho\get_multiecho.vcproj", "{86B8ED2A-2D9C-4C89-94D9-90B21E4C95DB}" 19 | ProjectSection(ProjectDependencies) = postProject 20 | {7758B3FF-07FF-4F8D-A2DD-83B0BBBEF8E5} = {7758B3FF-07FF-4F8D-A2DD-83B0BBBEF8E5} 21 | EndProjectSection 22 | EndProject 23 | Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "get_multiecho_intensity", "get_multiecho_intensity\get_multiecho_intensity.vcproj", "{70BD21D0-01D5-41A8-A3C7-73EE9D16C026}" 24 | ProjectSection(ProjectDependencies) = postProject 25 | {7758B3FF-07FF-4F8D-A2DD-83B0BBBEF8E5} = {7758B3FF-07FF-4F8D-A2DD-83B0BBBEF8E5} 26 | EndProjectSection 27 | EndProject 28 | Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "sensor_parameter", "sensor_parameter\sensor_parameter.vcproj", "{B460F046-E8A0-4C2F-8B81-90C0045B176E}" 29 | ProjectSection(ProjectDependencies) = postProject 30 | {7758B3FF-07FF-4F8D-A2DD-83B0BBBEF8E5} = {7758B3FF-07FF-4F8D-A2DD-83B0BBBEF8E5} 31 | EndProjectSection 32 | EndProject 33 | Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "sync_time_stamp", "sync_time_stamp\sync_time_stamp.vcproj", "{F748FBF4-E153-43F3-A986-4690FF033DCC}" 34 | ProjectSection(ProjectDependencies) = postProject 35 | {7758B3FF-07FF-4F8D-A2DD-83B0BBBEF8E5} = {7758B3FF-07FF-4F8D-A2DD-83B0BBBEF8E5} 36 | EndProjectSection 37 | EndProject 38 | Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "urg", "..\c\urg\urg.vcproj", "{269630A6-5F78-484F-A729-5CD301B5CABA}" 39 | EndProject 40 | Global 41 | GlobalSection(SolutionConfigurationPlatforms) = preSolution 42 | Debug|Win32 = Debug|Win32 43 | Release|Win32 = Release|Win32 44 | EndGlobalSection 45 | GlobalSection(ProjectConfigurationPlatforms) = postSolution 46 | {7758B3FF-07FF-4F8D-A2DD-83B0BBBEF8E5}.Debug|Win32.ActiveCfg = Debug|Win32 47 | {7758B3FF-07FF-4F8D-A2DD-83B0BBBEF8E5}.Debug|Win32.Build.0 = Debug|Win32 48 | {7758B3FF-07FF-4F8D-A2DD-83B0BBBEF8E5}.Release|Win32.ActiveCfg = Release|Win32 49 | {7758B3FF-07FF-4F8D-A2DD-83B0BBBEF8E5}.Release|Win32.Build.0 = Release|Win32 50 | {D0564F14-3BE0-4741-8BD0-BC20EF661423}.Debug|Win32.ActiveCfg = Debug|Win32 51 | {D0564F14-3BE0-4741-8BD0-BC20EF661423}.Debug|Win32.Build.0 = Debug|Win32 52 | {D0564F14-3BE0-4741-8BD0-BC20EF661423}.Release|Win32.ActiveCfg = Release|Win32 53 | {D0564F14-3BE0-4741-8BD0-BC20EF661423}.Release|Win32.Build.0 = Release|Win32 54 | {F8E1DEF8-BF55-49FA-9055-13A8C94709A2}.Debug|Win32.ActiveCfg = Debug|Win32 55 | {F8E1DEF8-BF55-49FA-9055-13A8C94709A2}.Debug|Win32.Build.0 = Debug|Win32 56 | {F8E1DEF8-BF55-49FA-9055-13A8C94709A2}.Release|Win32.ActiveCfg = Release|Win32 57 | {F8E1DEF8-BF55-49FA-9055-13A8C94709A2}.Release|Win32.Build.0 = Release|Win32 58 | {86B8ED2A-2D9C-4C89-94D9-90B21E4C95DB}.Debug|Win32.ActiveCfg = Debug|Win32 59 | {86B8ED2A-2D9C-4C89-94D9-90B21E4C95DB}.Debug|Win32.Build.0 = Debug|Win32 60 | {86B8ED2A-2D9C-4C89-94D9-90B21E4C95DB}.Release|Win32.ActiveCfg = Release|Win32 61 | {86B8ED2A-2D9C-4C89-94D9-90B21E4C95DB}.Release|Win32.Build.0 = Release|Win32 62 | {70BD21D0-01D5-41A8-A3C7-73EE9D16C026}.Debug|Win32.ActiveCfg = Debug|Win32 63 | {70BD21D0-01D5-41A8-A3C7-73EE9D16C026}.Debug|Win32.Build.0 = Debug|Win32 64 | {70BD21D0-01D5-41A8-A3C7-73EE9D16C026}.Release|Win32.ActiveCfg = Release|Win32 65 | {70BD21D0-01D5-41A8-A3C7-73EE9D16C026}.Release|Win32.Build.0 = Release|Win32 66 | {B460F046-E8A0-4C2F-8B81-90C0045B176E}.Debug|Win32.ActiveCfg = Debug|Win32 67 | {B460F046-E8A0-4C2F-8B81-90C0045B176E}.Debug|Win32.Build.0 = Debug|Win32 68 | {B460F046-E8A0-4C2F-8B81-90C0045B176E}.Release|Win32.ActiveCfg = Release|Win32 69 | {B460F046-E8A0-4C2F-8B81-90C0045B176E}.Release|Win32.Build.0 = Release|Win32 70 | {F748FBF4-E153-43F3-A986-4690FF033DCC}.Debug|Win32.ActiveCfg = Debug|Win32 71 | {F748FBF4-E153-43F3-A986-4690FF033DCC}.Debug|Win32.Build.0 = Debug|Win32 72 | {F748FBF4-E153-43F3-A986-4690FF033DCC}.Release|Win32.ActiveCfg = Release|Win32 73 | {F748FBF4-E153-43F3-A986-4690FF033DCC}.Release|Win32.Build.0 = Release|Win32 74 | {269630A6-5F78-484F-A729-5CD301B5CABA}.Debug|Win32.ActiveCfg = Debug|Win32 75 | {269630A6-5F78-484F-A729-5CD301B5CABA}.Debug|Win32.Build.0 = Debug|Win32 76 | {269630A6-5F78-484F-A729-5CD301B5CABA}.Release|Win32.ActiveCfg = Release|Win32 77 | {269630A6-5F78-484F-A729-5CD301B5CABA}.Release|Win32.Build.0 = Release|Win32 78 | EndGlobalSection 79 | GlobalSection(SolutionProperties) = preSolution 80 | HideSolutionNode = FALSE 81 | EndGlobalSection 82 | EndGlobal 83 | -------------------------------------------------------------------------------- /current/vs2005/cpp/urg_cpp/urg_cpp.vcproj: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/UrgNetwork/urg_library/c10c1dc78328feb5d62a0a8a1a3c2f87a253307a/current/vs2005/cpp/urg_cpp/urg_cpp.vcproj -------------------------------------------------------------------------------- /current/vs2010/c/urg.sln: -------------------------------------------------------------------------------- 1 |  2 | Microsoft Visual Studio Solution File, Format Version 11.00 3 | # Visual Studio 2010 4 | Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "get_distance", "get_distance\get_distance.vcxproj", "{8F73522C-18D0-4436-B444-3E17A2A84788}" 5 | EndProject 6 | Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "urg", "urg\urg.vcxproj", "{269630A6-5F78-484F-A729-5CD301B5CABA}" 7 | EndProject 8 | Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "sensor_parameter", "sensor_parameter\sensor_parameter.vcxproj", "{3347DEB1-A1EC-4242-8079-233B9E5EB0C3}" 9 | EndProject 10 | Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "get_distance_intensity", "get_distance_intensity\get_distance_intensity.vcxproj", "{17A43425-7F91-4D65-A28A-C90B3E22863F}" 11 | EndProject 12 | Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "get_multiecho", "get_multiecho\get_multiecho.vcxproj", "{0C8D756A-E46E-4EA0-8719-5807E6A7A5C0}" 13 | EndProject 14 | Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "get_multiecho_intensity", "get_multiecho_intensity\get_multiecho_intensity.vcxproj", "{AFB48029-6ADD-4F7A-A36C-6F0A67BC0D2C}" 15 | EndProject 16 | Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "calculate_xy", "calculate_xy\calculate_xy.vcxproj", "{64658378-45FE-4BA5-9C28-1A91CDC6C4EB}" 17 | EndProject 18 | Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "sync_time_stamp", "sync_time_stamp\sync_time_stamp.vcxproj", "{EF96A9B9-81AE-4B35-81EC-68DB295963DB}" 19 | EndProject 20 | Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "find_port", "find_port\find_port.vcxproj", "{B1E1DC1F-F6C1-4A11-8A7D-D30E0211A18E}" 21 | EndProject 22 | Global 23 | GlobalSection(SolutionConfigurationPlatforms) = preSolution 24 | Debug|Win32 = Debug|Win32 25 | Debug|x64 = Debug|x64 26 | Release|Win32 = Release|Win32 27 | Release|x64 = Release|x64 28 | EndGlobalSection 29 | GlobalSection(ProjectConfigurationPlatforms) = postSolution 30 | {269630A6-5F78-484F-A729-5CD301B5CABA}.Debug|Win32.ActiveCfg = Debug|Win32 31 | {269630A6-5F78-484F-A729-5CD301B5CABA}.Debug|Win32.Build.0 = Debug|Win32 32 | {269630A6-5F78-484F-A729-5CD301B5CABA}.Debug|x64.ActiveCfg = Debug|x64 33 | {269630A6-5F78-484F-A729-5CD301B5CABA}.Debug|x64.Build.0 = Debug|x64 34 | {269630A6-5F78-484F-A729-5CD301B5CABA}.Release|Win32.ActiveCfg = Release|Win32 35 | {269630A6-5F78-484F-A729-5CD301B5CABA}.Release|Win32.Build.0 = Release|Win32 36 | {269630A6-5F78-484F-A729-5CD301B5CABA}.Release|x64.ActiveCfg = Release|x64 37 | {269630A6-5F78-484F-A729-5CD301B5CABA}.Release|x64.Build.0 = Release|x64 38 | {3347DEB1-A1EC-4242-8079-233B9E5EB0C3}.Debug|Win32.ActiveCfg = Debug|Win32 39 | {3347DEB1-A1EC-4242-8079-233B9E5EB0C3}.Debug|Win32.Build.0 = Debug|Win32 40 | {3347DEB1-A1EC-4242-8079-233B9E5EB0C3}.Debug|x64.ActiveCfg = Debug|x64 41 | {3347DEB1-A1EC-4242-8079-233B9E5EB0C3}.Debug|x64.Build.0 = Debug|x64 42 | {3347DEB1-A1EC-4242-8079-233B9E5EB0C3}.Release|Win32.ActiveCfg = Release|Win32 43 | {3347DEB1-A1EC-4242-8079-233B9E5EB0C3}.Release|Win32.Build.0 = Release|Win32 44 | {3347DEB1-A1EC-4242-8079-233B9E5EB0C3}.Release|x64.ActiveCfg = Release|x64 45 | {3347DEB1-A1EC-4242-8079-233B9E5EB0C3}.Release|x64.Build.0 = Release|x64 46 | {8F73522C-18D0-4436-B444-3E17A2A84788}.Debug|Win32.ActiveCfg = Debug|Win32 47 | {8F73522C-18D0-4436-B444-3E17A2A84788}.Debug|Win32.Build.0 = Debug|Win32 48 | {8F73522C-18D0-4436-B444-3E17A2A84788}.Debug|x64.ActiveCfg = Debug|x64 49 | {8F73522C-18D0-4436-B444-3E17A2A84788}.Debug|x64.Build.0 = Debug|x64 50 | {8F73522C-18D0-4436-B444-3E17A2A84788}.Release|Win32.ActiveCfg = Release|Win32 51 | {8F73522C-18D0-4436-B444-3E17A2A84788}.Release|Win32.Build.0 = Release|Win32 52 | {8F73522C-18D0-4436-B444-3E17A2A84788}.Release|x64.ActiveCfg = Release|x64 53 | {8F73522C-18D0-4436-B444-3E17A2A84788}.Release|x64.Build.0 = Release|x64 54 | {17A43425-7F91-4D65-A28A-C90B3E22863F}.Debug|Win32.ActiveCfg = Debug|Win32 55 | {17A43425-7F91-4D65-A28A-C90B3E22863F}.Debug|Win32.Build.0 = Debug|Win32 56 | {17A43425-7F91-4D65-A28A-C90B3E22863F}.Debug|x64.ActiveCfg = Debug|x64 57 | {17A43425-7F91-4D65-A28A-C90B3E22863F}.Debug|x64.Build.0 = Debug|x64 58 | {17A43425-7F91-4D65-A28A-C90B3E22863F}.Release|Win32.ActiveCfg = Release|Win32 59 | {17A43425-7F91-4D65-A28A-C90B3E22863F}.Release|Win32.Build.0 = Release|Win32 60 | {17A43425-7F91-4D65-A28A-C90B3E22863F}.Release|x64.ActiveCfg = Release|x64 61 | {17A43425-7F91-4D65-A28A-C90B3E22863F}.Release|x64.Build.0 = Release|x64 62 | {0C8D756A-E46E-4EA0-8719-5807E6A7A5C0}.Debug|Win32.ActiveCfg = Debug|Win32 63 | {0C8D756A-E46E-4EA0-8719-5807E6A7A5C0}.Debug|Win32.Build.0 = Debug|Win32 64 | {0C8D756A-E46E-4EA0-8719-5807E6A7A5C0}.Debug|x64.ActiveCfg = Debug|x64 65 | {0C8D756A-E46E-4EA0-8719-5807E6A7A5C0}.Debug|x64.Build.0 = Debug|x64 66 | {0C8D756A-E46E-4EA0-8719-5807E6A7A5C0}.Release|Win32.ActiveCfg = Release|Win32 67 | {0C8D756A-E46E-4EA0-8719-5807E6A7A5C0}.Release|Win32.Build.0 = Release|Win32 68 | {0C8D756A-E46E-4EA0-8719-5807E6A7A5C0}.Release|x64.ActiveCfg = Release|x64 69 | {0C8D756A-E46E-4EA0-8719-5807E6A7A5C0}.Release|x64.Build.0 = Release|x64 70 | {AFB48029-6ADD-4F7A-A36C-6F0A67BC0D2C}.Debug|Win32.ActiveCfg = Debug|Win32 71 | {AFB48029-6ADD-4F7A-A36C-6F0A67BC0D2C}.Debug|Win32.Build.0 = Debug|Win32 72 | {AFB48029-6ADD-4F7A-A36C-6F0A67BC0D2C}.Debug|x64.ActiveCfg = Debug|x64 73 | {AFB48029-6ADD-4F7A-A36C-6F0A67BC0D2C}.Debug|x64.Build.0 = Debug|x64 74 | {AFB48029-6ADD-4F7A-A36C-6F0A67BC0D2C}.Release|Win32.ActiveCfg = Release|Win32 75 | {AFB48029-6ADD-4F7A-A36C-6F0A67BC0D2C}.Release|Win32.Build.0 = Release|Win32 76 | {AFB48029-6ADD-4F7A-A36C-6F0A67BC0D2C}.Release|x64.ActiveCfg = Release|x64 77 | {AFB48029-6ADD-4F7A-A36C-6F0A67BC0D2C}.Release|x64.Build.0 = Release|x64 78 | {64658378-45FE-4BA5-9C28-1A91CDC6C4EB}.Debug|Win32.ActiveCfg = Debug|Win32 79 | {64658378-45FE-4BA5-9C28-1A91CDC6C4EB}.Debug|Win32.Build.0 = Debug|Win32 80 | {64658378-45FE-4BA5-9C28-1A91CDC6C4EB}.Debug|x64.ActiveCfg = Debug|x64 81 | {64658378-45FE-4BA5-9C28-1A91CDC6C4EB}.Debug|x64.Build.0 = Debug|x64 82 | {64658378-45FE-4BA5-9C28-1A91CDC6C4EB}.Release|Win32.ActiveCfg = Release|Win32 83 | {64658378-45FE-4BA5-9C28-1A91CDC6C4EB}.Release|Win32.Build.0 = Release|Win32 84 | {64658378-45FE-4BA5-9C28-1A91CDC6C4EB}.Release|x64.ActiveCfg = Release|x64 85 | {64658378-45FE-4BA5-9C28-1A91CDC6C4EB}.Release|x64.Build.0 = Release|x64 86 | {EF96A9B9-81AE-4B35-81EC-68DB295963DB}.Debug|Win32.ActiveCfg = Debug|Win32 87 | {EF96A9B9-81AE-4B35-81EC-68DB295963DB}.Debug|Win32.Build.0 = Debug|Win32 88 | {EF96A9B9-81AE-4B35-81EC-68DB295963DB}.Debug|x64.ActiveCfg = Debug|x64 89 | {EF96A9B9-81AE-4B35-81EC-68DB295963DB}.Debug|x64.Build.0 = Debug|x64 90 | {EF96A9B9-81AE-4B35-81EC-68DB295963DB}.Release|Win32.ActiveCfg = Release|Win32 91 | {EF96A9B9-81AE-4B35-81EC-68DB295963DB}.Release|Win32.Build.0 = Release|Win32 92 | {EF96A9B9-81AE-4B35-81EC-68DB295963DB}.Release|x64.ActiveCfg = Release|x64 93 | {EF96A9B9-81AE-4B35-81EC-68DB295963DB}.Release|x64.Build.0 = Release|x64 94 | {B1E1DC1F-F6C1-4A11-8A7D-D30E0211A18E}.Debug|Win32.ActiveCfg = Debug|Win32 95 | {B1E1DC1F-F6C1-4A11-8A7D-D30E0211A18E}.Debug|Win32.Build.0 = Debug|Win32 96 | {B1E1DC1F-F6C1-4A11-8A7D-D30E0211A18E}.Debug|x64.ActiveCfg = Debug|x64 97 | {B1E1DC1F-F6C1-4A11-8A7D-D30E0211A18E}.Debug|x64.Build.0 = Debug|x64 98 | {B1E1DC1F-F6C1-4A11-8A7D-D30E0211A18E}.Release|Win32.ActiveCfg = Release|Win32 99 | {B1E1DC1F-F6C1-4A11-8A7D-D30E0211A18E}.Release|Win32.Build.0 = Release|Win32 100 | {B1E1DC1F-F6C1-4A11-8A7D-D30E0211A18E}.Release|x64.ActiveCfg = Release|x64 101 | {B1E1DC1F-F6C1-4A11-8A7D-D30E0211A18E}.Release|x64.Build.0 = Release|x64 102 | EndGlobalSection 103 | GlobalSection(SolutionProperties) = preSolution 104 | HideSolutionNode = FALSE 105 | EndGlobalSection 106 | EndGlobal 107 | -------------------------------------------------------------------------------- /current/vs2015/c/urg.sln: -------------------------------------------------------------------------------- 1 |  2 | Microsoft Visual Studio Solution File, Format Version 12.00 3 | # Visual Studio 14 4 | VisualStudioVersion = 14.0.25420.1 5 | MinimumVisualStudioVersion = 10.0.40219.1 6 | Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "get_distance", "get_distance\get_distance.vcxproj", "{8F73522C-18D0-4436-B444-3E17A2A84788}" 7 | EndProject 8 | Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "urg", "urg\urg.vcxproj", "{269630A6-5F78-484F-A729-5CD301B5CABA}" 9 | EndProject 10 | Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "sensor_parameter", "sensor_parameter\sensor_parameter.vcxproj", "{3347DEB1-A1EC-4242-8079-233B9E5EB0C3}" 11 | EndProject 12 | Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "get_distance_intensity", "get_distance_intensity\get_distance_intensity.vcxproj", "{17A43425-7F91-4D65-A28A-C90B3E22863F}" 13 | EndProject 14 | Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "get_multiecho", "get_multiecho\get_multiecho.vcxproj", "{0C8D756A-E46E-4EA0-8719-5807E6A7A5C0}" 15 | EndProject 16 | Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "get_multiecho_intensity", "get_multiecho_intensity\get_multiecho_intensity.vcxproj", "{AFB48029-6ADD-4F7A-A36C-6F0A67BC0D2C}" 17 | EndProject 18 | Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "calculate_xy", "calculate_xy\calculate_xy.vcxproj", "{64658378-45FE-4BA5-9C28-1A91CDC6C4EB}" 19 | EndProject 20 | Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "sync_time_stamp", "sync_time_stamp\sync_time_stamp.vcxproj", "{EF96A9B9-81AE-4B35-81EC-68DB295963DB}" 21 | EndProject 22 | Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "find_port", "find_port\find_port.vcxproj", "{B1E1DC1F-F6C1-4A11-8A7D-D30E0211A18E}" 23 | EndProject 24 | Global 25 | GlobalSection(SolutionConfigurationPlatforms) = preSolution 26 | Debug|Win32 = Debug|Win32 27 | Debug|x64 = Debug|x64 28 | Release|Win32 = Release|Win32 29 | Release|x64 = Release|x64 30 | EndGlobalSection 31 | GlobalSection(ProjectConfigurationPlatforms) = postSolution 32 | {269630A6-5F78-484F-A729-5CD301B5CABA}.Debug|Win32.ActiveCfg = Debug|Win32 33 | {269630A6-5F78-484F-A729-5CD301B5CABA}.Debug|Win32.Build.0 = Debug|Win32 34 | {269630A6-5F78-484F-A729-5CD301B5CABA}.Debug|x64.ActiveCfg = Debug|x64 35 | {269630A6-5F78-484F-A729-5CD301B5CABA}.Debug|x64.Build.0 = Debug|x64 36 | {269630A6-5F78-484F-A729-5CD301B5CABA}.Release|Win32.ActiveCfg = Release|Win32 37 | {269630A6-5F78-484F-A729-5CD301B5CABA}.Release|Win32.Build.0 = Release|Win32 38 | {269630A6-5F78-484F-A729-5CD301B5CABA}.Release|x64.ActiveCfg = Release|x64 39 | {269630A6-5F78-484F-A729-5CD301B5CABA}.Release|x64.Build.0 = Release|x64 40 | {3347DEB1-A1EC-4242-8079-233B9E5EB0C3}.Debug|Win32.ActiveCfg = Debug|Win32 41 | {3347DEB1-A1EC-4242-8079-233B9E5EB0C3}.Debug|Win32.Build.0 = Debug|Win32 42 | {3347DEB1-A1EC-4242-8079-233B9E5EB0C3}.Debug|x64.ActiveCfg = Debug|x64 43 | {3347DEB1-A1EC-4242-8079-233B9E5EB0C3}.Debug|x64.Build.0 = Debug|x64 44 | {3347DEB1-A1EC-4242-8079-233B9E5EB0C3}.Release|Win32.ActiveCfg = Release|Win32 45 | {3347DEB1-A1EC-4242-8079-233B9E5EB0C3}.Release|Win32.Build.0 = Release|Win32 46 | {3347DEB1-A1EC-4242-8079-233B9E5EB0C3}.Release|x64.ActiveCfg = Release|x64 47 | {3347DEB1-A1EC-4242-8079-233B9E5EB0C3}.Release|x64.Build.0 = Release|x64 48 | {8F73522C-18D0-4436-B444-3E17A2A84788}.Debug|Win32.ActiveCfg = Debug|Win32 49 | {8F73522C-18D0-4436-B444-3E17A2A84788}.Debug|Win32.Build.0 = Debug|Win32 50 | {8F73522C-18D0-4436-B444-3E17A2A84788}.Debug|x64.ActiveCfg = Debug|x64 51 | {8F73522C-18D0-4436-B444-3E17A2A84788}.Debug|x64.Build.0 = Debug|x64 52 | {8F73522C-18D0-4436-B444-3E17A2A84788}.Release|Win32.ActiveCfg = Release|Win32 53 | {8F73522C-18D0-4436-B444-3E17A2A84788}.Release|Win32.Build.0 = Release|Win32 54 | {8F73522C-18D0-4436-B444-3E17A2A84788}.Release|x64.ActiveCfg = Release|x64 55 | {8F73522C-18D0-4436-B444-3E17A2A84788}.Release|x64.Build.0 = Release|x64 56 | {17A43425-7F91-4D65-A28A-C90B3E22863F}.Debug|Win32.ActiveCfg = Debug|Win32 57 | {17A43425-7F91-4D65-A28A-C90B3E22863F}.Debug|Win32.Build.0 = Debug|Win32 58 | {17A43425-7F91-4D65-A28A-C90B3E22863F}.Debug|x64.ActiveCfg = Debug|x64 59 | {17A43425-7F91-4D65-A28A-C90B3E22863F}.Debug|x64.Build.0 = Debug|x64 60 | {17A43425-7F91-4D65-A28A-C90B3E22863F}.Release|Win32.ActiveCfg = Release|Win32 61 | {17A43425-7F91-4D65-A28A-C90B3E22863F}.Release|Win32.Build.0 = Release|Win32 62 | {17A43425-7F91-4D65-A28A-C90B3E22863F}.Release|x64.ActiveCfg = Release|x64 63 | {17A43425-7F91-4D65-A28A-C90B3E22863F}.Release|x64.Build.0 = Release|x64 64 | {0C8D756A-E46E-4EA0-8719-5807E6A7A5C0}.Debug|Win32.ActiveCfg = Debug|Win32 65 | {0C8D756A-E46E-4EA0-8719-5807E6A7A5C0}.Debug|Win32.Build.0 = Debug|Win32 66 | {0C8D756A-E46E-4EA0-8719-5807E6A7A5C0}.Debug|x64.ActiveCfg = Debug|x64 67 | {0C8D756A-E46E-4EA0-8719-5807E6A7A5C0}.Debug|x64.Build.0 = Debug|x64 68 | {0C8D756A-E46E-4EA0-8719-5807E6A7A5C0}.Release|Win32.ActiveCfg = Release|Win32 69 | {0C8D756A-E46E-4EA0-8719-5807E6A7A5C0}.Release|Win32.Build.0 = Release|Win32 70 | {0C8D756A-E46E-4EA0-8719-5807E6A7A5C0}.Release|x64.ActiveCfg = Release|x64 71 | {0C8D756A-E46E-4EA0-8719-5807E6A7A5C0}.Release|x64.Build.0 = Release|x64 72 | {AFB48029-6ADD-4F7A-A36C-6F0A67BC0D2C}.Debug|Win32.ActiveCfg = Debug|Win32 73 | {AFB48029-6ADD-4F7A-A36C-6F0A67BC0D2C}.Debug|Win32.Build.0 = Debug|Win32 74 | {AFB48029-6ADD-4F7A-A36C-6F0A67BC0D2C}.Debug|x64.ActiveCfg = Debug|x64 75 | {AFB48029-6ADD-4F7A-A36C-6F0A67BC0D2C}.Debug|x64.Build.0 = Debug|x64 76 | {AFB48029-6ADD-4F7A-A36C-6F0A67BC0D2C}.Release|Win32.ActiveCfg = Release|Win32 77 | {AFB48029-6ADD-4F7A-A36C-6F0A67BC0D2C}.Release|Win32.Build.0 = Release|Win32 78 | {AFB48029-6ADD-4F7A-A36C-6F0A67BC0D2C}.Release|x64.ActiveCfg = Release|x64 79 | {AFB48029-6ADD-4F7A-A36C-6F0A67BC0D2C}.Release|x64.Build.0 = Release|x64 80 | {64658378-45FE-4BA5-9C28-1A91CDC6C4EB}.Debug|Win32.ActiveCfg = Debug|Win32 81 | {64658378-45FE-4BA5-9C28-1A91CDC6C4EB}.Debug|Win32.Build.0 = Debug|Win32 82 | {64658378-45FE-4BA5-9C28-1A91CDC6C4EB}.Debug|x64.ActiveCfg = Debug|x64 83 | {64658378-45FE-4BA5-9C28-1A91CDC6C4EB}.Debug|x64.Build.0 = Debug|x64 84 | {64658378-45FE-4BA5-9C28-1A91CDC6C4EB}.Release|Win32.ActiveCfg = Release|Win32 85 | {64658378-45FE-4BA5-9C28-1A91CDC6C4EB}.Release|Win32.Build.0 = Release|Win32 86 | {64658378-45FE-4BA5-9C28-1A91CDC6C4EB}.Release|x64.ActiveCfg = Release|x64 87 | {64658378-45FE-4BA5-9C28-1A91CDC6C4EB}.Release|x64.Build.0 = Release|x64 88 | {EF96A9B9-81AE-4B35-81EC-68DB295963DB}.Debug|Win32.ActiveCfg = Debug|Win32 89 | {EF96A9B9-81AE-4B35-81EC-68DB295963DB}.Debug|Win32.Build.0 = Debug|Win32 90 | {EF96A9B9-81AE-4B35-81EC-68DB295963DB}.Debug|x64.ActiveCfg = Debug|x64 91 | {EF96A9B9-81AE-4B35-81EC-68DB295963DB}.Debug|x64.Build.0 = Debug|x64 92 | {EF96A9B9-81AE-4B35-81EC-68DB295963DB}.Release|Win32.ActiveCfg = Release|Win32 93 | {EF96A9B9-81AE-4B35-81EC-68DB295963DB}.Release|Win32.Build.0 = Release|Win32 94 | {EF96A9B9-81AE-4B35-81EC-68DB295963DB}.Release|x64.ActiveCfg = Release|x64 95 | {EF96A9B9-81AE-4B35-81EC-68DB295963DB}.Release|x64.Build.0 = Release|x64 96 | {B1E1DC1F-F6C1-4A11-8A7D-D30E0211A18E}.Debug|Win32.ActiveCfg = Debug|Win32 97 | {B1E1DC1F-F6C1-4A11-8A7D-D30E0211A18E}.Debug|Win32.Build.0 = Debug|Win32 98 | {B1E1DC1F-F6C1-4A11-8A7D-D30E0211A18E}.Debug|x64.ActiveCfg = Debug|x64 99 | {B1E1DC1F-F6C1-4A11-8A7D-D30E0211A18E}.Debug|x64.Build.0 = Debug|x64 100 | {B1E1DC1F-F6C1-4A11-8A7D-D30E0211A18E}.Release|Win32.ActiveCfg = Release|Win32 101 | {B1E1DC1F-F6C1-4A11-8A7D-D30E0211A18E}.Release|Win32.Build.0 = Release|Win32 102 | {B1E1DC1F-F6C1-4A11-8A7D-D30E0211A18E}.Release|x64.ActiveCfg = Release|x64 103 | {B1E1DC1F-F6C1-4A11-8A7D-D30E0211A18E}.Release|x64.Build.0 = Release|x64 104 | EndGlobalSection 105 | GlobalSection(SolutionProperties) = preSolution 106 | HideSolutionNode = FALSE 107 | EndGlobalSection 108 | EndGlobal 109 | -------------------------------------------------------------------------------- /current/vs2019/c/urg.sln: -------------------------------------------------------------------------------- 1 |  2 | Microsoft Visual Studio Solution File, Format Version 12.00 3 | # Visual Studio 15 4 | VisualStudioVersion = 15.0.27428.2011 5 | MinimumVisualStudioVersion = 10.0.40219.1 6 | Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "get_distance", "get_distance\get_distance.vcxproj", "{8F73522C-18D0-4436-B444-3E17A2A84788}" 7 | EndProject 8 | Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "urg", "urg\urg.vcxproj", "{269630A6-5F78-484F-A729-5CD301B5CABA}" 9 | EndProject 10 | Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "sensor_parameter", "sensor_parameter\sensor_parameter.vcxproj", "{3347DEB1-A1EC-4242-8079-233B9E5EB0C3}" 11 | EndProject 12 | Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "get_distance_intensity", "get_distance_intensity\get_distance_intensity.vcxproj", "{17A43425-7F91-4D65-A28A-C90B3E22863F}" 13 | EndProject 14 | Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "get_multiecho", "get_multiecho\get_multiecho.vcxproj", "{0C8D756A-E46E-4EA0-8719-5807E6A7A5C0}" 15 | EndProject 16 | Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "get_multiecho_intensity", "get_multiecho_intensity\get_multiecho_intensity.vcxproj", "{AFB48029-6ADD-4F7A-A36C-6F0A67BC0D2C}" 17 | EndProject 18 | Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "calculate_xy", "calculate_xy\calculate_xy.vcxproj", "{64658378-45FE-4BA5-9C28-1A91CDC6C4EB}" 19 | EndProject 20 | Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "sync_time_stamp", "sync_time_stamp\sync_time_stamp.vcxproj", "{EF96A9B9-81AE-4B35-81EC-68DB295963DB}" 21 | EndProject 22 | Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "find_port", "find_port\find_port.vcxproj", "{B1E1DC1F-F6C1-4A11-8A7D-D30E0211A18E}" 23 | EndProject 24 | Global 25 | GlobalSection(SolutionConfigurationPlatforms) = preSolution 26 | Debug|Win32 = Debug|Win32 27 | Debug|x64 = Debug|x64 28 | Release|Win32 = Release|Win32 29 | Release|x64 = Release|x64 30 | EndGlobalSection 31 | GlobalSection(ProjectConfigurationPlatforms) = postSolution 32 | {269630A6-5F78-484F-A729-5CD301B5CABA}.Debug|Win32.ActiveCfg = Debug|Win32 33 | {269630A6-5F78-484F-A729-5CD301B5CABA}.Debug|Win32.Build.0 = Debug|Win32 34 | {269630A6-5F78-484F-A729-5CD301B5CABA}.Debug|x64.ActiveCfg = Debug|x64 35 | {269630A6-5F78-484F-A729-5CD301B5CABA}.Debug|x64.Build.0 = Debug|x64 36 | {269630A6-5F78-484F-A729-5CD301B5CABA}.Release|Win32.ActiveCfg = Release|Win32 37 | {269630A6-5F78-484F-A729-5CD301B5CABA}.Release|Win32.Build.0 = Release|Win32 38 | {269630A6-5F78-484F-A729-5CD301B5CABA}.Release|x64.ActiveCfg = Release|x64 39 | {269630A6-5F78-484F-A729-5CD301B5CABA}.Release|x64.Build.0 = Release|x64 40 | {3347DEB1-A1EC-4242-8079-233B9E5EB0C3}.Debug|Win32.ActiveCfg = Debug|Win32 41 | {3347DEB1-A1EC-4242-8079-233B9E5EB0C3}.Debug|Win32.Build.0 = Debug|Win32 42 | {3347DEB1-A1EC-4242-8079-233B9E5EB0C3}.Debug|x64.ActiveCfg = Debug|x64 43 | {3347DEB1-A1EC-4242-8079-233B9E5EB0C3}.Debug|x64.Build.0 = Debug|x64 44 | {3347DEB1-A1EC-4242-8079-233B9E5EB0C3}.Release|Win32.ActiveCfg = Release|Win32 45 | {3347DEB1-A1EC-4242-8079-233B9E5EB0C3}.Release|Win32.Build.0 = Release|Win32 46 | {3347DEB1-A1EC-4242-8079-233B9E5EB0C3}.Release|x64.ActiveCfg = Release|x64 47 | {3347DEB1-A1EC-4242-8079-233B9E5EB0C3}.Release|x64.Build.0 = Release|x64 48 | {8F73522C-18D0-4436-B444-3E17A2A84788}.Debug|Win32.ActiveCfg = Debug|Win32 49 | {8F73522C-18D0-4436-B444-3E17A2A84788}.Debug|Win32.Build.0 = Debug|Win32 50 | {8F73522C-18D0-4436-B444-3E17A2A84788}.Debug|x64.ActiveCfg = Debug|x64 51 | {8F73522C-18D0-4436-B444-3E17A2A84788}.Debug|x64.Build.0 = Debug|x64 52 | {8F73522C-18D0-4436-B444-3E17A2A84788}.Release|Win32.ActiveCfg = Release|Win32 53 | {8F73522C-18D0-4436-B444-3E17A2A84788}.Release|Win32.Build.0 = Release|Win32 54 | {8F73522C-18D0-4436-B444-3E17A2A84788}.Release|x64.ActiveCfg = Release|x64 55 | {8F73522C-18D0-4436-B444-3E17A2A84788}.Release|x64.Build.0 = Release|x64 56 | {17A43425-7F91-4D65-A28A-C90B3E22863F}.Debug|Win32.ActiveCfg = Debug|Win32 57 | {17A43425-7F91-4D65-A28A-C90B3E22863F}.Debug|Win32.Build.0 = Debug|Win32 58 | {17A43425-7F91-4D65-A28A-C90B3E22863F}.Debug|x64.ActiveCfg = Debug|x64 59 | {17A43425-7F91-4D65-A28A-C90B3E22863F}.Debug|x64.Build.0 = Debug|x64 60 | {17A43425-7F91-4D65-A28A-C90B3E22863F}.Release|Win32.ActiveCfg = Release|Win32 61 | {17A43425-7F91-4D65-A28A-C90B3E22863F}.Release|Win32.Build.0 = Release|Win32 62 | {17A43425-7F91-4D65-A28A-C90B3E22863F}.Release|x64.ActiveCfg = Release|x64 63 | {17A43425-7F91-4D65-A28A-C90B3E22863F}.Release|x64.Build.0 = Release|x64 64 | {0C8D756A-E46E-4EA0-8719-5807E6A7A5C0}.Debug|Win32.ActiveCfg = Debug|Win32 65 | {0C8D756A-E46E-4EA0-8719-5807E6A7A5C0}.Debug|Win32.Build.0 = Debug|Win32 66 | {0C8D756A-E46E-4EA0-8719-5807E6A7A5C0}.Debug|x64.ActiveCfg = Debug|x64 67 | {0C8D756A-E46E-4EA0-8719-5807E6A7A5C0}.Debug|x64.Build.0 = Debug|x64 68 | {0C8D756A-E46E-4EA0-8719-5807E6A7A5C0}.Release|Win32.ActiveCfg = Release|Win32 69 | {0C8D756A-E46E-4EA0-8719-5807E6A7A5C0}.Release|Win32.Build.0 = Release|Win32 70 | {0C8D756A-E46E-4EA0-8719-5807E6A7A5C0}.Release|x64.ActiveCfg = Release|x64 71 | {0C8D756A-E46E-4EA0-8719-5807E6A7A5C0}.Release|x64.Build.0 = Release|x64 72 | {AFB48029-6ADD-4F7A-A36C-6F0A67BC0D2C}.Debug|Win32.ActiveCfg = Debug|Win32 73 | {AFB48029-6ADD-4F7A-A36C-6F0A67BC0D2C}.Debug|Win32.Build.0 = Debug|Win32 74 | {AFB48029-6ADD-4F7A-A36C-6F0A67BC0D2C}.Debug|x64.ActiveCfg = Debug|x64 75 | {AFB48029-6ADD-4F7A-A36C-6F0A67BC0D2C}.Debug|x64.Build.0 = Debug|x64 76 | {AFB48029-6ADD-4F7A-A36C-6F0A67BC0D2C}.Release|Win32.ActiveCfg = Release|Win32 77 | {AFB48029-6ADD-4F7A-A36C-6F0A67BC0D2C}.Release|Win32.Build.0 = Release|Win32 78 | {AFB48029-6ADD-4F7A-A36C-6F0A67BC0D2C}.Release|x64.ActiveCfg = Release|x64 79 | {AFB48029-6ADD-4F7A-A36C-6F0A67BC0D2C}.Release|x64.Build.0 = Release|x64 80 | {64658378-45FE-4BA5-9C28-1A91CDC6C4EB}.Debug|Win32.ActiveCfg = Debug|Win32 81 | {64658378-45FE-4BA5-9C28-1A91CDC6C4EB}.Debug|Win32.Build.0 = Debug|Win32 82 | {64658378-45FE-4BA5-9C28-1A91CDC6C4EB}.Debug|x64.ActiveCfg = Debug|x64 83 | {64658378-45FE-4BA5-9C28-1A91CDC6C4EB}.Debug|x64.Build.0 = Debug|x64 84 | {64658378-45FE-4BA5-9C28-1A91CDC6C4EB}.Release|Win32.ActiveCfg = Release|Win32 85 | {64658378-45FE-4BA5-9C28-1A91CDC6C4EB}.Release|Win32.Build.0 = Release|Win32 86 | {64658378-45FE-4BA5-9C28-1A91CDC6C4EB}.Release|x64.ActiveCfg = Release|x64 87 | {64658378-45FE-4BA5-9C28-1A91CDC6C4EB}.Release|x64.Build.0 = Release|x64 88 | {EF96A9B9-81AE-4B35-81EC-68DB295963DB}.Debug|Win32.ActiveCfg = Debug|Win32 89 | {EF96A9B9-81AE-4B35-81EC-68DB295963DB}.Debug|Win32.Build.0 = Debug|Win32 90 | {EF96A9B9-81AE-4B35-81EC-68DB295963DB}.Debug|x64.ActiveCfg = Debug|x64 91 | {EF96A9B9-81AE-4B35-81EC-68DB295963DB}.Debug|x64.Build.0 = Debug|x64 92 | {EF96A9B9-81AE-4B35-81EC-68DB295963DB}.Release|Win32.ActiveCfg = Release|Win32 93 | {EF96A9B9-81AE-4B35-81EC-68DB295963DB}.Release|Win32.Build.0 = Release|Win32 94 | {EF96A9B9-81AE-4B35-81EC-68DB295963DB}.Release|x64.ActiveCfg = Release|x64 95 | {EF96A9B9-81AE-4B35-81EC-68DB295963DB}.Release|x64.Build.0 = Release|x64 96 | {B1E1DC1F-F6C1-4A11-8A7D-D30E0211A18E}.Debug|Win32.ActiveCfg = Debug|Win32 97 | {B1E1DC1F-F6C1-4A11-8A7D-D30E0211A18E}.Debug|Win32.Build.0 = Debug|Win32 98 | {B1E1DC1F-F6C1-4A11-8A7D-D30E0211A18E}.Debug|x64.ActiveCfg = Debug|x64 99 | {B1E1DC1F-F6C1-4A11-8A7D-D30E0211A18E}.Debug|x64.Build.0 = Debug|x64 100 | {B1E1DC1F-F6C1-4A11-8A7D-D30E0211A18E}.Release|Win32.ActiveCfg = Release|Win32 101 | {B1E1DC1F-F6C1-4A11-8A7D-D30E0211A18E}.Release|Win32.Build.0 = Release|Win32 102 | {B1E1DC1F-F6C1-4A11-8A7D-D30E0211A18E}.Release|x64.ActiveCfg = Release|x64 103 | {B1E1DC1F-F6C1-4A11-8A7D-D30E0211A18E}.Release|x64.Build.0 = Release|x64 104 | EndGlobalSection 105 | GlobalSection(SolutionProperties) = preSolution 106 | HideSolutionNode = FALSE 107 | EndGlobalSection 108 | GlobalSection(ExtensibilityGlobals) = postSolution 109 | SolutionGuid = {E5994FC4-61B1-421F-AC8F-E820F2E4FD89} 110 | EndGlobalSection 111 | EndGlobal 112 | -------------------------------------------------------------------------------- /current/windowsexe/cleanobj.bat: -------------------------------------------------------------------------------- 1 | REM Cleaning obj, exe, and manifest files 2 | 3 | del *.obj *.exe *.manifest *.lib 4 | -------------------------------------------------------------------------------- /current/windowsexe/compile.bat: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/UrgNetwork/urg_library/c10c1dc78328feb5d62a0a8a1a3c2f87a253307a/current/windowsexe/compile.bat -------------------------------------------------------------------------------- /split_comment.rb: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/UrgNetwork/urg_library/c10c1dc78328feb5d62a0a8a1a3c2f87a253307a/split_comment.rb --------------------------------------------------------------------------------