repo_id
stringlengths
19
138
file_path
stringlengths
32
200
content
stringlengths
1
12.9M
__index_level_0__
int64
0
0
apollo_public_repos/apollo/third_party
apollo_public_repos/apollo/third_party/fftw3/workspace.bzl
"""Loads the FFTW3 library""" # Sanitize a dependency so that it works correctly from code that includes # Apollo as a submodule. def clean_dep(dep): return str(Label(dep)) def repo(): native.new_local_repository( name = "fftw3", build_file = clean_dep("//third_party/fftw3:fftw3.BUILD"), path = "/usr/include", )
0
apollo_public_repos/apollo/third_party
apollo_public_repos/apollo/third_party/fftw3/BUILD
load("//tools/install:install.bzl", "install", "install_files", "install_src_files") package( default_visibility = ["//visibility:public"], ) install( name = "install", data_dest = "3rd-fftw3", data = [ ":cyberfile.xml", ":3rd-fftw3.BUILD", ], ) install_src_files( name = "install_src", src_dir = ["."], dest = "3rd-fftw3/src", filter = "*", )
0
apollo_public_repos/apollo/third_party
apollo_public_repos/apollo/third_party/glog/cyberfile.xml
<package format="2"> <name>3rd-glog</name> <version>local</version> <description> Apollo packaged 3rd-glog Lib. </description> <maintainer email="apollo-support@baidu.com">Apollo</maintainer> <license>Apache License 2.0</license> <url type="website">https://www.apollo.auto/</url> <url type="repository">https://github.com/ApolloAuto/apollo</url> <url type="bugtracker">https://github.com/ApolloAuto/apollo/issues</url> <type>third-binary</type> <src_path url="https://github.com/ApolloAuto/apollo">//third_party/glog</src_path> </package>
0
apollo_public_repos/apollo/third_party
apollo_public_repos/apollo/third_party/glog/glog.BUILD
load("@rules_cc//cc:defs.bzl", "cc_library") licenses(["notice"]) package(default_visibility = ["//visibility:public"]) cc_library( name = "glog", includes = ["."], linkopts = [ "-L/usr/local/lib/", "-lglog", ], )
0
apollo_public_repos/apollo/third_party
apollo_public_repos/apollo/third_party/glog/workspace.bzl
"""Loads the gflags library""" # Sanitize a dependency so that it works correctly from code that includes # Apollo as a submodule. def clean_dep(dep): return str(Label(dep)) def repo(): native.new_local_repository( name = "com_github_google_glog", build_file = clean_dep("//third_party/glog:glog.BUILD"), path = "/usr/local/include", )
0
apollo_public_repos/apollo/third_party
apollo_public_repos/apollo/third_party/glog/BUILD
load("//tools/install:install.bzl", "install", "install_files", "install_src_files") package( default_visibility = ["//visibility:public"], ) install( name = "install", data_dest = "3rd-glog", data = [ ":cyberfile.xml", ":3rd-glog.BUILD", ], ) install_src_files( name = "install_src", src_dir = ["."], dest = "3rd-glog/src", filter = "*", )
0
apollo_public_repos/apollo/third_party
apollo_public_repos/apollo/third_party/glog/3rd-glog.BUILD
load("@rules_cc//cc:defs.bzl", "cc_library") licenses(["notice"]) package(default_visibility = ["//visibility:public"]) cc_library( name = "glog", includes = ["include"], hdrs = glob(["include/**/*"]), linkopts = [ "-lglog", ], strip_include_prefix = "include", )
0
apollo_public_repos/apollo/third_party
apollo_public_repos/apollo/third_party/absl/cyberfile.xml
<package format="2"> <name>3rd-absl</name> <version>local</version> <description> Apollo packaged absl Lib. </description> <maintainer email="apollo-support@baidu.com">Apollo</maintainer> <license>Apache License 2.0</license> <url type="website">https://www.apollo.auto/</url> <url type="repository">https://github.com/ApolloAuto/apollo</url> <url type="bugtracker">https://github.com/ApolloAuto/apollo/issues</url> <type>third-binary</type> <src_path url="https://github.com/ApolloAuto/apollo">//third_party/absl</src_path> </package>
0
apollo_public_repos/apollo/third_party
apollo_public_repos/apollo/third_party/absl/grpc.patch
--- bazel/grpc_build_system.bzl +++ bazel/grpc_build_system.bzl @@ -56,7 +56,8 @@ def _get_external_deps(external_deps): elif dep == "cronet_c_for_grpc": ret += ["//third_party/objective_c/Cronet:cronet_c_for_grpc"] elif dep.startswith("absl/"): - ret += ["@com_google_absl//" + dep] + if "@com_google_absl//:absl" not in ret: + ret += ["@com_google_absl//:absl"] else: ret += ["//external:" + dep] return ret
0
apollo_public_repos/apollo/third_party
apollo_public_repos/apollo/third_party/absl/absl.BUILD
load("@rules_cc//cc:defs.bzl", "cc_library") licenses(["notice"]) package(default_visibility = ["//visibility:public"]) cc_library( name = "absl", srcs = glob(["lib/*.so*"]), hdrs = glob(["include/*.h"]), includes = [ "include", ], )
0
apollo_public_repos/apollo/third_party
apollo_public_repos/apollo/third_party/absl/workspace.bzl
"""Loads the absl library""" # Sanitize a dependency so that it works correctly from code that includes # Apollo as a submodule. def clean_dep(dep): return str(Label(dep)) def repo(): native.new_local_repository( name = "com_google_absl", build_file = clean_dep("//third_party/absl:absl.BUILD"), path = "/opt/apollo/absl/", )
0
apollo_public_repos/apollo/third_party
apollo_public_repos/apollo/third_party/absl/BUILD
load("//tools/install:install.bzl", "install", "install_files", "install_src_files") package( default_visibility = ["//visibility:public"], ) install( name = "install", data_dest = "3rd-absl", data = [ ":cyberfile.xml", ":3rd-absl.BUILD", ], ) install_src_files( name = "install_src", src_dir = ["."], dest = "3rd-absl/src", filter = "*", )
0
apollo_public_repos/apollo/third_party
apollo_public_repos/apollo/third_party/absl/3rd-absl.BUILD
load("@rules_cc//cc:defs.bzl", "cc_library") cc_library( name = "absl", includes = [ "include", ], srcs = glob(["lib/*.so*"]), hdrs = glob(["include/**/*"]), strip_include_prefix = "include", visibility = ["//visibility:public"], )
0
apollo_public_repos/apollo/third_party
apollo_public_repos/apollo/third_party/adv_plat/cyberfile.xml
<package format="2"> <name>3rd-adv-plat</name> <version>local</version> <description> Apollo packaged 3rd-adv-plat Lib. </description> <maintainer email="apollo-support@baidu.com">Apollo</maintainer> <license>Apache License 2.0</license> <url type="website">https://www.apollo.auto/</url> <url type="repository">https://github.com/ApolloAuto/apollo</url> <url type="bugtracker">https://github.com/ApolloAuto/apollo/issues</url> <type>third-binary</type> <src_path url="https://github.com/ApolloAuto/apollo">//third_party/adv_plat</src_path> </package>
0
apollo_public_repos/apollo/third_party
apollo_public_repos/apollo/third_party/adv_plat/adv_plat.BUILD
load("@rules_cc//cc:defs.bzl", "cc_library") package(default_visibility = ["//visibility:public"]) licenses(["notice"]) cc_library( name = "adv_plat", hdrs = [ "adv_trigger.h", "bcan.h", "linux/bcan_defs.h", "linux/zynq_api.h", ], includes = [ ".", ], linkopts = [ "-L/opt/apollo/pkgs/adv_plat/lib", "-ladv_trigger", "-ladv_bcan", ], )
0
apollo_public_repos/apollo/third_party
apollo_public_repos/apollo/third_party/adv_plat/workspace.bzl
"""Loads the adv_plat library""" # Sanitize a dependency so that it works correctly from code that includes # Apollo as a submodule. def clean_dep(dep): return str(Label(dep)) def repo(): native.new_local_repository( name = "adv_plat", build_file = clean_dep("//third_party/adv_plat:adv_plat.BUILD"), path = "/opt/apollo/pkgs/adv_plat/include", )
0
apollo_public_repos/apollo/third_party
apollo_public_repos/apollo/third_party/adv_plat/BUILD
load("//tools/install:install.bzl", "install", "install_files", "install_src_files") package( default_visibility = ["//visibility:public"], ) install( name = "install", data_dest = "3rd-adv-plat", data = [ ":cyberfile.xml", ":3rd-adv-plat.BUILD", ], ) install_src_files( name = "install_src", src_dir = ["."], dest = "3rd-adv-plat/src", filter = "*", )
0
apollo_public_repos/apollo/third_party
apollo_public_repos/apollo/third_party/adv_plat/3rd-adv-plat.BUILD
load("@rules_cc//cc:defs.bzl", "cc_library") package(default_visibility = ["//visibility:public"]) licenses(["notice"]) cc_library( name = "adv_plat", hdrs = glob(["include/**/*"]), linkopts = [ "-ladv_trigger", "-ladv_bcan", ], strip_include_prefix = "include", )
0
apollo_public_repos/apollo/third_party
apollo_public_repos/apollo/third_party/caddn_infer_op/init.bzl
"""Loads the caddn_infer_op library""" load("//third_party/caddn_infer_op:workspace.bzl", "repo") def init(): repo()
0
apollo_public_repos/apollo/third_party
apollo_public_repos/apollo/third_party/caddn_infer_op/cyberfile.xml
<package format="2"> <name>3rd-caddn-infer-op</name> <version>local</version> <description> Apollo packaged civetweb Lib. </description> <maintainer email="apollo-support@baidu.com">Apollo</maintainer> <license>Apache License 2.0</license> <url type="website">https://www.apollo.auto/</url> <url type="repository">https://github.com/ApolloAuto/apollo</url> <url type="bugtracker">https://github.com/ApolloAuto/apollo/issues</url> <type>third-wrapper</type> <src_path url="https://github.com/ApolloAuto/apollo">//third_party/caddn_infer_op</src_path> </package>
0
apollo_public_repos/apollo/third_party
apollo_public_repos/apollo/third_party/caddn_infer_op/workspace.bzl
"""Loads the paddlelite library""" # Sanitize a dependency so that it works correctly from code that includes # Apollo as a submodule. load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive") def clean_dep(dep): return str(Label(dep)) def repo(): http_archive( name = "caddn_infer_op", sha256 = "8cf2f7444de837b80a5a23783dc58f8e372a5eb61f76cbbc543f0c036ecc73ce", strip_prefix = "caddn_infer_op", urls = [ "https://apollo-system.bj.bcebos.com/archive/v8.0_bev/caddn_infer_op.tar.gz", ], )
0
apollo_public_repos/apollo/third_party
apollo_public_repos/apollo/third_party/caddn_infer_op/BUILD
load("//tools/install:install.bzl", "install", "install_files", "install_src_files") package( default_visibility = ["//visibility:public"], ) install( name = "install_lib", data_dest = "3rd-caddn-infer-op/lib", data = glob([ "lib*.so" ]) ) install( name = "install", data_dest = "3rd-caddn-infer-op", data = [ ":cyberfile.xml", ], deps = ["install_lib"] ) install_src_files( name = "install_src", src_dir = ["."], dest = "3rd-caddn-infer-op/src", filter = "*", )
0
apollo_public_repos/apollo/third_party
apollo_public_repos/apollo/third_party/ipopt/cyberfile.xml
<package format="2"> <name>3rd-ipopt</name> <version>local</version> <description> Apollo packaged ipopt Lib. </description> <maintainer email="apollo-support@baidu.com">Apollo</maintainer> <license>Apache License 2.0</license> <url type="website">https://www.apollo.auto/</url> <url type="repository">https://github.com/ApolloAuto/apollo</url> <url type="bugtracker">https://github.com/ApolloAuto/apollo/issues</url> <type>third-binary</type> <src_path url="https://github.com/ApolloAuto/apollo">//third_party/ipopt</src_path> </package>
0
apollo_public_repos/apollo/third_party
apollo_public_repos/apollo/third_party/ipopt/3rd-ipopt.BUILD
load("@rules_cc//cc:defs.bzl", "cc_library") package(default_visibility = ["//visibility:public"]) licenses(["notice"]) cc_library( name = "ipopt", includes = ["include"], hdrs = glob(["include/**/*"]), linkopts = [ "-lipopt", ], strip_include_prefix = "include", )
0
apollo_public_repos/apollo/third_party
apollo_public_repos/apollo/third_party/ipopt/ipopt.BUILD
load("@rules_cc//cc:defs.bzl", "cc_library") package(default_visibility = ["//visibility:public"]) licenses(["notice"]) cc_library( name = "ipopt", includes = ["."], linkopts = [ "-lipopt", ], )
0
apollo_public_repos/apollo/third_party
apollo_public_repos/apollo/third_party/ipopt/workspace.bzl
"""Loads the ipopt library""" # Sanitize a dependency so that it works correctly from code that includes # Apollo as a submodule. def clean_dep(dep): return str(Label(dep)) def repo(): # ipopt native.new_local_repository( name = "ipopt", build_file = clean_dep("//third_party/ipopt:ipopt.BUILD"), path = "/usr/include", )
0
apollo_public_repos/apollo/third_party
apollo_public_repos/apollo/third_party/ipopt/BUILD
load("//tools/install:install.bzl", "install", "install_files", "install_src_files") package( default_visibility = ["//visibility:public"], ) install( name = "install", data_dest = "3rd-ipopt", data = [ ":cyberfile.xml", ":3rd-ipopt.BUILD", ], ) install_src_files( name = "install_src", src_dir = ["."], dest = "3rd-ipopt/src", filter = "*", )
0
apollo_public_repos/apollo/third_party
apollo_public_repos/apollo/third_party/camera_library/3rd-camera-library.BUILD
load("@rules_cc//cc:defs.bzl", "cc_library") package(default_visibility = ["//visibility:public"]) licenses(["notice"]) cc_library( name = "smartereye", srcs = glob(["lib/*.so*"]), hdrs = glob(["include/*.h"]), copts = [ "-Iinclude", ], linkopts = [ "-Llib", ], include_prefix = "third_party/camera_library/smartereye", visibility = ["//visibility:public"], )
0
apollo_public_repos/apollo/third_party
apollo_public_repos/apollo/third_party/camera_library/cyberfile.xml
<package format="2"> <name>3rd-camera-library</name> <version>local</version> <description> Apollo packaged camera library. </description> <maintainer email="apollo-support@baidu.com">Apollo</maintainer> <license>Apache License 2.0</license> <url type="website">https://www.apollo.auto/</url> <url type="repository">https://github.com/ApolloAuto/apollo</url> <url type="bugtracker">https://github.com/ApolloAuto/apollo/issues</url> <type>module</type> <src_path url="https://github.com/ApolloAuto/apollo">//third_party/camera_library</src_path> </package>
0
apollo_public_repos/apollo/third_party
apollo_public_repos/apollo/third_party/camera_library/BUILD
load("//tools/install:install.bzl", "install", "install_files", "install_src_files") package(default_visibility = ["//visibility:public"]) install( name = "install", data_dest = "3rd-camera-library", data = [ ":cyberfile.xml", ":3rd-camera-library.BUILD" ], ) install_src_files( name = "lib_placeholder", src_dir = ["."], dest = "3rd-camera-library/lib", filter = "3rd-camera-library.BUILD" ) install_src_files( name = "install_src", src_dir = ["."], dest = "3rd-camera-library/src", filter = "*", deps = ["//third_party/camera_library/smartereye:headers", ":lib_placeholder"] )
0
apollo_public_repos/apollo/third_party/camera_library
apollo_public_repos/apollo/third_party/camera_library/smartereye/BUILD
load("@rules_cc//cc:defs.bzl", "cc_library") load("//tools/install:install.bzl", "install", "install_files", "install_src_files") package(default_visibility = ["//visibility:public"]) licenses(["notice"]) cc_library( name = "smartereye", srcs = glob(["lib/*.so*"]), hdrs = glob(["include/*.h"]), copts = [ "-Iinclude", ], includes = [ "include", ], linkopts = [ "-Llib", ], visibility = ["//visibility:public"], ) install_src_files( name = "headers", src_dir = ["include"], dest = "3rd-camera-library/include", filter = "*", )
0
apollo_public_repos/apollo/third_party/camera_library/smartereye
apollo_public_repos/apollo/third_party/camera_library/smartereye/include/rtdbsender.h
/****************************************************************************** * Copyright 2020 The Beijing Smarter Eye Technology Co.Ltd Authors. All * Rights Reserved. * * Licensed under the Apache License, Version 2.0 (the License); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an AS IS BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. *****************************************************************************/ #ifndef RTDBADAPTER_H #define RTDBADAPTER_H #include <QObject> #include "satpext_global.h" #include "rtdbservice.h" #include "blockhandler.h" namespace SATP { class Protocol; } class SATPEXTSHARED_EXPORT RtdbSender : public RtdbService, public SATP::BlockHandler { Q_OBJECT public: RtdbSender(RealtimeDatabase *rtdb, SATP::Protocol *protocol, QObject *parent = nullptr); virtual ~RtdbSender(); //override BlockHandler bool handleReceiveBlock(uint32_t dataType, const char *block, int size); void handleReady(); protected: void handleMessage(int type, const char *message, int size); void sendRtdb(); private: SATP::Protocol *mProtocol; }; #endif // RTDBADAPTER_H
0
apollo_public_repos/apollo/third_party/camera_library/smartereye
apollo_public_repos/apollo/third_party/camera_library/smartereye/include/protocol.h
/****************************************************************************** * Copyright 2020 The Beijing Smarter Eye Technology Co.Ltd Authors. All * Rights Reserved. * * Licensed under the Apache License, Version 2.0 (the License); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an AS IS BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. *****************************************************************************/ #ifndef PROTOCOL_H #define PROTOCOL_H #include <cstdint> namespace SATP { class BlockHandler; class Protocol { public: enum TramsmitPriority { DropWhenBusy = 0, EnqueueForcedly, WaitToSend }; virtual bool isConnected() = 0; virtual bool isAppendable() = 0; virtual void sendBlock(uint32_t dataType, const char *block, int size, TramsmitPriority priority = DropWhenBusy) = 0; virtual void registerBlockHandler(BlockHandler *blockHandler) = 0; virtual void unregisterBlockHandler(BlockHandler *blockHandler) = 0; }; } #endif // PROTOCOL_H
0
apollo_public_repos/apollo/third_party/camera_library/smartereye
apollo_public_repos/apollo/third_party/camera_library/smartereye/include/stereocameradef.h
/****************************************************************************** * Copyright 2020 The Beijing Smarter Eye Technology Co.Ltd Authors. All * Rights Reserved. * * Licensed under the Apache License, Version 2.0 (the License); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an AS IS BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. *****************************************************************************/ #ifndef STEREOCAMERADEF_H #define STEREOCAMERADEF_H #ifdef _WIN64 # define STEREO_EXPORT __declspec(dllexport) # define STEREO_IMPORT __declspec(dllimport) #else # define STEREO_EXPORT __attribute__((visibility("default"))) # define STEREO_IMPORT __attribute__((visibility("default"))) # define STEREO_HIDDEN __attribute__((visibility("hidden"))) #endif #if defined(STEREOCAMERA_LIBRARY) # define STEREO_SHARED_EXPORT STEREO_EXPORT #else # define STEREO_SHARED_EXPORT STEREO_IMPORT #endif #endif // STEREOCAMERADEF_H
0
apollo_public_repos/apollo/third_party/camera_library/smartereye
apollo_public_repos/apollo/third_party/camera_library/smartereye/include/protocolunit.h
/****************************************************************************** * Copyright 2020 The Beijing Smarter Eye Technology Co.Ltd Authors. All * Rights Reserved. * * Licensed under the Apache License, Version 2.0 (the License); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an AS IS BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. *****************************************************************************/ #ifndef PROTOCOLUNIT_H #define PROTOCOLUNIT_H #include <cstdint> #pragma pack(push, 1) #define SATP_MAX_PROTOCOL_UNIT_LEN 500000 namespace SATP { enum ProtocolUnitFormat { FixedProtocolUnitFormat, LongProtocolUnitFormat }; //only apply for Fixed format; enum ProtocolUnitType { HeartBeatReq, HeartBeatResp, HeartBeatCon }; struct ProtocolUnitHead { uint16_t token; uint32_t dataUnitSize; uint16_t format; uint16_t type; }; inline int maxDataUnitSize() { return SATP_MAX_PROTOCOL_UNIT_LEN - sizeof(ProtocolUnitHead); } } #pragma pack(pop) #endif // PROTOCOLUNIT_H
0
apollo_public_repos/apollo/third_party/camera_library/smartereye
apollo_public_repos/apollo/third_party/camera_library/smartereye/include/frameformat.h
/****************************************************************************** * Copyright 2020 The Beijing Smarter Eye Technology Co.Ltd Authors. All * Rights Reserved. * * Licensed under the Apache License, Version 2.0 (the License); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an AS IS BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. *****************************************************************************/ #ifndef FRAMEFORMATDEF #define FRAMEFORMATDEF struct FrameFormat { enum Enumeration { Gray = 0, Color = 1, YUV422 = 2, RGB565 = 3, YUV422Plannar = 4, Custom = 65, Disparity7 = 512, Disparity8, Disparity10, Disparity12, DisparitySparse, Disparity16, DisparityDens16, DefaultFormat = Gray, }; static int getDisparityBitNum(const unsigned short format) { int disparityBitNum; switch(format) { case Disparity7: disparityBitNum = 0; break; case Disparity8: disparityBitNum = 1; break; case Disparity12: disparityBitNum = 4; break; case Disparity16: case DisparityDens16: disparityBitNum = 5; break; case DisparitySparse: disparityBitNum = 16; break; default: disparityBitNum = -1; } return disparityBitNum; } static int getBitWidth(const unsigned short format) { int bitwidth; switch(format) { case Gray: case Disparity7: case Disparity8: bitwidth = 8; break; case Disparity12: bitwidth = 12; break; case Disparity16: case DisparitySparse: case YUV422: case YUV422Plannar: case RGB565: case DisparityDens16: bitwidth = 16; break; case Color: bitwidth = 24; break; default: bitwidth = -1; } return bitwidth; } }; #endif // FRAMEDEF
0
apollo_public_repos/apollo/third_party/camera_library/smartereye
apollo_public_repos/apollo/third_party/camera_library/smartereye/include/satpext_global.h
/****************************************************************************** * Copyright 2020 The Beijing Smarter Eye Technology Co.Ltd Authors. All * Rights Reserved. * * Licensed under the Apache License, Version 2.0 (the License); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an AS IS BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. *****************************************************************************/ #ifndef SATPEXT_GLOBAL_H #define SATPEXT_GLOBAL_H #include <QtCore/qglobal.h> #if defined(SATPEXT_LIBRARY) # define SATPEXTSHARED_EXPORT Q_DECL_EXPORT #else # define SATPEXTSHARED_EXPORT Q_DECL_IMPORT #endif #endif // SATPEXT_GLOBAL_H
0
apollo_public_repos/apollo/third_party/camera_library/smartereye
apollo_public_repos/apollo/third_party/camera_library/smartereye/include/dataunit.h
/****************************************************************************** * Copyright 2020 The Beijing Smarter Eye Technology Co.Ltd Authors. All * Rights Reserved. * * Licensed under the Apache License, Version 2.0 (the License); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an AS IS BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. *****************************************************************************/ #ifndef DATAUNIT_H #define DATAUNIT_H #include "protocolunit.h" #pragma pack(push, 1) namespace SATP { struct DataUnitHead { uint32_t dataType; uint16_t continued; inline DataUnitHead(uint32_t type = 0): dataType(type), continued(0) { } inline const char *data() { return (const char*)this; } inline const char *body() { return (const char*)this + sizeof(DataUnitHead); } inline static int bodySize(int dataUnitSize) { return dataUnitSize - sizeof(DataUnitHead); } }; inline int maxBlockSize() { return maxDataUnitSize() - sizeof(DataUnitHead); } } #pragma pack(pop) #endif // DATAUNIT_H
0
apollo_public_repos/apollo/third_party/camera_library/smartereye
apollo_public_repos/apollo/third_party/camera_library/smartereye/include/camerahandler.h
/****************************************************************************** * Copyright 2020 The Beijing Smarter Eye Technology Co.Ltd Authors. All * Rights Reserved. * * Licensed under the Apache License, Version 2.0 (the License); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an AS IS BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. *****************************************************************************/ #ifndef MYCAMERAHANDLER_H #define MYCAMERAHANDLER_H #include "framehandler.h" struct Result{ bool successed; int warning; }; class CameraHandler : public FrameHandler { public: virtual void handleCameraDataFile(const char *path){} virtual void handleStereoCameraParam(float focus, float baseline, float pixelSize, int opticalCenterX, int opticalCenterY){} virtual void handleUpdateFinished(Result result){} }; #endif // MYCAMERAHANDLER_H
0
apollo_public_repos/apollo/third_party/camera_library/smartereye
apollo_public_repos/apollo/third_party/camera_library/smartereye/include/filesenderhandler.h
/****************************************************************************** * Copyright 2020 The Beijing Smarter Eye Technology Co.Ltd Authors. All * Rights Reserved. * * Licensed under the Apache License, Version 2.0 (the License); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an AS IS BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. *****************************************************************************/ #ifndef FILESENDERHANDLER_H #define FILESENDERHANDLER_H #include <qglobal.h> namespace SATP { class FileSenderHandler { public: virtual void handleSendFileFinished(const QString &fileName) = 0; }; } #endif // FILESENDERHANDLER_H
0
apollo_public_repos/apollo/third_party/camera_library/smartereye
apollo_public_repos/apollo/third_party/camera_library/smartereye/include/blockhandler.h
/****************************************************************************** * Copyright 2020 The Beijing Smarter Eye Technology Co.Ltd Authors. All * Rights Reserved. * * Licensed under the Apache License, Version 2.0 (the License); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an AS IS BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. *****************************************************************************/ #ifndef BLOCKHANDLER_H #define BLOCKHANDLER_H #include <cstdint> #include <memory> using namespace std; namespace SATP { class BlockHandler { public: virtual bool handleReceiveBlock(uint32_t dataType, const char *block, int size) = 0; virtual void handleReset(){} virtual void handleReady(){} }; class EnhancedHandler : public BlockHandler { public: EnhancedHandler() {} virtual bool handleReceiveBlockEnhanced(uint32_t dataType, shared_ptr<const char> &block, int size){ handleReceiveBlock(dataType, block.get(), size); } }; } #endif // BLOCKHANDLER_H
0
apollo_public_repos/apollo/third_party/camera_library/smartereye
apollo_public_repos/apollo/third_party/camera_library/smartereye/include/satpext.h
/****************************************************************************** * Copyright 2020 The Beijing Smarter Eye Technology Co.Ltd Authors. All * Rights Reserved. * * Licensed under the Apache License, Version 2.0 (the License); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an AS IS BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. *****************************************************************************/ #ifndef SATPKEYS #define SATPKEYS #include "dataunit.h" #ifdef _WIN64 #pragma warning(disable: 4200) #endif #pragma pack(push, 1) struct DataUnitTypeExt { enum Enumation { FileHeader = 0, FileTail = 1, FileData = 2, FileResp = 3, Message = 64, Rtdb = 65, Image = 66, UpdateFirmware = 67, RequestRtdb = 68, RequestImage = 69, ResponseUpdate = 70, RawImageFrame = 71, MetaData = 72, RequestMetaData = 73, EnableMaxSendFrameInterval = 74, ChangeRtdbItem = 75, }; }; struct SaptPort { enum Enumation { Default = 52404, //quint16 DefaultUdp = 52410, }; }; union UniqueKey { uint32_t longKey; struct { uint16_t lowWord; uint16_t highWord; }doubleKey; UniqueKey(uint32_t aLongkey) { longKey = aLongkey; } UniqueKey(uint16_t lowWord, uint16_t highWord) { doubleKey.lowWord = lowWord; doubleKey.highWord = highWord; } uint16_t lowWord() { return doubleKey.lowWord; } uint16_t highWord() { return doubleKey.highWord; } private: UniqueKey(); }; struct BlockFileHeader { uint32_t fileSize; inline const char *fileName() const { return reinterpret_cast<const char*>(this) + sizeof(BlockFileHeader); } }; struct BlockFileResp { uint32_t received; uint16_t continued; inline const char *fileName() { return (const char*)this + sizeof(BlockFileResp); } }; struct RawImageFrame { uint16_t frameId; int64_t time; uint16_t index; uint16_t format; uint16_t width; uint16_t height; uint32_t speed; uint32_t dataSize; uint8_t image[0]; }; #pragma pack(pop) #endif // SATPKEYS
0
apollo_public_repos/apollo/third_party/camera_library/smartereye
apollo_public_repos/apollo/third_party/camera_library/smartereye/include/dataprocessordef.h
/****************************************************************************** * Copyright 2020 The Beijing Smarter Eye Technology Co.Ltd Authors. All * Rights Reserved. * * Licensed under the Apache License, Version 2.0 (the License); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an AS IS BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. *****************************************************************************/ #ifndef DATAPROCESSOR_H #define DATAPROCESSOR_H #ifdef _WIN64 # define DATAPROCESSOR_EXPORT __declspec(dllexport) # define DATAPROCESSOR_IMPORT __declspec(dllimport) #else # define DATAPROCESSOR_EXPORT __attribute__((visibility("default"))) # define DATAPROCESSOR_IMPORT __attribute__((visibility("default"))) # define DATAPROCESSOR_HIDDEN __attribute__((visibility("hidden"))) #endif #if defined(DATAPROCESSOR_LIBRARY) # define DATAPROCESSOR_SHARED_EXPORT DATAPROCESSOR_EXPORT #else # define DATAPROCESSOR_SHARED_EXPORT DATAPROCESSOR_IMPORT #endif #endif // DATAPROCESSOR_H
0
apollo_public_repos/apollo/third_party/camera_library/smartereye
apollo_public_repos/apollo/third_party/camera_library/smartereye/include/taskiddef.h
/****************************************************************************** * Copyright 2020 The Beijing Smarter Eye Technology Co.Ltd Authors. All * Rights Reserved. * * Licensed under the Apache License, Version 2.0 (the License); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an AS IS BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. *****************************************************************************/ #ifndef TASKIDDEF_H #define TASKIDDEF_H struct TaskId { enum Enumeration { NoTask = 0, ObstacleTask = 1 << 0, LaneTask = 1 << 1, DisplayTask = 1 << 2, HeightTask = 1 << 3, AllTask = ObstacleTask | LaneTask | DisplayTask | HeightTask }; }; #endif // TASKIDDEF_H
0
apollo_public_repos/apollo/third_party/camera_library/smartereye
apollo_public_repos/apollo/third_party/camera_library/smartereye/include/calibrationparams.h
/****************************************************************************** * Copyright 2020 The Beijing Smarter Eye Technology Co.Ltd Authors. All * Rights Reserved. * * Licensed under the Apache License, Version 2.0 (the License); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an AS IS BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. *****************************************************************************/ #ifndef _CALIBRATIONPARAMS_H_ #define _CALIBRATIONPARAMS_H_ //Stereo camera’s intrinsic and extrinsic params. //The params is suitable after stereo camera calibration and left/right image remap. struct StereoCalibrationParameters { double focus; //(pixel) the camere focus in pixel. The focus value is all the same include left and right camera. double cx; //(pixel) optical axis X center point. The optical axis center point(X, Y) is all the same include left and right camera double cy; //(pixel) optical axis Y center point. double RRoll; //(rad) R-vector include roll, pitch, yaw. double RPitch; double RYaw; double Tx; //(mm) Translation matrix. double Ty; double Tz; }; struct MonoCalibrationParameters { double fx; //(pixel) the axis X focus in pixel. double fy; //(pixel) the axis Y focus in pixel. double cx; //(pixel) optical axis X center point. The optical axis center point(X, Y) is all the same include left and right camera double cy; //(pixel) optical axis Y center point. double k1; //Radial distortion coefficient double k2; double k3; double p1; //Tangential distortion coefficient double p2; }; #endif //_CALIBRATIONPARAMS_H_
0
apollo_public_repos/apollo/third_party/camera_library/smartereye
apollo_public_repos/apollo/third_party/camera_library/smartereye/include/filereceiver.h
/****************************************************************************** * Copyright 2020 The Beijing Smarter Eye Technology Co.Ltd Authors. All * Rights Reserved. * * Licensed under the Apache License, Version 2.0 (the License); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an AS IS BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. *****************************************************************************/ #ifndef FILERECEIVER_H #define FILERECEIVER_H #include <QString> #include <QVector> #include "satpext_global.h" #include "blockhandler.h" class QFile; namespace SATP { class Protocol; class FileReceiverHandler; class SATPEXTSHARED_EXPORT FileReceiver : public BlockHandler { public: explicit FileReceiver(Protocol *protocol); virtual ~FileReceiver(); FileReceiver(const FileReceiver&&){} //override. bool handleReceiveBlock(uint32_t dataType, const char *block, int size); //FileReceiver void registerReceiverHandler(FileReceiverHandler *receiverHandler); double getReceiveProgress(); void setRecvFileDir(const QString &dir); protected: void handleFileHeader(const char *block); void handleFileTail(const char *block); void handleFileData(const char *block, int size); void sendFileResp(bool finished = false); void raiseReceiverHandlers(const QString &filePath); private: QVector<FileReceiverHandler *> mReceiverHandlers; Protocol *mProtocol; int mFileSize; QFile *mFile; int mReceived; int mPacketCount; QString mRecvFileDir; }; } #endif // FILERECEIVER_H
0
apollo_public_repos/apollo/third_party/camera_library/smartereye
apollo_public_repos/apollo/third_party/camera_library/smartereye/include/frameext.h
/****************************************************************************** * Copyright 2020 The Beijing Smarter Eye Technology Co.Ltd Authors. All * Rights Reserved. * * Licensed under the Apache License, Version 2.0 (the License); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an AS IS BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. *****************************************************************************/ #ifndef FRAMEEXT_H #define FRAMEEXT_H #if defined(Q_CC_MSVC) #pragma warning(disable: 4200) #endif #include <cstdint> #pragma pack(push, 1) struct FrameDataExtHead { uint32_t dataType; uint32_t dataSize; char data[0]; enum{ LaneExtData, ObstacleData, DrivingAreaData, OV491_EMBEDED_LINE, }; }; #pragma pack(pop) #endif // FRAMEEXT_H
0
apollo_public_repos/apollo/third_party/camera_library/smartereye
apollo_public_repos/apollo/third_party/camera_library/smartereye/include/rotationmatrix.h
/****************************************************************************** * Copyright 2020 The Beijing Smarter Eye Technology Co.Ltd Authors. All * Rights Reserved. * * Licensed under the Apache License, Version 2.0 (the License); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an AS IS BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. *****************************************************************************/ #ifndef ROTATIONMATRIX_H #define ROTATIONMATRIX_H static const int kNumReal3DToImage = 12; static const int kNumImageToReal3D = 9; struct RotationMatrix { //[tempX] [ m[0], m[1], m[2], m[3] ] [real3DX] //[tempY] = [ m[4], m[5], m[6], m[7] ] * [real3Dy] //[ Z ] [ m[8], m[9], m[10], m[11]] [real3DZ] // [ 1 ] // final: //[imageX] [tempX] //[imageY] = [tempY] / Z //[ 1 ] [ Z ] float real3DToImage[kNumReal3DToImage]; //[tempX] [ m[0], m[1], m[2] ] [imageX] //[tempY] = [ m[3], m[4], m[5] ] * [imageY] //[tempZ] [ m[6], m[7], m[8] ] [ 1 ] // in: (assume: one of real3DX, real3DY, real3DZ is available -> get k -> get all of real3DX, real3DY, real3DZ) // real3DX / tempX = real3DY / tempY = real3DZ / tempZ = k; // final: (assume: real3DX', real3DY', real3DZ' are 3D information with car center bias as origin, Translation Matrix is bias matrix) //[real3DX'] [real3DX] //[real3DY'] = [real3DY] - Translation Matrix //[real3DZ'] [real3DZ] float imageToReal3D[kNumImageToReal3D]; }; #endif // ROTATIONMATRIX_H
0
apollo_public_repos/apollo/third_party/camera_library/smartereye
apollo_public_repos/apollo/third_party/camera_library/smartereye/include/obstaclepainter.h
/****************************************************************************** * Copyright 2020 The Beijing Smarter Eye Technology Co.Ltd Authors. All * Rights Reserved. * * Licensed under the Apache License, Version 2.0 (the License); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an AS IS BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. *****************************************************************************/ #ifndef OBSTACLEPAINTER_H #define OBSTACLEPAINTER_H #include "smartpainterdef.h" class OutputObstacles; typedef struct _SmartRoi_ { int x; int y; int width; int height; }SmartRoi; class SMARTPAINTER_SHARED_EXPORT ObstaclePainter { public: ObstaclePainter(); ~ObstaclePainter(); static bool paintObstacle(void * _obstacleParam, unsigned char * _rgbImageData, int _width, int _height, bool showDetials, bool singleObs); protected: static void paintRectBorder(unsigned char *_imageData, OutputObstacles &_rectBorder, int _width, int _height, bool isWarn); static void drawObsFrame(unsigned char *_imageData, OutputObstacles &_rectBorder, int _width, int _height, int _offsetX, int _offsetY, bool showDetails = true); static void drawObsInfo(unsigned char *_imageData, OutputObstacles &_rectBorder, int _width, int _height,const unsigned char color[3]); }; #endif // OBSTACLEPAINTER_H
0
apollo_public_repos/apollo/third_party/camera_library/smartereye
apollo_public_repos/apollo/third_party/camera_library/smartereye/include/disparityconvertor.h
/****************************************************************************** * Copyright 2020 The Beijing Smarter Eye Technology Co.Ltd Authors. All * Rights Reserved. * * Licensed under the Apache License, Version 2.0 (the License); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an AS IS BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. *****************************************************************************/ #ifndef DISPARITYPAINTER_H #define DISPARITYPAINTER_H #include "dataprocessordef.h" class DATAPROCESSOR_SHARED_EXPORT DisparityConvertor { public: DisparityConvertor(); ~DisparityConvertor(); /* * src: Input, dispairy buffer from ADAS device * width: Input, disparity width, unit: pixel * height: Input, disparity height, unit: pixel * bitNum: Input, bit number of disparity float part, based on FrameFormat * dest: Output, disparity buffer, float type for each point. */ static void convertDisparity2FloatFormat(const unsigned char* src, int width, int height, int bitNum, float* dest); /* * src: Input, dispairy buffer from ADAS device * width: Input, disparity width, unit: pixel * height: Input, disparity height, unit: pixel * bitNum: Input, bit number of disparity float part, based on FrameFormat * posX: Input, point x coordinate, unit: pixel * posY: Input, point y coordinate, unit: pixel * return: disparity value */ static float getPointDisparityValue(const unsigned char *src, int width, int height, int bitNum, int posX, int posY); /* * src: Input, dispairy buffer from ADAS device * width: Input, disparity width, unit: pixel * height: Input, disparity height, unit: pixel * bitNum: Input, bit number of disparity float part, based on FrameFormat * baseline: Input, dual camera baseline that can be get from StereoCalibrationParameters, unit: mm * focus: Input, camera focus that can be get from StereoCalibrationParameters, unit: pixel * cx: Input, horizental optical center that can be get from StereoCalibrationParameters, unit: pixel * cy: Input, vertical optical center that can be get from StereoCalibrationParameters, unit: pixel * posX: Input, point x coordinate, unit: pixel * posY: Input, point y coordinate, unit: pixel * xDistance: Output, lateral distance value, unit: mm(+-) * yDistance: Output, vertical distance value, unit: mm(+-) * zDistance: Output, longitudinal distance value, unit: mm */ static void getPointXYZDistance(const unsigned char *src, int width, int height, int bitNum, float baseline, float focus, int cx, int cy, int posX, int posY, float &xDistance, float &yDistance, float &zDistance); /* * src: Input, dispairy buffer from ADAS device * width: Input, disparity width, unit: pixel * height: Input, disparity height, unit: pixel * bitNum: Input, bit number of disparity float part, based on FrameFormat * baseline: Input, dual camera baseline that can be get from StereoCalibrationParameters, unit: mm * focus: Input, camera focus that can be get from StereoCalibrationParameters, unit: pixel * posX0: Input, the first point of rect x coordinate, unit: pixel * posY0: Input, the first point of rect point y coordinate, unit: pixel * posX1: Input, the forth point of rect point x coordinate, unit: pixel * posY1: Input, the forth point of rect point y coordinate, unit: pixel * zDistance: Output, longitudinal distance value, unit: mm */ static void getRectZDistance(const unsigned char *src, int width, int height, int bitNum, float baseline, float focus, int posX0, int posY0, int posX1, int posY1, float &zDistance); /* * disparity: Input, disparity buffer, float type for each point. * width: Input, disparity width, unit: pixel * height: Input, disparity height, unit: pixel * baseline: Input, dual camera baseline that can be get from StereoCalibrationParameters, unit: mm * cx: Input, horizental optical center that can be get from StereoCalibrationParameters, unit: pixel * xDistance: Output, lateral distance value, unit: mm(+-) */ static void getWholeXDistance(const float* disparity, int width, int height, float baseline, int cx, float* xDistance); /* * disparity: Input, disparity buffer, float type for each point. * width: Input, disparity width, unit: pixel * height: Input, disparity height, unit: pixel * baseline: Input, dual camera baseline that can be get from StereoCalibrationParameters, unit: mm * cy: Input, vertical optical center that can be get from StereoCalibrationParameters, unit: pixel * yDistance: Output, vertical distance value, unit: mm(+-) */ static void getWholeYDistance(const float* disparity, int width, int height, float baseline, int cy, float* yDistance); /* * disparity: Input, disparity buffer, float type for each point. * width: Input, disparity width, unit: pixel * height: Input, disparity height, unit: pixel * baseline: Input, dual camera baseline that can be get from StereoCalibrationParameters, unit: mm * focus: Input, camera focus that can be get from StereoCalibrationParameters, unit: pixel * zDistance: Output, longitudinal distance value, unit: mm */ static void getWholeZDistance(const float* disparity, int width, int height, float baseline, float focus, float* zDistance); /* * width: Input, disparity width, unit: pixel * bitNum: Input, bit number of disparity float part, based on FrameFormat * baseline: Input, dual camera baseline that can be get from StereoCalibrationParameters * cx: Input, horizental optical center that can be get from StereoCalibrationParameters * lookUpTableX: output, 81*2^bitNum*width float buffer, should be allocated before used */ static void generateLookUpTableX(int width, int bitNum, float baseline, int cx, float* lookUpTableX); /* * height: Input, disparity height, unit: pixel * bitNum: Input, bit number of disparity float part, based on FrameFormat * baseline: Input, dual camera baseline that can be get from StereoCalibrationParameters * cy: Input, vertical optical center that can be get from StereoCalibrationParameters * lookUpTableY: output, 81*2^bitNum*height float buffer, should be allocated before used */ static void generateLookUpTableY(int height, int bitNum, float baseline, int cy, float* lookUpTableY); /* * bitNum: Input, bit number of disparity float part, based on FrameFormat * baseline: Input, dual camera baseline that can be get from StereoCalibrationParameters * focus: Input, camera focus that can be get from StereoCalibrationParameters * lookUpTableZ: output, 81*2^bitNum float buffer */ static void generateLookUpTableZ(int bitNum, float baseline, float focus, float* lookUpTableZ); /* * src: Input, dispairy buffer from ADAS device * width: Input, disparity width, unit: pixel * height: Input, disparity height, unit: pixel * bitNum: Input, bit number of disparity float part, based on FrameFormat * lookUpTableX: input, can be get by generateLookUpTableX() * distanceX: output, the whole pixel X distance buffer, size: width*height, unit: mm(+-) */ static void getWholeXDistanceByLookupTable(const unsigned char* src, int width, int height, int bitNum, float* lookUpTableX, float* distanceX); /* * src: Input, dispairy buffer from ADAS device * width: Input, disparity width, unit: pixel * height: Input, disparity height, unit: pixel * bitNum: Input, bit number of disparity float part, based on FrameFormat * lookUpTableY: input, can be get by generateLookUpTableY() * distanceY: output, the whole pixel Y distance buffer, size: width*height, unit: mm(+-) */ static void getWholeYDistanceByLookupTable(const unsigned char* src, int width, int height, int bitNum, float* lookUpTableY, float* distanceY); /* * src: Input, dispairy buffer from ADAS device * width: Input, disparity width, unit: pixel * height: Input, disparity height, unit: pixel * lookUpTableZ: input, can be get by generateLookUpTableZ() * distanceZ: output, the whole pixel Z distance buffer, size: width*height, unit: mm */ static void getWholeZDistanceByLookupTable(const unsigned char* src, int width, int height, float* lookUpTableZ, float* distanceZ); /* * disparity: Input, disparity buffer, float type for each point. * width: Input, disparity width, unit: pixel * height: Input, disparity height, unit: pixel * minDisp: Input, min disparity value * maxDisp: Input, max disparity value * rgbBuf: Output, rgb disparity buffer, can be showed with color */ static void convertDisparity2RGB(const float* disparity, int width, int height, int minDisp, int maxDisp, unsigned char* rgbBuf); /* * format: Input, frame format. * return: bit number of disparity float part. */ static int getDisparityBitNum(int format); }; #endif // DISPARITYPAINTER_H
0
apollo_public_repos/apollo/third_party/camera_library/smartereye
apollo_public_repos/apollo/third_party/camera_library/smartereye/include/filesender.h
/****************************************************************************** * Copyright 2020 The Beijing Smarter Eye Technology Co.Ltd Authors. All * Rights Reserved. * * Licensed under the Apache License, Version 2.0 (the License); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an AS IS BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. *****************************************************************************/ #ifndef FILESENDER_H #define FILESENDER_H #include "blockhandler.h" #include "satpext_global.h" #include <QRunnable> #include <QString> class QFile; namespace SATP { class Protocol; class FileSenderHandler; class SATPEXTSHARED_EXPORT FileSender : public BlockHandler, public QRunnable { public: FileSender(Protocol *protocol, FileSenderHandler *senderHandler); virtual ~FileSender(); void run(); void send(const QString &filePath); //override. bool handleReceiveBlock(uint32_t dataType, const char *block, int size); void handleReset(); double getSendProgress(); protected: void sendFileSynchronously(); void sendFileHeader(int fileSize); void sendFileTail(); void handleFileResp(const char *block); private: Protocol *mProtocol; FileSenderHandler *mSenderHandler; QString mFilePath; QString mFileName; qint64 mFileSize; qint64 mSizeToSend; bool mIsRunning; bool mIsCanceling; }; } #endif // FILESENDER_H
0
apollo_public_repos/apollo/third_party/camera_library/smartereye
apollo_public_repos/apollo/third_party/camera_library/smartereye/include/roadwaypainter.h
/****************************************************************************** * Copyright 2020 The Beijing Smarter Eye Technology Co.Ltd Authors. All * Rights Reserved. * * Licensed under the Apache License, Version 2.0 (the License); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an AS IS BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. *****************************************************************************/ #ifndef ROADWAYPAINTER_H #define ROADWAYPAINTER_H #include <string.h> #include <cmath> #include <float.h> #include "smartpainterdef.h" class SmartRgbImage { public: SmartRgbImage(); SmartRgbImage(unsigned char *imgData, int _width, int _height); ~SmartRgbImage(); int mWidth; int mHeight; int mStep; unsigned char *mData; }; class SMARTPAINTER_SHARED_EXPORT RoadwayPainter { public: RoadwayPainter(); ~RoadwayPainter(); static bool paintRoadway(void *_roadwayParam, unsigned char * _rgbImageData, int _width_, int _height, bool maskMode = false); static void imageGrayToRGB(const unsigned char *gray, unsigned char *rgb, int _width, int _height); protected: static void outputParamFromMToMm(void *_roadwayParam); static void getBeginAndEndImageIndex(int &_bH, int &_eH, int _arrayIndex[], int closeH); static bool paintLane(SmartRgbImage &_img, int _bH, int _eH, int _lEdge[], int _rEdge[], int _alpha, int _color[], bool maskMode = false); static bool calculateImageIndex(void *_lens, float _worldX, float _worldY, float & _imageX, float & _imageY); static void getImageCurveIndex(void *_lens, void *_boundary, float _worldY, float & _imageX, float & _imageY); static void calculateCurveIndex(void *_lens, void *_boundary, SmartRgbImage &_image, float _by, float _ey, int _boundaryIndex[]); static void doCurveInterpolation(int _bH, int _eH, int _curveEquation[]); static void getLineEquation(float _x1, float _y1, float _x2, float _y2, float &_k, float &_b); static void drawLine(SmartRgbImage &_img, int _bh, int _eh, float _k, float _b,int _color[]); }; #endif // ROADWAYPAINTER_H
0
apollo_public_repos/apollo/third_party/camera_library/smartereye
apollo_public_repos/apollo/third_party/camera_library/smartereye/include/LdwDataInterface.h
/****************************************************************************** * Copyright 2020 The Beijing Smarter Eye Technology Co.Ltd Authors. All * Rights Reserved. * * Licensed under the Apache License, Version 2.0 (the License); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an AS IS BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. *****************************************************************************/ #ifndef LDW_DATA_INTERFACE_H_ #define LDW_DATA_INTERFACE_H_ enum LdwVersion { LDW_VERSION_C1 = 0, LDW_VERSION_C2, LDW_VERSION_FOUR_LANE_C2 }; enum LdwLaneStyle { LDW_LANE_STYLE_NONE_LANE = 0, LDW_LANE_STYLE_PREDICT_LANE, LDW_LANE_STYLE_BROKEN_LANE, LDW_LANE_STYLE_SOLID_LANE, LDW_LANE_STYLE_DOUBLE_BROKEN_LANE, LDW_LANE_STYLE_DOUBLE_SOLID_LANE, LDW_LANE_STYLE_TRIPLE_LANE, }; enum LdwSteerStatus { LDW_NORMAL_STEER = 0, LDW_STEER_ON_LEFT__LANE, LDW_STEER_ON_RIGHT_LANE, LDW_STEER_WARNING_LEFT_, LDW_STEER_WARNING_RIGHT, }; enum LdwSoftStatus { LDW_SOFT_DETECTION = 0, LDW_SOFT_SELF_LEARNING, LDW_SOFT_MANUAL_LEARNING_MODE0, LDW_SOFT_MANUAL_LEARNING_MODE1, }; enum LdwWarningGrade { LDW_WARNING_LOW = 0, LDW_WARNING_NORMAL, LDW_WARNING_HIGHT, }; typedef struct LdwLaneBoundary__ { int degree; float coefficient[4]; }LdwLaneBoundary; typedef struct LdwLane__ { int width; int qualityGrade; LdwLaneStyle style; LdwLaneBoundary left_Boundary; LdwLaneBoundary rightBoundary; }LdwLane; typedef struct LdwRoadway__ { int width[3]; bool isTracking; LdwLane left_Lane; LdwLane rightLane; LdwLane adjacentLeft_Lane; LdwLane adjacentRightLane; }LdwRoadway; typedef struct LdwLensInfo__ { float xImageFocal; float yImageFocal; float xRatioFocalToPixel; float yRatioFocalToPixel; float mountingHeight; float mCosRx; float mSinRx; float mCosRy; float mSinRy; }LdwLensInfo; typedef struct LdwDataPack__ { LdwRoadway roadway; LdwSoftStatus softStatus; LdwSteerStatus steerStatus; LdwLensInfo lens; }LdwDataPack; #endif // LDW_DATA_INTERFACE_H_
0
apollo_public_repos/apollo/third_party/camera_library/smartereye
apollo_public_repos/apollo/third_party/camera_library/smartereye/include/messageadapter.h
/****************************************************************************** * Copyright 2020 The Beijing Smarter Eye Technology Co.Ltd Authors. All * Rights Reserved. * * Licensed under the Apache License, Version 2.0 (the License); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an AS IS BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. *****************************************************************************/ #ifndef MESSAGEADAPTER_H #define MESSAGEADAPTER_H #include <QObject> #include <QSet> #include "satpext_global.h" #include "service.h" #include "blockhandler.h" namespace SATP { class Protocol; } class SATPEXTSHARED_EXPORT MessageAdapter : public QObject, public Service, public SATP::BlockHandler { Q_OBJECT public: explicit MessageAdapter(SATP::Protocol *protocol, QObject *parent = nullptr); virtual ~MessageAdapter(); //override BlockHandler bool handleReceiveBlock(uint32_t dataType, const char *block, int size); void handleReady(); void registerUrgentMessage(int type); protected: void handleMessage(int type, const char *message, int size); private: SATP::Protocol *mProtocol; QSet<int> mUrgentMessages; }; #endif // MESSAGEADAPTER_H
0
apollo_public_repos/apollo/third_party/camera_library/smartereye
apollo_public_repos/apollo/third_party/camera_library/smartereye/include/framehandler.h
/****************************************************************************** * Copyright 2020 The Beijing Smarter Eye Technology Co.Ltd Authors. All * Rights Reserved. * * Licensed under the Apache License, Version 2.0 (the License); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an AS IS BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. *****************************************************************************/ #ifndef FRAMEHANDLER_H #define FRAMEHANDLER_H struct RawImageFrame; class FrameHandler { public: virtual void handleRawFrame(const RawImageFrame *rawFrame) = 0; }; #endif // FRAMEHANDLER_H
0
apollo_public_repos/apollo/third_party/camera_library/smartereye
apollo_public_repos/apollo/third_party/camera_library/smartereye/include/obstacleData.h
/****************************************************************************** * Copyright 2020 The Beijing Smarter Eye Technology Co.Ltd Authors. All * Rights Reserved. * * Licensed under the Apache License, Version 2.0 (the License); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an AS IS BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. *****************************************************************************/ #ifndef _OBSTACLE_DATA_H_ #define _OBSTACLE_DATA_H_ enum RecognitionType { INVALID = 0, VEHICLE, PEDESTRIAN, CHILD, BICYCLE, MOTO, TRUCK, BUS, OTHERS, ESTIMATED, CONTINUOUS }; struct OutputObstacles { float currentSpeed; //(m/second) current frame self vehicle speed float frameRate; //(fps) frames per second unsigned char trackId; //current obstacle corresponding tracking id in obstacle tracking buffer unsigned char trackFrameNum; //the track frame numbers of the obstacle, increments in 1 each frame until to the max record number, the actual number is (trackFrameNum + 1) unsigned char stateLabel; //classify obstacle for front collision, FC, 0: invalid or continuous obstacle, 1: nearest o bstacle in warning area, 2: obstacle in waning area, 3: obstacle out of warning area unsigned char classLabel; //the obstacle class label: 0-invalid; 1-warning obstacle; 2-obstacles to be warned; 3-non warning obstacle; 4-left continuous obstacle; 5-right continuous obstacle; 6-estimated vanish obstacle; 7-valid obstacle // original, the obstacle class label: 0-invalid; 1-car; 2-person; 3-continuous obstacle; 4-valid; 5-other unsigned char continuousLabel; //the continuous obstacle class label: 0-invalid; 1-left continuous obstacle; 2-right continuous obstacle unsigned char fuzzyEstimationValid; //(0/1) 0: current fuzzy estimation is invalid; 1: current fuzzy estimation is valid RecognitionType obstacleType; //the obstacle Type: INVALID=0,VEHICLE, PEDESTRIAN, ... float avgDisp; //(pixel) the average disparity of an obstacle with adding infDisp: avgDisp = BF_VALUE/avgDitance+infDis float avgDistanceZ; //(m) the average Z distance of single obstacle rectangle float nearDistanceZ; //(m) the minimum Z distance of continuous obstacle float farDistanceZ; //(m) the longest Z distance of continuous obstacle float real3DLeftX; //(-+m) the left X for real 3D coordinate of the obstacle(the origin X is the center of car, right is positive) float real3DRightX; //(-+m) the right X for real 3D coordinate of the obstacle(the origin X is the center of car, right is positive) float real3DCenterX; //(-+m) the center X for real 3D coordinate of the obstacle(the origin X is the center of car, right is positive) float real3DUpY; //(-+m) the up Y for real 3D coordinate of the obstacle(the origin Y is the camera position, down is positive) float real3DLowY; //(-+m) the Low y for real 3D coordinate of the obstacle(the origin Y is the camera position, down is positive) unsigned short firstPointX; //(pixel) the X-axis of first point of rectangle, the first point :(x, y), left top point of single obstacle/near bottom point of continuous obstacle, full size pixel coordinate unsigned short firstPointY; //(pixel) the Y-axis of first point of rectangle, the first point :(x, y), left top point of single obstacle/near bottom point of continuous obstacle, full size pixel coordinate unsigned short secondPointX; //(pixel) the X-axis of second point of rectangle, the second point:(x+width, y), right top point of single obstacle/near top point of continuous obstacle, full size pixel coordinate unsigned short secondPointY; //(pixel) the Y-axis of second point of rectangle, the second point:(x+width, y), right top point of single obstacle/near top point of continuous obstacle, full size pixel coordinate unsigned short thirdPointX; //(pixel) the X-axis of third point of rectangle, the third point :(x+width, y+height), right bottom point of single obstacle/far top point of continuous obstacle, full size pixel coordinate unsigned short thirdPointY; //(pixel) the Y-axis of third point of rectangle, the third point :(x+width, y+height), right bottom point of single obstacle/far top point of continuous obstacle, full size pixel coordinate unsigned short fourthPointX; //(pixel) the X-axis of fourth point of rectangle, the fourth point:(x,y+height), left bottom point of single obstacle/far bottom point of continuous obstacle, full size pixel coordinate unsigned short fourthPointY; //(pixel) the Y-axis of fourth point of rectangle, the fourth point:(x,y+height), left bottom point of single obstacle/far bottom point of continuous obstacle, full size pixel coordinate float fuzzyRelativeDistanceZ; //(m) estimated relative distance in Z direction float fuzzyRelativeSpeedZ; //(m/second) estimated speed in Z direction of current obstacle float fuzzyCollisionTimeZ; //(second) estimated collision time in Z direction unsigned char fuzzyCollisionX; //(0/1) estimated whether there is collision in X direction float fuzzy3DWidth; //(m) estimated real 3D width of current obstacle float fuzzy3DCenterX; //(-+m) estimated real 3D position of obstacle center in X direction (the origin X is the center of car, right is positive) float fuzzy3DLeftX; //(-+m) estimated real 3D position of obstacle left in X direction (the origin X is the center of car, right is positive) float fuzzy3DRightX; //(-+m) estimated real 3D position of obstacle right in X direction (the origin X is the center of car, right is positive) float fuzzy3DHeight; //(m) estimated real 3D height of current obstacle float fuzzy3DUpY; //(-+m) estimated real 3D position of obstacle up in Y direction (the origin Y is the camera position, down is positive) float fuzzy3DLowY; //(-+m) estimated real 3D position of obstacle low in Y direction (the origin Y is the camera position, down is positive) float fuzzyRelativeSpeedCenterX; //(m/second) estimated center speed in X direction of current obstacle float fuzzyRelativeSpeedLeftX; //(m/second) estimated left speed in X direction of current obstacle float fuzzyRelativeSpeedRightX; //(m/second) estimated right speed in X direction of current obstacle #ifdef EXTEND_INFO_ENABLE unsigned char storeId; //current obstacle store id in obstacle detection buffer #endif //EXTEND_INFO_ENABLE }; #endif // _OBSTACLE_DATA_H_
0
apollo_public_repos/apollo/third_party/camera_library/smartereye
apollo_public_repos/apollo/third_party/camera_library/smartereye/include/yuv2rgb.h
/****************************************************************************** * Copyright 2020 The Beijing Smarter Eye Technology Co.Ltd Authors. All * Rights Reserved. * * Licensed under the Apache License, Version 2.0 (the License); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an AS IS BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. *****************************************************************************/ #ifndef YUV2RGB_H #define YUV2RGB_H #include "dataprocessordef.h" class RGB{ public: char r, g, b; }; class DATAPROCESSOR_SHARED_EXPORT YuvToRGB { public: static RGB Yuv2Rgb(char Y, char U, char V); static RGB YCbCr2Rgb(unsigned char Y, unsigned char Cb, unsigned char Cr); static char *YCbYCr2Rgb(const unsigned char* src, char* dest, int width, int height); static char *YCbYCrPlannar2Rgb(const unsigned char* src, char* dest, int width, int height); static unsigned char *YCbYCrGetY(const unsigned char* src, unsigned char* dest, int width, int height); }; #endif // YUV2RGB_H
0
apollo_public_repos/apollo/third_party/camera_library/smartereye
apollo_public_repos/apollo/third_party/camera_library/smartereye/include/smartpainterdef.h
/****************************************************************************** * Copyright 2020 The Beijing Smarter Eye Technology Co.Ltd Authors. All * Rights Reserved. * * Licensed under the Apache License, Version 2.0 (the License); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an AS IS BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. *****************************************************************************/ #ifndef SMARTPAINTERDEF_H #define SMARTPAINTERDEF_H #ifdef _WIN64 # define SMARTPAINTER_EXPORT __declspec(dllexport) # define SMARTPAINTER_IMPORT __declspec(dllimport) #else # define SMARTPAINTER_EXPORT __attribute__((visibility("default"))) # define SMARTPAINTER_IMPORT __attribute__((visibility("default"))) # define SMARTPAINTER_HIDDEN __attribute__((visibility("hidden"))) #endif #if defined(SMARTPAINTER_LIBRARY) # define SMARTPAINTER_SHARED_EXPORT SMARTPAINTER_EXPORT #else # define SMARTPAINTER_SHARED_EXPORT SMARTPAINTER_IMPORT #endif #endif // SMARTPAINTERDEF_H
0
apollo_public_repos/apollo/third_party/camera_library/smartereye
apollo_public_repos/apollo/third_party/camera_library/smartereye/include/filereceiverhandler.h
/****************************************************************************** * Copyright 2020 The Beijing Smarter Eye Technology Co.Ltd Authors. All * Rights Reserved. * * Licensed under the Apache License, Version 2.0 (the License); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an AS IS BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. *****************************************************************************/ #ifndef FILERECEIVERHANDLER_H #define FILERECEIVERHANDLER_H #include <qglobal.h> namespace SATP { class FileReceiverHandler { public: virtual void handleReceiveFile(const QString &fileName) = 0; }; } #endif // FILERECEIVERHANDLER_H
0
apollo_public_repos/apollo/third_party/camera_library/smartereye
apollo_public_repos/apollo/third_party/camera_library/smartereye/include/stereocamera.h
/****************************************************************************** * Copyright 2020 The Beijing Smarter Eye Technology Co.Ltd Authors. All * Rights Reserved. * * Licensed under the Apache License, Version 2.0 (the License); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an AS IS BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. *****************************************************************************/ #ifndef STEREOCAMERA_H #define STEREOCAMERA_H #include "stereocameradef.h" #include <cstdint> #include <functional> class StereoCameraImpl; class CameraHandler; class FrameHandler; class MonoCalibrationParameters; class StereoCalibrationParameters; struct RotationMatrix; namespace SATP { class Protocol; } class STEREO_SHARED_EXPORT StereoCamera { public: StereoCamera(const StereoCamera&&){} virtual ~StereoCamera(); static StereoCamera *connect(const char *addr); void invokeInLoopThread(std::function<void()> method); void disconnectFromServer(); bool isConnected(); void requestFrame(FrameHandler *frameHandler, uint32_t frameIds); SATP::Protocol *getProtocol(); void reboot(bool halt = false); void switchStartupMode(); int updateFirmware(const char* path); double getUpgradeProgress(); void setFileReceiveDir(const char *dir); void enableTasks(uint32_t taskIds); bool requestStereoCameraParameters(StereoCalibrationParameters &params); bool requestMonoLeftCameraParameters(MonoCalibrationParameters &params); bool requestMonoRightCameraParameters(MonoCalibrationParameters &params); bool requestRotationMatrix(RotationMatrix &params); void enableMaxSendFrameInterval(); bool setFrameRate(float rate); bool getFrameRate(float &rate); bool getAmbientLight(int &lightness); protected: StereoCamera(); inline StereoCameraImpl *getImpl(){return mImpl;} private: StereoCameraImpl *mImpl; }; #endif // STEREOCAMERA_H
0
apollo_public_repos/apollo/third_party/camera_library/smartereye
apollo_public_repos/apollo/third_party/camera_library/smartereye/include/frameid.h
/****************************************************************************** * Copyright 2020 The Beijing Smarter Eye Technology Co.Ltd Authors. All * Rights Reserved. * * Licensed under the Apache License, Version 2.0 (the License); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an AS IS BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. *****************************************************************************/ #ifndef FRAMEIDDEF #define FRAMEIDDEF #ifndef FRAMEIDHELPER_LIBRARY struct FrameId { #endif enum Enumeration { NotUsed = 0, LeftCamera = 1 << 0, RightCamera = 1 << 1, CalibLeftCamera = 1 << 2, CalibRightCamera = 1 << 3, DisparityDSBak = 1 << 4, DisparityUV = 1 << 5, Disparity = 1 << 6, DisparityPlus = 1 << 7, DisparityDS = 1 << 8, Lane = 1 << 9, Obstacle = 1 << 10, Compound = 1 << 11, LDownSample = 1 << 12, RDownSample = 1 << 13, LaneExt = 1 << 14, }; #ifndef FRAMEIDHELPER_LIBRARY }; #else Q_ENUM(Enumeration) #endif #endif // FRAMEDEF
0
apollo_public_repos/apollo/third_party
apollo_public_repos/apollo/third_party/cpplint/init.bzl
"""Loads the civetweb library""" load("//third_party/cpplint:workspace.bzl", "repo") def init(): repo()
0
apollo_public_repos/apollo/third_party
apollo_public_repos/apollo/third_party/cpplint/cyberfile.xml
<package format="2"> <name>3rd-cpplint</name> <version>local</version> <description> Apollo packaged cpplint Lib. </description> <maintainer email="apollo-support@baidu.com">Apollo</maintainer> <license>Apache License 2.0</license> <url type="website">https://www.apollo.auto/</url> <url type="repository">https://github.com/ApolloAuto/apollo</url> <url type="bugtracker">https://github.com/ApolloAuto/apollo/issues</url> <type>third-wrapper</type> <src_path url="https://github.com/ApolloAuto/apollo">//third_party/cpplint</src_path> </package>
0
apollo_public_repos/apollo/third_party
apollo_public_repos/apollo/third_party/cpplint/workspace.bzl
"""Loads the cpplint library""" load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive") # Sanitize a dependency so that it works correctly from code that includes # Apollo as a submodule. def clean_dep(dep): return str(Label(dep)) def repo(): http_archive( name = "cpplint", build_file = clean_dep("//third_party/cpplint:cpplint.BUILD"), sha256 = "5ace9cb77ddfa61bb0135b21d8a3fe62970266588ba41b8a644cd271d3c0676e", strip_prefix = "cpplint-1.5.2", urls = [ "https://apollo-system.cdn.bcebos.com/archive/6.0/1.5.2.tar.gz", "https://github.com/cpplint/cpplint/archive/1.5.2.tar.gz", ], )
0
apollo_public_repos/apollo/third_party
apollo_public_repos/apollo/third_party/cpplint/BUILD
load("//tools/install:install.bzl", "install", "install_files", "install_src_files") package( default_visibility = ["//visibility:public"], ) install( name = "install", data_dest = "3rd-cpplint", data = [ ":cyberfile.xml", ], ) install_src_files( name = "install_src", src_dir = ["."], dest = "3rd-cpplint/src", filter = "*", )
0
apollo_public_repos/apollo/third_party
apollo_public_repos/apollo/third_party/cpplint/cpplint.BUILD
load("@rules_python//python:defs.bzl", "py_binary", "py_test") package(default_visibility = ["//visibility:public"]) licenses(["notice"]) # We can't set name="cpplint" here because that's the directory name so the # sandbox gets confused. We'll give it a private name with a public alias. py_binary( name = "cpplint_binary", srcs = ["cpplint.py"], imports = ["cpplint"], main = "cpplint.py", visibility = [], ) alias( name = "cpplint", actual = ":cpplint_binary", ) py_test( name = "cpplint_unittest", size = "small", srcs = ["cpplint_unittest.py"], data = ["cpplint_test_header.h"], deps = [ ":cpplint_py", ], )
0
apollo_public_repos/apollo/third_party
apollo_public_repos/apollo/third_party/osqp/cyberfile.xml
<package format="2"> <name>3rd-osqp</name> <version>local</version> <description> Apollo packaged osqp Lib. </description> <maintainer email="apollo-support@baidu.com">Apollo</maintainer> <license>Apache License 2.0</license> <url type="website">https://www.apollo.auto/</url> <url type="repository">https://github.com/ApolloAuto/apollo</url> <url type="bugtracker">https://github.com/ApolloAuto/apollo/issues</url> <type>third-binary</type> <src_path url="https://github.com/ApolloAuto/apollo">//third_party/osqp</src_path> </package>
0
apollo_public_repos/apollo/third_party
apollo_public_repos/apollo/third_party/osqp/3rd-osqp.BUILD
load("@rules_cc//cc:defs.bzl", "cc_library") package(default_visibility = ["//visibility:public"]) licenses(["notice"]) cc_library( name = "osqp", includes = [ "include", ], hdrs = glob(["include/**/*"]), linkopts = [ "-losqp", ], strip_include_prefix = "include", )
0
apollo_public_repos/apollo/third_party
apollo_public_repos/apollo/third_party/osqp/workspace.bzl
"""Loads the osqp library""" # Sanitize a dependency so that it works correctly from code that includes # Apollo as a submodule. def clean_dep(dep): return str(Label(dep)) def repo(): native.new_local_repository( name = "osqp", build_file = clean_dep("//third_party/osqp:osqp.BUILD"), path = "/opt/apollo/sysroot/include", )
0
apollo_public_repos/apollo/third_party
apollo_public_repos/apollo/third_party/osqp/BUILD
load("//tools/install:install.bzl", "install", "install_files", "install_src_files") package( default_visibility = ["//visibility:public"], ) install( name = "install", data_dest = "3rd-osqp", data = [ ":cyberfile.xml", ":3rd-osqp.BUILD", ], ) install_src_files( name = "install_src", src_dir = ["."], dest = "3rd-osqp/src", filter = "*", )
0
apollo_public_repos/apollo/third_party
apollo_public_repos/apollo/third_party/osqp/osqp.BUILD
load("@rules_cc//cc:defs.bzl", "cc_library") package(default_visibility = ["//visibility:public"]) licenses(["notice"]) cc_library( name = "osqp", include_prefix = "osqp", includes = [ ".", ], linkopts = [ "-L/opt/apollo/sysroot/lib", "-losqp", ], )
0
apollo_public_repos/apollo/third_party
apollo_public_repos/apollo/third_party/gflags/3rd-gflags.BUILD
load("@rules_cc//cc:defs.bzl", "cc_library") licenses(["notice"]) package(default_visibility = ["//visibility:public"]) cc_library( name = "gflags", includes = ["include"], hdrs = glob(["include/**/*"]), linkopts = [ "-lgflags", ], strip_include_prefix = "include", )
0
apollo_public_repos/apollo/third_party
apollo_public_repos/apollo/third_party/gflags/cyberfile.xml
<package format="2"> <name>3rd-gflags</name> <version>local</version> <description> Apollo packaged gflags Lib. </description> <maintainer email="apollo-support@baidu.com">Apollo</maintainer> <license>Apache License 2.0</license> <url type="website">https://www.apollo.auto/</url> <url type="repository">https://github.com/ApolloAuto/apollo</url> <url type="bugtracker">https://github.com/ApolloAuto/apollo/issues</url> <type>third-binary</type> <src_path url="https://github.com/ApolloAuto/apollo">//third_party/gflags</src_path> </package>
0
apollo_public_repos/apollo/third_party
apollo_public_repos/apollo/third_party/gflags/gflags.BUILD
load("@rules_cc//cc:defs.bzl", "cc_library") licenses(["notice"]) package(default_visibility = ["//visibility:public"]) cc_library( name = "gflags", includes = ["."], linkopts = [ "-L/usr/local/lib/", "-lgflags", ], )
0
apollo_public_repos/apollo/third_party
apollo_public_repos/apollo/third_party/gflags/workspace.bzl
"""Loads the gflags library""" # Sanitize a dependency so that it works correctly from code that includes # Apollo as a submodule. def clean_dep(dep): return str(Label(dep)) def repo(): native.new_local_repository( name = "com_github_gflags_gflags", build_file = clean_dep("//third_party/gflags:gflags.BUILD"), path = "/usr/local/include", )
0
apollo_public_repos/apollo/third_party
apollo_public_repos/apollo/third_party/gflags/BUILD
load("//tools/install:install.bzl", "install", "install_files", "install_src_files") package( default_visibility = ["//visibility:public"], ) install( name = "install", data_dest = "3rd-gflags", data = [ ":cyberfile.xml", ":3rd-gflags.BUILD", ], ) install_src_files( name = "install_src", src_dir = ["."], dest = "3rd-gflags/src", filter = "*", )
0
apollo_public_repos/apollo/third_party
apollo_public_repos/apollo/third_party/pcl/init.bzl
load("//third_party/pcl:pcl_configure.bzl", "pcl_configure") def init(): pcl_configure(name = "local_config_pcl")
0
apollo_public_repos/apollo/third_party
apollo_public_repos/apollo/third_party/pcl/BUILD.tpl
package(default_visibility = ["//visibility:public"]) cc_library( name = "pcl_headers", hdrs = [ ":pcl_include" ], strip_include_prefix = "pcl/include", ) # TODO(storypku): split pcl into individual components cc_library( name = "pcl", linkopts = %{pcl_linkopts}, deps = [ ":pcl_headers", "@boost", ], ) %{copy_rules}
0
apollo_public_repos/apollo/third_party
apollo_public_repos/apollo/third_party/pcl/cyberfile.xml
<package format="2"> <name>3rd-pcl</name> <version>local</version> <description> Apollo packaged 3rd-pcl Lib. </description> <maintainer email="apollo-support@baidu.com">Apollo</maintainer> <license>Apache License 2.0</license> <url type="website">https://www.apollo.auto/</url> <url type="repository">https://github.com/ApolloAuto/apollo</url> <url type="bugtracker">https://github.com/ApolloAuto/apollo/issues</url> <type>third-wrapper</type> <src_path url="https://github.com/ApolloAuto/apollo">//third_party/pcl</src_path> </package>
0
apollo_public_repos/apollo/third_party
apollo_public_repos/apollo/third_party/pcl/pcl_configure.bzl
load("//tools:common.bzl", "basename", "dirname") load("//tools/platform:common.bzl", "execute", "make_copy_dir_rule", "make_copy_files_rule") _APOLLO_SYSROOT_DIR = "APOLLO_SYSROOT_DIR" _APOLLO_PCL_LIBS = [ "pcl_common", "pcl_features", "pcl_filters", "pcl_io_ply", "pcl_io", "pcl_kdtree", "pcl_keypoints", "pcl_octree", "pcl_outofcore", "pcl_people", "pcl_recognition", "pcl_registration", "pcl_sample_consensus", "pcl_search", "pcl_segmentation", "pcl_surface", "pcl_tracking", "pcl_visualization", ] def find_sysroot_dir(repository_ctx): if _APOLLO_SYSROOT_DIR in repository_ctx.os.environ: return repository_ctx.os.environ[_APOLLO_SYSROOT_DIR].strip() return None # fail("Environment variable APOLLO_SYSROOT_DIR was not specified." + # "Re-run ./apollo6.sh config") def _pcl_version_from_incl_path(incl_path): return basename(incl_path).strip("pcl-") def _create_local_pcl_repository(repository_ctx): sysroot_dir = find_sysroot_dir(repository_ctx) result = _pcl_match_version(repository_ctx, sysroot_dir) if result == None: fail("Oops, Package pcl not found.") (version, incl_dir, lib_path) = result # Copy the library and header files. libraries = ["lib{}.so".format(lib) for lib in _APOLLO_PCL_LIBS] _lib_path = lib_path + "/" # headers = _get_pcl_headers(incl_dir) _incl_dir = incl_dir + "/" copy_rules = [ make_copy_files_rule( repository_ctx, name = "pcl_lib", srcs = [_lib_path + lib for lib in libraries], outs = ["pcl/lib/" + lib for lib in libraries], ), make_copy_dir_rule( repository_ctx, name = "pcl_include", src_dir = incl_dir, out_dir = "pcl/include", ), ] _pcl_linkopts = ["-L{}".format(lib_path)] + ["-l{}".format(lib) for lib in _APOLLO_PCL_LIBS] # Set up BUILD file. build_tpl = repository_ctx.path(Label("//third_party/pcl:BUILD.tpl")) repository_ctx.template("BUILD", build_tpl, { "%{pcl_linkopts}": "%s" % (_pcl_linkopts), "%{copy_rules}": "\n".join(copy_rules), }) def _pcl_match_version(repository_ctx, sysroot_dir = None): cmd = """ldconfig -p | awk -F'=>' '/libpcl_common.so$/ {print $2}'""" result = execute( repository_ctx, ["sh", "-c", cmd], empty_stdout_fine = False, ).stdout.strip() solib = result.rstrip("\n") lib_path = dirname(solib) prefix = solib[:solib.rfind("/lib/")] prefix_dirs = ["/usr", "/usr/local", "/opt/apollo/neo"] if sysroot_dir: prefix_dirs.append(sysroot_dir) if prefix not in prefix_dirs: return None cmd = """ls -d {}/include/pcl-* 2>/dev/null""".format(prefix) incl_dir = execute( repository_ctx, ["sh", "-c", cmd], empty_stdout_fine = True, ).stdout.strip() if not incl_dir: return None version = _pcl_version_from_incl_path(incl_dir) return (version, incl_dir, lib_path) def _pcl_configure_impl(repository_ctx): # Room for _create_remote_pcl_repository _create_local_pcl_repository(repository_ctx) pcl_configure = repository_rule( implementation = _pcl_configure_impl, environ = [], ) """Detects and configures the local pcl library. Add the following to your WORKSPACE FILE: ```python pcl_configure(name = "local_config_pcl") ``` Args: name: A unique name for this workspace rule. """
0
apollo_public_repos/apollo/third_party
apollo_public_repos/apollo/third_party/pcl/BUILD
load("//tools/install:install.bzl", "install", "install_files", "install_src_files") package( default_visibility = ["//visibility:public"], ) install( name = "install", data_dest = "3rd-pcl", data = [ ":cyberfile.xml", ], ) install_src_files( name = "install_src", src_dir = ["."], dest = "3rd-pcl/src", filter = "*", )
0
apollo_public_repos/apollo/third_party
apollo_public_repos/apollo/third_party/opencv/cyberfile.xml
<package format="2"> <name>3rd-opencv</name> <version>local</version> <description> Apollo packaged 3rd-opencv Lib. </description> <maintainer email="apollo-support@baidu.com">Apollo</maintainer> <license>Apache License 2.0</license> <url type="website">https://www.apollo.auto/</url> <url type="repository">https://github.com/ApolloAuto/apollo</url> <url type="bugtracker">https://github.com/ApolloAuto/apollo/issues</url> <type>third-binary</type> <src_path url="https://github.com/ApolloAuto/apollo">//third_party/opencv</src_path> </package>
0
apollo_public_repos/apollo/third_party
apollo_public_repos/apollo/third_party/opencv/opencv.BUILD
load("@rules_cc//cc:defs.bzl", "cc_library") licenses(["notice"]) package(default_visibility = ["//visibility:public"]) #TODO(storypku): split opencv into seperate components to speed up build # e.g., opencv_imgproc/opencv_highgui/... cc_library( name = "core", includes = ["."], linkopts = [ "-L/opt/apollo/sysroot/lib", "-lopencv_core", ], ) cc_library( name = "highgui", includes = ["."], linkopts = [ "-L/opt/apollo/sysroot/lib", "-lopencv_highgui", ], # Note(storypku): dependency relation derived from ldd deps = [ ":core", ":imgproc", ], ) cc_library( name = "imgproc", includes = ["."], linkopts = [ "-L/opt/apollo/sysroot/lib", "-lopencv_imgproc", ], deps = [ ":core", ], ) cc_library( name = "imgcodecs", includes = ["."], linkopts = [ "-L/opt/apollo/sysroot/lib", "-lopencv_imgcodecs", ], deps = [ ":core", ":imgproc", ], ) cc_library( name = "calib3d", includes = ["."], linkopts = [ "-L/opt/apollo/sysroot/lib", "-lopencv_calib3d", ], deps = [ ":core", ], )
0
apollo_public_repos/apollo/third_party
apollo_public_repos/apollo/third_party/opencv/workspace.bzl
"""Loads the OpenCV library""" # Sanitize a dependency so that it works correctly from code that includes # Apollo as a submodule. def clean_dep(dep): return str(Label(dep)) def repo(): native.new_local_repository( name = "opencv", build_file = clean_dep("//third_party/opencv:opencv.BUILD"), path = "/opt/apollo/sysroot/include/opencv4", )
0
apollo_public_repos/apollo/third_party
apollo_public_repos/apollo/third_party/opencv/BUILD
load("//tools/install:install.bzl", "install", "install_files", "install_src_files") package( default_visibility = ["//visibility:public"], ) install( name = "install", data_dest = "3rd-opencv", data = [ ":cyberfile.xml", ":3rd-opencv.BUILD", ], ) install_src_files( name = "install_src", src_dir = ["."], dest = "3rd-opencv/src", filter = "*", )
0
apollo_public_repos/apollo/third_party
apollo_public_repos/apollo/third_party/opencv/3rd-opencv.BUILD
load("@rules_cc//cc:defs.bzl", "cc_library") licenses(["notice"]) package(default_visibility = ["//visibility:public"]) #TODO(storypku): split opencv into seperate components to speed up build # e.g., opencv_imgproc/opencv_highgui/... cc_library( name = "core", includes = ["include"], hdrs = glob(["include/**/*"]), linkopts = [ "-lopencv_core", ], include_prefix = "opencv2", strip_include_prefix = "include", ) cc_library( name = "highgui", includes = ["include"], hdrs = glob(["include/**/*"]), linkopts = [ "-lopencv_highgui", ], # Note(storypku): dependency relation derived from ldd deps = [ ":core", ":imgproc", ], include_prefix = "opencv2", strip_include_prefix = "include", ) cc_library( name = "imgproc", includes = ["include"], hdrs = glob(["include/**/*"]), linkopts = [ "-lopencv_imgproc", ], deps = [ ":core", ], include_prefix = "opencv2", strip_include_prefix = "include", ) cc_library( name = "imgcodecs", includes = ["include"], hdrs = glob(["include/**/*"]), linkopts = [ "-lopencv_imgcodecs", ], deps = [ ":core", ":imgproc", ], include_prefix = "opencv2", strip_include_prefix = "include", )
0
apollo_public_repos/apollo/third_party
apollo_public_repos/apollo/third_party/gtest/init.bzl
"""Loads the gtest library""" load("//third_party/gtest:workspace.bzl", "repo") def init(): repo()
0
apollo_public_repos/apollo/third_party
apollo_public_repos/apollo/third_party/gtest/cyberfile.xml
<package format="2"> <name>3rd-gtest</name> <version>local</version> <description> Apollo packaged gtest Lib. </description> <maintainer email="apollo-support@baidu.com">Apollo</maintainer> <license>Apache License 2.0</license> <url type="website">https://www.apollo.auto/</url> <url type="repository">https://github.com/ApolloAuto/apollo</url> <url type="bugtracker">https://github.com/ApolloAuto/apollo/issues</url> <type>third-wrapper</type> <src_path url="https://github.com/ApolloAuto/apollo">//third_party/gtest</src_path> </package>
0
apollo_public_repos/apollo/third_party
apollo_public_repos/apollo/third_party/gtest/workspace.bzl
"""Loads the gtest library""" load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive") def repo(): # googletest (GTest and GMock) http_archive( name = "com_google_googletest", sha256 = "9dc9157a9a1551ec7a7e43daea9a694a0bb5fb8bec81235d8a1e6ef64c716dcb", strip_prefix = "googletest-release-1.10.0", urls = [ "https://apollo-system.cdn.bcebos.com/archive/6.0/release-1.10.0.tar.gz", "https://github.com/google/googletest/archive/release-1.10.0.tar.gz", ], )
0
apollo_public_repos/apollo/third_party
apollo_public_repos/apollo/third_party/gtest/BUILD
load("//tools/install:install.bzl", "install", "install_files", "install_src_files") package( default_visibility = ["//visibility:public"], ) install( name = "install", data_dest = "3rd-gtest", data = [ ":cyberfile.xml", ], ) install_src_files( name = "install_src", src_dir = ["."], dest = "3rd-gtest/src", filter = "*", )
0
apollo_public_repos/apollo/third_party
apollo_public_repos/apollo/third_party/yaml_cpp/init.bzl
"""Loads the yaml_cpp library""" load("//third_party/yaml_cpp:workspace.bzl", "repo") def init(): repo()
0
apollo_public_repos/apollo/third_party
apollo_public_repos/apollo/third_party/yaml_cpp/cyberfile.xml
<package format="2"> <name>3rd-yaml-cpp</name> <version>local</version> <description> Apollo packaged yaml-cpp Lib. </description> <maintainer email="apollo-support@baidu.com">Apollo</maintainer> <license>Apache License 2.0</license> <url type="website">https://www.apollo.auto/</url> <url type="repository">https://github.com/ApolloAuto/apollo</url> <url type="bugtracker">https://github.com/ApolloAuto/apollo/issues</url> <type>third-wrapper</type> <src_path url="https://github.com/ApolloAuto/apollo">//third_party/yaml_cpp</src_path> </package>
0
apollo_public_repos/apollo/third_party
apollo_public_repos/apollo/third_party/yaml_cpp/yaml_cpp.BUILD
load("@rules_cc//cc:defs.bzl", "cc_library") cc_library( name = "yaml-cpp", srcs = glob([ "src/*.cpp", ]), hdrs = glob([ "include/yaml-cpp/**/*.h", ]), includes = [ "include", "src", ], deps = ["yaml-headers", "yaml-headers-without-prefix"], strip_include_prefix = "include", visibility = ["//visibility:public"], ) cc_library( name = "yaml-headers", hdrs = glob([ "src/**/*.h", ]), include_prefix = "yaml-cpp", strip_include_prefix = "src", ) cc_library( name = "yaml-headers-without-prefix", hdrs = glob([ "src/**/*.h", ]), strip_include_prefix = "src", )
0
apollo_public_repos/apollo/third_party
apollo_public_repos/apollo/third_party/yaml_cpp/workspace.bzl
"""Loads the yaml-cpp library""" load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive") # Sanitize a dependency so that it works correctly from code that includes # Apollo as a submodule. def clean_dep(dep): return str(Label(dep)) def repo(): http_archive( name = "com_github_jbeder_yaml_cpp", build_file = clean_dep("//third_party/yaml_cpp:yaml_cpp.BUILD"), sha256 = "77ea1b90b3718aa0c324207cb29418f5bced2354c2e483a9523d98c3460af1ed", strip_prefix = "yaml-cpp-yaml-cpp-0.6.3", urls = [ "https://apollo-system.cdn.bcebos.com/archive/6.0/yaml-cpp-0.6.3.tar.gz", "https://github.com/jbeder/yaml-cpp/archive/yaml-cpp-0.6.3.tar.gz", ], )
0
apollo_public_repos/apollo/third_party
apollo_public_repos/apollo/third_party/yaml_cpp/BUILD
load("//tools/install:install.bzl", "install", "install_files", "install_src_files") package( default_visibility = ["//visibility:public"], ) install( name = "install", data_dest = "3rd-yaml-cpp", data = [ ":cyberfile.xml", ], ) install_src_files( name = "install_src", src_dir = ["."], dest = "3rd-yaml-cpp/src", filter = "*", )
0
apollo_public_repos/apollo/third_party
apollo_public_repos/apollo/third_party/vtk/init.bzl
load("//third_party/vtk:vtk_configure.bzl", "vtk_configure") def init(): vtk_configure(name = "local_config_vtk")
0
apollo_public_repos/apollo/third_party
apollo_public_repos/apollo/third_party/vtk/BUILD.tpl
package(default_visibility = ["//visibility:public"]) cc_library( name = "vtk_headers", hdrs = [ ":vtk_include" ], # include_prefix = "third_party/vtk", strip_include_prefix = "vtk/include", ) cc_library( name = "vtk", srcs = [":vtk_lib"], linkstatic = 1, deps = [ ":vtk_headers", ], ) %{copy_rules}
0
apollo_public_repos/apollo/third_party
apollo_public_repos/apollo/third_party/vtk/cyberfile.xml
<package format="2"> <name>3rd-vtk</name> <version>local</version> <description> Apollo packaged 3rd-vtk Lib. </description> <maintainer email="apollo-support@baidu.com">Apollo</maintainer> <license>Apache License 2.0</license> <url type="website">https://www.apollo.auto/</url> <url type="repository">https://github.com/ApolloAuto/apollo</url> <url type="bugtracker">https://github.com/ApolloAuto/apollo/issues</url> <type>third-wrapper</type> <src_path url="https://github.com/ApolloAuto/apollo">//third_party/vtk</src_path> </package>
0
apollo_public_repos/apollo/third_party
apollo_public_repos/apollo/third_party/vtk/vtk_configure.bzl
load("//tools:common.bzl", "basename", "dirname") load("//tools/platform:common.bzl", "execute", "make_copy_dir_rule", "make_copy_files_rule") _APOLLO_SYSROOT_DIR = "APOLLO_SYSROOT_DIR" _APOLLO_VTK_LIBS = [ "vtkCommonDataModel", "vtkCommonCore", "vtkCommonMath", "vtkCommonSystem", "vtkCommonMisc", "vtkCommonTransforms", "vtksys", ] def _vtk_solib_name(basename, version = None): """Constructs Linux-specific name of vtk libraries""" version = "" if not version else "-" + version return "lib{}{}.so".format(basename, version) def find_sysroot_dir(repository_ctx): if _APOLLO_SYSROOT_DIR in repository_ctx.os.environ: return repository_ctx.os.environ[_APOLLO_SYSROOT_DIR].strip() return None # fail("Environment variable APOLLO_SYSROOT_DIR was not specified." + # "Re-run ./apollo6.sh config") def _vtk_version_from_incl_path(incl_path): return basename(incl_path).strip("vtk-") def _create_local_vtk_repository(repository_ctx): sysroot_dir = find_sysroot_dir(repository_ctx) result = _vtk_match_version(repository_ctx, sysroot_dir) if result == None: fail("Oops, Package vtk not found.") (version, incl_dir, lib_path) = result # Copy the library and header files. libraries = [_vtk_solib_name(lib, version) for lib in _APOLLO_VTK_LIBS] _lib_path = lib_path + "/" # headers = _get_vtk_headers(incl_dir) _incl_dir = incl_dir + "/" copy_rules = [ make_copy_files_rule( repository_ctx, name = "vtk_lib", srcs = [_lib_path + lib for lib in libraries], outs = ["vtk/lib/" + lib for lib in libraries], ), make_copy_dir_rule( repository_ctx, name = "vtk_include", src_dir = incl_dir, out_dir = "vtk/include", ), ] # Set up BUILD file. build_tpl = repository_ctx.path(Label("//third_party/vtk:BUILD.tpl")) repository_ctx.template("BUILD", build_tpl, { "%{copy_rules}": "\n".join(copy_rules), }) def _vtk_match_version(repository_ctx, sysroot_dir = None): cmd = """ldconfig -p | awk -F'=>' '/libvtkCommonCore-.*.so$/ {print $2}'""" lib_result = execute( repository_ctx, ["sh", "-c", cmd], empty_stdout_fine = False, ).stdout.strip() libdict = {} for solib in lib_result.split("\n"): libpath = dirname(solib) version = basename(solib).rstrip(".so").split("-")[-1] prefix = solib[:solib.rfind("/lib/")] libdict[solib] = (libpath, version, prefix) prefix_dirs = ["/usr", "/usr/local", "/opt/apollo/neo/packages/3rd-vtk-dev/latest"] if sysroot_dir: prefix_dirs.append(sysroot_dir) for prefix in reversed(prefix_dirs): cmd = """ls -d {}/include/vtk-* 2>/dev/null""".format(prefix) incl_dir = execute( repository_ctx, ["sh", "-c", cmd], empty_stdout_fine = True, ).stdout.strip() if not incl_dir: continue version = _vtk_version_from_incl_path(incl_dir) for k in libdict: (lib_path, lib_version, lib_prefix) = libdict[k] if lib_version == version: return (version, incl_dir, lib_path) return None def _vtk_configure_impl(repository_ctx): # Room for _create_remote_vtk_repository _create_local_vtk_repository(repository_ctx) vtk_configure = repository_rule( implementation = _vtk_configure_impl, environ = [], ) """Detects and configures the local vtk library. Add the following to your WORKSPACE FILE: ```python vtk_configure(name = "local_config_vtk") ``` Args: name: A unique name for this workspace rule. """
0
apollo_public_repos/apollo/third_party
apollo_public_repos/apollo/third_party/vtk/BUILD
load("//tools/install:install.bzl", "install", "install_files", "install_src_files") package( default_visibility = ["//visibility:public"], ) install( name = "install", data_dest = "3rd-vtk", data = [ ":cyberfile.xml", ], ) install_src_files( name = "install_src", src_dir = ["."], dest = "3rd-vtk/src", filter = "*", )
0