[TOC]
Some common library, especially for heading info.
Some C++ syntax demo
- syntax01_move
Some code forstd::move
. - syntax02_dataSize
Print the data size and give a reference when to useconst&
and value parameters in function - syntax03_stringSplit
Split string using C++11. - syntax04_optional
Some example aboutstd::optional
. - syntax05_any
Some example aboutstd::any
. - syntax06_dataConversion
Data conversion,uint8_t[8] => uint64_t
- thread01_HelloWorld
Ref: http://www.cnblogs.com/haippy/p/3235560.html - thread02_Basic
Basic use ofthread
. Ref: http://www.cnblogs.com/haippy/p/3236136.html - thread03_Mutex
Usemutex
Ref: http://www.cnblogs.com/haippy/p/3237213.html - thread04_TimeMutex
Usetimed_mutex
. Ref: http://www.cnblogs.com/haippy/p/3237213.html - thread05_LockGuard
Uselock_guard
. Ref: http://www.cnblogs.com/haippy/p/3237213.html - thread06_UniqueLock
Useunique_lock
. Ref: http://www.cnblogs.com/haippy/p/3237213.html, http://www.cnblogs.com/haippy/p/3346477.html - thread07_ConditionVariable01
Usecondition variable
. Ref: http://www.cnblogs.com/haippy/p/3252041.html - thread08_ConditionVariable02
Usecondition variable
. Ref: http://www.cnblogs.com/haippy/p/3252041.html - thread09_Async01
Useasync
, and some comparison. Ref: https://blog.csdn.net/lijinqi1987/article/details/78909479 - thread10_JobQueue
A job queue for the producer-consumer paradigm. Ref: https://github.com/colmap/colmap/blob/dev/src/util/threading.h - thread11_PackagedTask
Usepackaged_task
example - thread12_ComplexPackagedTask
A complex example usingpackaged_task
, see code note for details. - thread13_AtomicBasic
Basic code usingatomic
- thread20_ComplexProject
One complex project, class have 2 thread, and the child thread has some callback in class main thread
- Eigen01_Basic
Basic using about Eigen library - Eigen02_LinearEquationSolver
Solve linear system equations use Eigen - Eigen03_Interpolation
Using interpolation method in Eigen - Eigen04_Format
Using fmt::format to format Eigen::Vector and Eigen::Matrix
- SophusStudy
study code aboutSophus
library
- ceres01_HelloWorld
ceres tutorials, hello world. http://ceres-solver.org/nnls_tutorial.html#hello-world - ceres02_Powell
ceres tutorials, powell function.a http://ceres-solver.org/nnls_tutorial.html#powell-s-function - ceres03_CurveFitting
ceres tutorials, curve fitting, with robust to reduce outliers. http://ceres-solver.org/nnls_tutorial.html#curve-fitting - ceres04_BundleAdjustment
ceres tutorials, bundle adjustment. http://ceres-solver.org/nnls_tutorial.html#bundle-adjustment - ceres05_libMVBundleAdjuster
ceres tutorials, bundle adjustment algorithm used by Blender/libmv. https://ceres-solver.googlesource.com/ceres-solver/+/master/examples/libmv_bundle_adjuster.cc - ceres06_RobotPoseMLE
Simulate a robot traversing down a 1-dimension hallway with noise odometry readings and noise range readings of the end of the hallway. By fusing the noisy odometry and sensor readings this example demonstrates how to compute the maximum likelihood estimate (MLE) of the robot's pose at each timestamp. https://github.com/ceres-solver/ceres-solver/blob/master/examples/robot_pose_mle.cc - ceres07_PoseGraph2D
An example of solving a graph-based formulation of SLAM. It reads a 2D pose graph problem definition file in the g2o format, formulates and solves the Ceres optimization problem, and outputs the original and optimized poses to file for plotting. https://github.com/ceres-solver/ceres-solver/tree/master/examples/slam/pose_graph_2d - ceres08_PoseGraph3D
An example formulate the pose graph based SLAM problem in 3-Dimensions with relative pose constraints. The example also illustrates how to use Eigen’s geometry module with Ceres’s automatic differentiation functionality. https://github.com/ceres-solver/ceres-solver/tree/master/examples/slam/pose_graph_3d - ceres09_SophusPoseGraph3D
Same as ceres08_PoseGraph3D, but use Sophus::SO3 to represent the rotation. The code don't run correctly, seeceres12_Pose3DEstimation
for better usage - ceres10_CovarianceEstimation
Calculate the covariance of estimated value. Here we only take 1 parameter as example, more parameters and complex problem(have information matrix in problem, manifold) could also be calculated. Ref: http://ceres-solver.org/nnls_covariance.html#covariance - ceres11_Pose2DEstimation
Consider we have two matched 2D points pair $\mathbf{p}A \leftrightarrow \mathbf{p}B$, and want to estimate the 2D transformation $\mathbf{R} \in SO(2), \mathbf{p} \in \mathbb{R}^2$ between the points, i.e., $$ \mathbf{e} = \sum{n=0}^{N} (\mathbf{R} \mathbf{p}{A,n}+ \mathbf{p} - \mathbf{p}_{B,n}) $$ The code using two method to optimize this problem,- Analytical Jacobian with pose manifold (R, p)
- ceres auto Jacobian with pose manifold (R, p)
- ceres auto Jacobian with angle manifold (theta, p).
- ceres12_Pose3DEstimation
Similar to ceres11_Pose2DEstimation but with 3D transformation. Consider we have two matched 3D points pair $\mathbf{p}A \leftrightarrow \mathbf{p}B$, and want to estimate the 3D transformation $\mathbf{R} \in SO(3), \mathbf{p} \in \mathbb{R}^3$ between the points, i.e., $$ \mathbf{e} = \sum{n=0}^{N} (\mathbf{R} \mathbf{p}{A,n}+ \mathbf{p} - \mathbf{p}_{B,n}) $$ The problem is also named after ICP, the code using two method to optimize this problem,- Analytical Jacobian with pose manifold (R, p)
- ceres auto Jacobian with pose manifold (R, p)
- Migrate code from
ceres 1.x
toceres 2.x
, the main difference is usingManifold
instead ofLocalParameterization
GlobalSize
=>AmbientSize
LocalSize
=>TangentSize
ComputeJacobian
=>PlusJacobian
- add
Minus
andMinusJacobian
, but these two method don't used currently, could justreturn true;
right now(see github issue)
- g2o01_CircleFit
Using g2o for circle fitting Ref: https://github.com/RainerKuemmerle/g2o/blob/master/g2o/examples/data_fitting/circle_fit.cpp - g2o02_CircleFitWithoutRegister
Same as g2o01_CircleFit, but don't useOptimizationAlgorithmFactory
to create solver. - g2o03_CurveFit
Use g2o for curve fitting Ref: https://github.com/RainerKuemmerle/g2o/blob/master/g2o/examples/data_fitting/curve_fit.cpp
- pcl01_Basic
Using a matrix to transform a point cloud Ref: https://pcl.readthedocs.io/projects/tutorials/en/latest/matrix_transform.html#matrix-transform - pcl02_PassThroughFilter
Filtering a point cloud using pass through filter Ref: https://pcl.readthedocs.io/projects/tutorials/en/latest/passthrough.html#passthrough - pcl03_VoxelGridFilter
Ref: https://pcl.readthedocs.io/projects/tutorials/en/latest/voxel_grid.html#voxelgrid - pcl04_IterativeClosestPoint
Using ICP(iterative closest point) to align two point clouds Ref: https://pcl.readthedocs.io/projects/tutorials/en/latest/iterative_closest_point.html - pcl05_IncrementalRegisterClouds
Incrementally register pairs of clouds Ref: https://pcl.readthedocs.io/projects/tutorials/en/latest/pairwise_incremental_registration.html#pairwise-incremental-registration
Some algorithm
- alg01_DBSCAN
DBSCAN implementation using C++ Ref: https://en.wikipedia.org/wiki/DBSCAN - alg02_BinarySearch
Search value$y_1$ ,$y_2$ in data to ensure$y_1 \le x < y_2$
- math01_CatmullRomSpline
Curve fitting using Catmull-Rom Splinescripts/analyze.py
: draw the fitting resultingscripts/analyze.ipynb
: symbol verification: cannot insert a control point into CR spline and also keep curve unchanged
- Pangolin01_HelloPangolin
Draw and show cube using pangolin. Ref: https://github.com/stevenlovegrove/Pangolin/blob/master/examples/HelloPangolin/main.cpp - Pangolin02_SimplePlot
Plot sin(t), cos(t) and sin(t) + cos(t) and show in pangolin. Ref: https://github.com/stevenlovegrove/Pangolin/blob/master/examples/SimplePlot/main.cpp - Pangolin03_SimpleDisplay
Display and some UI widgets Ref: https://github.com/stevenlovegrove/Pangolin/blob/master/examples/SimpleDisplay/main.cpp - Pangolin04_MultiDisplay
Multiple display. Ref: https://github.com/stevenlovegrove/Pangolin/blob/master/examples/SimpleMultiDisplay/main.cpp
- boost01_FileSystem
Study code aboutboost filesystem
: list file and folder, create folder - boost02_TimeStudy
Study code aboutchrono
time and boost time - boost03_Interpolation
Rational interpolation and cubic B-spline interpolation - boost04_Tokenizer
Boost tokenizer, separate string with specified separator - boost05_LexicalCast
Convert string to int/long/double and vice verse - boost06_Serialization
Serialization basic type or class data to text, xml and binary. - boost07_Process
Start multiple process from current process usingboost::process
- asio01_Basic
Basic skills and concepts required for asio. Ref: https://www.boost.org/doc/libs/1_81_0/doc/html/boost_asio/tutorial.html, basic skills - asio02_SyncTcpClient
Synchronous TCP client. Ref: https://www.boost.org/doc/libs/1_81_0/doc/html/boost_asio/tutorial/tutdaytime1.html - asio03_SyncTcpServer
Synchronous TCP server. Ref: https://www.boost.org/doc/libs/1_81_0/doc/html/boost_asio/tutorial/tutdaytime2.html - asio04_AsyncTcpServer
Asynchronous TCP server. Ref: https://www.boost.org/doc/libs/1_81_0/doc/html/boost_asio/tutorial/tutdaytime3.html - asio05_SyncUdpClient
Synchronous UDP client. Ref: https://www.boost.org/doc/libs/1_81_0/doc/html/boost_asio/tutorial/tutdaytime4.html - asio06_SyncUdpServer
Synchronous UDP server. Ref: https://www.boost.org/doc/libs/1_81_0/doc/html/boost_asio/tutorial/tutdaytime5.html - asio07_AsyncUdpServer
Asynchronous UDP server. Ref: https://www.boost.org/doc/libs/1_81_0/doc/html/boost_asio/tutorial/tutdaytime6.html - asio08_AsyncTcpUdpServer
A combined TCP/UDP asynchronous server. Ref: https://www.boost.org/doc/libs/1_81_0/doc/html/boost_asio/tutorial/tutdaytime7.html - asio09_MulticastSender
Multicast UDP sender usingasio
, based on boost1.58. - asio10_MulticastReceiver
Multicast UDP receiver usingasio
, based on boost1.58. - asio11_ObtainWebPage
Obtain web page content usingboost::asio
- beast01_SimpleHttpClient
Simple HTTP client. Ref: https://www.boost.org/doc/libs/1_81_0/libs/beast/doc/html/beast/quick_start/http_client.html - beast02_SimpleWebSocketClient
Simple WebSocket client. Ref: https://www.boost.org/doc/libs/1_81_0/libs/beast/doc/html/beast/quick_start/websocket_client.html - beast03_SyncWebSocketClient
Synchronous WebSocket client, don't work success. Ref: - beast04_SyncWebSocketServer
Synchronous WebSocket server. Ref: - beast05_AsyncWebSocketClient
Asynchronous WebSocket client. Ref: https://www.boost.org/doc/libs/1_81_0/libs/beast/example/websocket/client/async/websocket_client_async.cpp - beast06_AsyncWebSocketServer
Asynchronous WebSocket server. Ref: https://www.boost.org/doc/libs/1_81_0/libs/beast/example/websocket/server/async/websocket_server_async.cpp - beast07_SyncHttpClient
Synchronous HTTP client. Ref: https://www.boost.org/doc/libs/1_81_0/libs/beast/example/http/client/sync/http_client_sync.cpp - beast08_SyncHttpServer
Synchronous HTTP server. Ref: https://www.boost.org/doc/libs/1_81_0/libs/beast/example/http/server/sync/http_server_sync.cpp - beast09_AsyncHttpClient
Asynchronous HTTP client. Ref: https://www.boost.org/doc/libs/1_81_0/libs/beast/example/http/client/async/http_client_async.cpp - beast10_AsyncHttpServer
Asynchronous HTTP server. Ref: https://www.boost.org/doc/libs/1_81_0/libs/beast/example/http/server/async/http_server_async.cpp
Some study using cxxopts library
Some study using spdlog library
- spdlog01_Basic
Some basic log - spdlog02_MultiSink
Usespdlog
with multi sink, the console only write warning log, and file write all - spdlog03_CustomerFormat
Add customer format flag. - spdlog04_UseInDll
Use spdlog in dll
- "spdlog::info()" could not add "sourfile:location" flag in logging, while "SPDLOG_INFO" does.
- No module name could be add to log, should setting it manually(just input into log message).
some usage for nlohmann json
library.
- json01_Basic
Basic usage
some usage for jsoncpp
library.
- jsoncpp01_Basic
Basic usage
- YamlStudy
Write and read yaml file usingyaml-cpp
.
Some usage about protobuf
- protobuf01_Basic
Basic example Code to generate python file:protoc --proto_path ./proto --python_out . ./proto/cc/AddressBook.proto
Basic SQLite usage using SQLiteCpp
.
Some usage about SQLite ORM
- SqliteOrm01_Basic
Basic usage
Some study code about sqlite_modern_cpp
- SqliteModernCpp01_Basic
Basic usage
Compress or decompress file using libarchive
- archive01_basic
Using libarchive to compress/decompress files
Basic usage for httplib
- http01_Basic
Basic client/server - http02_WebClient
Get web page content from url
Some study code about libhuv
- hv01_TcpServer
Basic TCP server - hv02_TcpClient
Basic TCP Client - hv03_HttpServer
Basic HTTP server - hv04_WebSocketServer
Basic web socket server - hv05_WebSocketClient
Basic web socket client
Some study using TurboJpeg
- TurboJpeg01_CompressBenchmark
Compress YUYV image to JPEG using different method, and calculate the average used time.
Some example about video process
- VideoProcess01_SimpleX264Encoder
Compress YUYV image to H264 video using libx264 - VideoProcess02_X264Encoder
Video encoder(YUV => H264) using libx264 - VideoProcess03_FFmpegEncoder
Video encoder(YUV => H264) using FFmpeg - VideoProcess04_FFmpegDecoder
Video dncoder(H264 => YUV) using FFmpeg
Some system applications
- system01_GetNetDeviceInfo
Get the net device info, include IPv4 address, mac address Ref: 1. https://segmentfault.com/a/1190000005138358
Some code about pybind11
- pybind01_Basic
Basic usage. Ref: https://pybind11.readthedocs.io/en/stable/basics.html - pybind02_Class
Useclass
. Ref: https://pybind11.readthedocs.io/en/stable/classes.html
- Alglib01_Interpolation
Study interpolation method inalglib
. - GeometryTransform
Transform among rotation matrix, euler angle, rotation vector and SO3, include Matlab Script Ref: https://blog.csdn.net/mulinb/article/details/51227597