farm-ng-core
farm_ng Namespace Reference

Namespaces

 details
 
 test
 
 testing
 
 time_series
 

Classes

struct  A
 
struct  Ab
 
struct  Abc
 
class  Adder
 
class  Component
 Parent definition of a farm_ng::Component. More...
 
class  Context
 Contains the execution state context. More...
 
class  ContextStrand
 Contains a stranded context to post and dispatch handlers with the guarantee that none of the handlers will execute concurrently. More...
 
struct  Error
 
struct  ErrorDetail
 
class  EventLogEof
 
class  EventLogExist
 
class  EventLogPos
 
class  EventLogReader
 Reader to deserialize data written by the EventLogWriter. More...
 
class  EventLogReaderBinaryImpl
 
class  EventLogReaderImpl
 Implementation of the EventLogReader class. More...
 
class  EventLogWriter
 Class that serializes incoming protobuf events to a file in disk. More...
 
class  EventLogWriterBinaryImpl
 
class  EventLogWriterImpl
 Implementation of the EventLogWriter class. More...
 
struct  EventTimeCompareClockAndSemantics
 
struct  FromProtoTrait
 Trait to associate one concrete Cpp type with given proto type TProto. More...
 
struct  HasType
 
struct  HasType< T, std::variant< Us... > >
 
class  Input
 A class that represents in Input type to be used in a Component. More...
 
class  InputConfig
 The configuration of an Input class. More...
 
class  Output
 A class that represents an Output type to be used in a Component. More...
 
struct  Overload
 https://en.cppreference.com/w/cpp/utility/variant/visit More...
 
class  Printer
 
struct  ScopedTimer
 Stopwatch for a single, named timer. More...
 
class  Shared
 
struct  StampedBar
 
struct  StampedFoo
 
struct  StampedInterpolative
 
class  StopwatchSingleton
 Stopwatch class for creating multiple, optionally concurrent, timers. More...
 
class  StreamLogger
 
struct  Success
 
class  ThreadPool
 Class representing a pool of threads connected to a boost:asio::io_context. More...
 
class  TimeSeries
 TimeSeries is a container of StampedValue that are sorted by their timestamp. More...
 
struct  ToProtoTrait
 Trait to associate one concrete Proto type with given C++ type TCpp. More...
 
struct  ToProtoTrait< sophus::IntensityImage<> >
 
struct  Uri
 https://en.wikipedia.org/w/index.php?title=Uniform_Resource_Identifier&oldid=1072892451#Syntax More...
 
struct  Void
 Regular void type. More...
 

Typedefs

template<class TT , class TE = Error>
using Expected = tl::expected< TT, TE >
 
template<typename TT >
using ExpectShared = farm_ng::Expected< Shared< TT > >
 
template<typename TT >
using SharedVector = std::vector< Shared< TT > >
 
using Hyperplane3d = Eigen::Hyperplane< double, 3 >
 

Functions

void printBacktrace ()
 
auto operator<< (std::ostream &os, Error const &error) -> std::ostream &
 
template<class TT , class TE = Error>
std::optional< TT > fromExpected (Expected< TT, TE > expected)
 
template<class TT >
Expected< TT > fromOptional (std::optional< TT > optional)
 
auto makeA (bool a_error) -> Expected< A >
 
auto makeAb (bool a_error, bool b_error) -> Expected< Ab >
 
auto makeAbc (bool a_error, bool b_error, bool c_error) -> Expected< Abc >
 
auto makeAbcAtOnce (bool a_error, bool b_error, bool c_error) -> Expected< Abc >
 
auto sum (Expected< A > maybe_left, Expected< A > maybe_right) -> Expected< A >
 
void setLogLineFunction (std::function< void(std::string const &)> f)
 
void logLine (std::string const &line)
 
auto stringFromLogLevel (LogLevel level) -> std::string
 
 FARM_ENUM (LogLevel, int,((trace, 0),(debug, 1),(info, 2),(warning, 3),(error, 4),(critical, 5)))
 
StreamLoggerdefaultLogger ()
 
template<sophus::concepts::RealScalarType T>
inchesFromMeters (T m)
 Converts meters [m] to inches [in]. More...
 
template<sophus::concepts::RealScalarType T>
metersFromInches (T inches)
 Converts inches [in] to meters [m]. More...
 
template<sophus::concepts::RealScalarType T>
metersFromFeet (T feet)
 Converts feet [ft] to meters [m]. More...
 
template<sophus::concepts::RealScalarType T>
feetFromMeters (T meters)
 Converts meters [m] to feet [ft]. More...
 
template<sophus::concepts::RealScalarType T>
degFromRad (T rad)
 Converts radians to degrees. More...
 
template<sophus::concepts::RealScalarType T>
radFromDeg (T deg)
 Converts degrees to radians. More...
 
template<sophus::concepts::RealEigenDenseType TPoint>
auto radFromDeg (TPoint const &v_deg)
 
template<sophus::concepts::RealScalarType T>
arcMinuteFromRad (T rad)
 Converts radians to arc minutes (60th of a degree) More...
 
template<sophus::concepts::RealScalarType T>
radFromArcMinute (T arc_minute)
 Converts arc minutes (60th of a degree) to radians. More...
 
template<class TContainer , class TPred >
size_t eraseIf (TContainer &c, TPred pred)
 https://en.cppreference.com/w/cpp/container/deque/erase2 More...
 
std::optional< std::filesystem::path > createVersionedFolder (std::filesystem::path const &target_path)
 Given a target_path name "foo", this function will create a version folder "foo.xy". More...
 
std::optional< std::filesystem::path > createUniqueTemporaryDirectory ()
 Creates a unique temporary directory with the prefix "/tmp/farm-ng-". More...
 
template<>
auto fromProt (core::proto::Uri const &proto) -> Expected< Uri >
 
template<>
core::proto::Uri toProt (Uri const &uri)
 
 FARM_PROTO_CONV_TRAIT (Uri, core::proto::Uri)
 
 TEST (time_series, empty)
 
 TEST (time_series, sorted_invariant)
 
 TEST (time_series, find_nearest)
 
 TEST (time_series, find_near_using_threshold)
 
 TEST (time_series, size)
 
 TEST (time_series, index)
 
std::vector< std::string > tokenize (std::string const &str, char delimiter=' ')
 Splits string into N tokens (substrings) based on a delimiter. More...
 
template<class... Ts>
 Overload (Ts...) -> Overload< Ts... >
 
template<class Variant , typename... Alternatives>
decltype(auto) visit_variant (Variant &&variant, Alternatives &&... alternatives)
 https://gist.github.com/s3rvac/d1f30364ce1f732d75ef0c89a1c8c1ef More...
 
std::string demangleTypeid (std::type_info const &type)
 Transforms identifier to C++ source identifier. More...
 
template<>
auto fromProt< core::proto::RegionI32 > (core::proto::RegionI32 const &proto) -> Expected< sophus::RegionI >
 
template<>
auto toProt< sophus::RegionI > (sophus::RegionI const &region) -> core::proto::RegionI32
 
template<>
auto fromProt< core::proto::RegionF32 > (core::proto::RegionF32 const &proto) -> Expected< sophus::RegionF32 >
 
template<>
auto toProt< sophus::RegionF32 > (sophus::RegionF32 const &region) -> core::proto::RegionF32
 
template<>
auto fromProt< core::proto::RegionF64 > (core::proto::RegionF64 const &proto) -> Expected< sophus::RegionF64 >
 
template<>
auto toProt< sophus::RegionF64 > (sophus::RegionF64 const &region) -> core::proto::RegionF64
 
template<>
auto fromProt< core::proto::Region2F64 > (core::proto::Region2F64 const &proto) -> Expected< sophus::Region2F64 >
 
template<>
auto toProt< sophus::Region2F64 > (sophus::Region2F64 const &region) -> core::proto::Region2F64
 
 FARM_PROTO_CONV_TRAIT (sophus::RegionI, core::proto::RegionI32)
 
 FARM_PROTO_CONV_TRAIT (sophus::RegionF32, core::proto::RegionF32)
 
 FARM_PROTO_CONV_TRAIT (sophus::RegionF64, core::proto::RegionF64)
 
 FARM_PROTO_CONV_TRAIT (sophus::Region2F64, core::proto::Region2F64)
 
template<>
auto fromProt< core::proto::UnitVec3F64 > (core::proto::UnitVec3F64 const &proto) -> Expected< sophus::UnitVector3F64 >
 
template<>
auto toProt< sophus::UnitVector3F64 > (sophus::UnitVector3F64 const &uvec) -> core::proto::UnitVec3F64
 
template<>
auto fromProt< core::proto::Hyperplane3F64 > (core::proto::Hyperplane3F64 const &proto) -> Expected< Eigen::Hyperplane< double, 3 >>
 
template<>
auto toProt< Eigen::Hyperplane< double, 3 > > (Eigen::Hyperplane< double, 3 > const &plane) -> core::proto::Hyperplane3F64
 
 FARM_PROTO_CONV_TRAIT (sophus::UnitVector3F64, core::proto::UnitVec3F64)
 
 FARM_PROTO_CONV_TRAIT (Hyperplane3d, core::proto::Hyperplane3F64)
 
template<>
auto fromProt< core::proto::ImageSize > (core::proto::ImageSize const &proto) -> Expected< sophus::ImageSize >
 
template<>
auto toProt< sophus::ImageSize > (sophus::ImageSize const &image_size) -> core::proto::ImageSize
 
template<>
auto fromProt< core::proto::ImageLayout > (core::proto::ImageLayout const &proto) -> Expected< sophus::ImageLayout >
 
template<>
auto toProt< sophus::ImageLayout > (sophus::ImageLayout const &layout) -> core::proto::ImageLayout
 
template<>
auto fromProt< core::proto::PixelFormat > (core::proto::PixelFormat const &proto) -> Expected< sophus::PixelFormat >
 
template<>
auto toProt< sophus::PixelFormat > (sophus::PixelFormat const &layout) -> core::proto::PixelFormat
 
template<>
auto fromProt< core::proto::DynImage > (core::proto::DynImage const &proto) -> Expected< sophus::AnyImage<>>
 
template<>
auto toProt< sophus::AnyImage<> > (sophus::AnyImage<> const &image) -> core::proto::DynImage
 
Expected< sophus::IntensityImage<> > intensityImageFromProto (core::proto::DynImage const &proto)
 
template<>
auto toProt< sophus::IntensityImage<> > (sophus::IntensityImage<> const &image) -> core::proto::DynImage
 
 FARM_PROTO_CONV_TRAIT (sophus::ImageSize, core::proto::ImageSize)
 
 FARM_PROTO_CONV_TRAIT (sophus::ImageLayout, core::proto::ImageLayout)
 
 FARM_PROTO_CONV_TRAIT (sophus::PixelFormat, core::proto::PixelFormat)
 
 FARM_PROTO_CONV_TRAIT (sophus::AnyImage<>, core::proto::DynImage)
 
template<>
auto fromProt< core::proto::QuaternionF64 > (core::proto::QuaternionF64 const &proto) -> Expected< sophus::QuaternionF64 >
 
template<>
auto toProt< sophus::QuaternionF64 > (sophus::QuaternionF64 const &quat) -> core::proto::QuaternionF64
 
template<>
auto fromProt< core::proto::Rotation2F64 > (core::proto::Rotation2F64 const &proto) -> Expected< sophus::Rotation2F64 >
 
template<>
auto toProt< sophus::Rotation2F64 > (sophus::Rotation2F64 const &rotation) -> core::proto::Rotation2F64
 
template<>
auto fromProt< core::proto::Isometry2F64 > (core::proto::Isometry2F64 const &proto) -> Expected< sophus::Isometry2F64 >
 
template<>
auto toProt< sophus::Isometry2F64 > (sophus::Isometry2F64 const &pose) -> core::proto::Isometry2F64
 
template<>
auto fromProt< core::proto::Rotation3F64 > (core::proto::Rotation3F64 const &proto) -> Expected< sophus::Rotation3F64 >
 
template<>
auto toProt< sophus::Rotation3F64 > (sophus::Rotation3F64 const &rotation) -> core::proto::Rotation3F64
 
template<>
auto fromProt< core::proto::Isometry3F64 > (core::proto::Isometry3F64 const &proto) -> Expected< sophus::Isometry3F64 >
 
template<>
auto toProt< sophus::Isometry3F64 > (sophus::Isometry3F64 const &pose) -> core::proto::Isometry3F64
 
 FARM_PROTO_CONV_TRAIT (sophus::QuaternionF64, core::proto::QuaternionF64)
 
 FARM_PROTO_CONV_TRAIT (sophus::Rotation2F64, core::proto::Rotation2F64)
 
 FARM_PROTO_CONV_TRAIT (sophus::Isometry2F64, core::proto::Isometry2F64)
 
 FARM_PROTO_CONV_TRAIT (sophus::Rotation3F64, core::proto::Rotation3F64)
 
 FARM_PROTO_CONV_TRAIT (sophus::Isometry3F64, core::proto::Isometry3F64)
 
template<>
auto fromProt< core::proto::Vec2I64 > (core::proto::Vec2I64 const &proto) -> Expected< Eigen::Vector2i >
 
template<>
auto toProt< Eigen::Vector2i > (Eigen::Vector2i const &v) -> core::proto::Vec2I64
 
template<>
auto fromProt< core::proto::Vec2F32 > (core::proto::Vec2F32 const &proto) -> Expected< Eigen::Vector2f >
 
template<>
auto toProt< Eigen::Vector2f > (Eigen::Vector2f const &v) -> core::proto::Vec2F32
 
template<>
auto fromProt< core::proto::Vec2F64 > (core::proto::Vec2F64 const &proto) -> Expected< Eigen::Vector2d >
 
template<>
auto toProt< Eigen::Vector2d > (Eigen::Vector2d const &v) -> core::proto::Vec2F64
 
template<>
auto fromProt< core::proto::Vec3I64 > (core::proto::Vec3I64 const &proto) -> Expected< Eigen::Vector3i >
 
template<>
auto toProt< Eigen::Vector3i > (Eigen::Vector3i const &v) -> core::proto::Vec3I64
 
template<>
auto fromProt< core::proto::Vec3F32 > (core::proto::Vec3F32 const &proto) -> Expected< Eigen::Vector3f >
 
template<>
auto toProt< Eigen::Vector3f > (Eigen::Vector3f const &v) -> core::proto::Vec3F32
 
template<>
auto fromProt< core::proto::Vec3F64 > (core::proto::Vec3F64 const &proto) -> Expected< Eigen::Vector3d >
 
template<>
auto toProt< Eigen::Vector3d > (Eigen::Vector3d const &v) -> core::proto::Vec3F64
 
template<>
auto fromProt< core::proto::Mat2F32 > (core::proto::Mat2F32 const &proto) -> Expected< Eigen::Matrix2f >
 
template<>
auto toProt< Eigen::Matrix2f > (Eigen::Matrix2f const &v) -> core::proto::Mat2F32
 
template<>
auto fromProt< core::proto::Mat2F64 > (core::proto::Mat2F64 const &proto) -> Expected< Eigen::Matrix2d >
 
template<>
auto toProt< Eigen::Matrix2d > (Eigen::Matrix2d const &v) -> core::proto::Mat2F64
 
template<>
auto fromProt< core::proto::Mat3F32 > (core::proto::Mat3F32 const &proto) -> Expected< Eigen::Matrix3f >
 
template<>
auto toProt< Eigen::Matrix3f > (Eigen::Matrix3f const &v) -> core::proto::Mat3F32
 
template<>
auto fromProt< core::proto::Mat3F64 > (core::proto::Mat3F64 const &proto) -> Expected< Eigen::Matrix3d >
 
template<>
auto toProt< Eigen::Matrix3d > (Eigen::Matrix3d const &v) -> core::proto::Mat3F64
 
 FARM_PROTO_CONV_TRAIT (Eigen::Vector2i, core::proto::Vec2I64)
 
 FARM_PROTO_CONV_TRAIT (Eigen::Vector2f, core::proto::Vec2F32)
 
 FARM_PROTO_CONV_TRAIT (Eigen::Vector2d, core::proto::Vec2F64)
 
 FARM_PROTO_CONV_TRAIT (Eigen::Vector3i, core::proto::Vec3I64)
 
 FARM_PROTO_CONV_TRAIT (Eigen::Vector3f, core::proto::Vec3F32)
 
 FARM_PROTO_CONV_TRAIT (Eigen::Vector3d, core::proto::Vec3F64)
 
 FARM_PROTO_CONV_TRAIT (Eigen::Matrix2f, core::proto::Mat2F32)
 
 FARM_PROTO_CONV_TRAIT (Eigen::Matrix2d, core::proto::Mat2F64)
 
 FARM_PROTO_CONV_TRAIT (Eigen::Matrix3f, core::proto::Mat3F32)
 
 FARM_PROTO_CONV_TRAIT (Eigen::Matrix3d, core::proto::Mat3F64)
 
template<class TProto >
auto fromProt (TProto const &proto) -> Expected< typename FromProtoTrait< TProto >::CppType >
 Function template to convert a C++ object to a proto object. More...
 
template<class TCpp >
auto toProt (TCpp const &cpp) -> typename ToProtoTrait< TCpp >::ProtoType
 Function template to convert a proto object to a C++ object. More...
 
template<>
auto fromProt< core::proto::CameraModel > (core::proto::CameraModel const &proto) -> Expected< sophus::CameraModel >
 
template<>
auto toProt< sophus::CameraModel > (sophus::CameraModel const &camera_model) -> core::proto::CameraModel
 
template<>
auto fromProt< core::proto::CameraModels > (core::proto::CameraModels const &proto) -> Expected< std::vector< sophus::CameraModel >>
 
template<>
auto toProt< std::vector< sophus::CameraModel > > (std::vector< sophus::CameraModel > const &camera_models) -> core::proto::CameraModels
 
 FARM_PROTO_CONV_TRAIT (sophus::CameraModel, core::proto::CameraModel)
 
 FARM_PROTO_CONV_TRAIT (std::vector< sophus::CameraModel >, core::proto::CameraModels)
 
auto getStamp (core::proto::Event const &event, std::string const &clock_name, std::string const &semantics) -> core::proto::Timestamp const *
 
auto eventLogTimeOrderedIndex (std::string const &clock_name, std::string const &semantics, std::vector< EventLogReader > const &readers) -> std::vector< EventLogPos >
 
auto makeWriteStamp () -> core::proto::Timestamp
 
auto writeProtobufToJsonFile (std::filesystem::path const &path, google::protobuf::Message const &proto)
 TODO: Add API docs. More...
 
auto writeProtobufToBinaryFile (std::filesystem::path const &path, google::protobuf::Message const &proto) -> Expected< Success >
 
auto readJsonStringFromJsonFile (std::filesystem::path const &path) -> Expected< std::string >
 
auto readBytesFromBinaryFile (std::filesystem::path const &path) -> Expected< std::string >
 
template<class TProtobufT >
Expected< TProtobufT > readProtobufFromJsonFile (std::filesystem::path const &path)
 
template<class TProtobufT >
Expected< TProtobufT > readProtobufFromBinaryFile (std::filesystem::path const &path)
 

Variables

std::function< void(std::string const &)> & getLogLineFunction ()
 
template<class TDerived , class TBase >
concept DerivedFrom = std::is_base_of_v<TBase, TDerived>
 
template<class TT , class TU >
concept SameAs = std::is_same_v<TT, TU>
 
template<class TT >
concept EnumType = std::is_enum_v<TT>
 
template<typename TT >
concept Arithmetic = std::is_arithmetic_v<TT>
 
template<class >
constexpr bool AlwaysFalse = false
 https://en.cppreference.com/w/cpp/utility/variant/visit More...
 
template<class T , class Variant >
constexpr bool has_type_v = HasType<T, Variant>::value
 

Typedef Documentation

◆ Expected

template<class TT , class TE = Error>
using farm_ng::Expected = typedef tl::expected<TT, TE>

◆ ExpectShared

template<typename TT >
using farm_ng::ExpectShared = typedef farm_ng::Expected<Shared<TT> >

◆ Hyperplane3d

using farm_ng::Hyperplane3d = typedef Eigen::Hyperplane<double, 3>

◆ SharedVector

template<typename TT >
using farm_ng::SharedVector = typedef std::vector<Shared<TT> >

Function Documentation

◆ arcMinuteFromRad()

template<sophus::concepts::RealScalarType T>
T farm_ng::arcMinuteFromRad ( rad)

Converts radians to arc minutes (60th of a degree)

◆ createUniqueTemporaryDirectory()

std::optional<std::filesystem::path> farm_ng::createUniqueTemporaryDirectory ( )
inline

Creates a unique temporary directory with the prefix "/tmp/farm-ng-".

Returns nullopt if for unexpected reason creation of the folder fails. Otherwise, it returns the path of the created directory.

◆ createVersionedFolder()

std::optional<std::filesystem::path> farm_ng::createVersionedFolder ( std::filesystem::path const &  target_path)
inline

Given a target_path name "foo", this function will create a version folder "foo.xy".

First, it attempt to create folder "foo.00". If the path "foo.00" already exits, it attempts to create "foo.01", etc.

Precondition: parent_path of the versioned folder must exist

Returns nullopt if for unexpected reason creation of the folder fails. Otherwise, it returns the path of the created directory.

◆ defaultLogger()

StreamLogger& farm_ng::defaultLogger ( )
inline

◆ degFromRad()

template<sophus::concepts::RealScalarType T>
T farm_ng::degFromRad ( rad)

Converts radians to degrees.

◆ demangleTypeid()

std::string farm_ng::demangleTypeid ( std::type_info const &  type)

Transforms identifier to C++ source identifier.

Used for uri on Component templated class

◆ eraseIf()

template<class TContainer , class TPred >
size_t farm_ng::eraseIf ( TContainer &  c,
TPred  pred 
)

◆ eventLogTimeOrderedIndex()

std::vector< EventLogPos > farm_ng::eventLogTimeOrderedIndex ( std::string const &  clock_name,
std::string const &  semantics,
std::vector< EventLogReader > const &  readers 
) -> std::vector< EventLogPos >

◆ FARM_ENUM()

farm_ng::FARM_ENUM ( LogLevel  ,
int  ,
((trace, 0),(debug, 1),(info, 2),(warning, 3),(error, 4),(critical, 5))   
)

◆ FARM_PROTO_CONV_TRAIT() [1/28]

farm_ng::FARM_PROTO_CONV_TRAIT ( Eigen::Matrix2d  ,
core::proto::Mat2F64   
)

◆ FARM_PROTO_CONV_TRAIT() [2/28]

farm_ng::FARM_PROTO_CONV_TRAIT ( Eigen::Matrix2f  ,
core::proto::Mat2F32   
)

◆ FARM_PROTO_CONV_TRAIT() [3/28]

farm_ng::FARM_PROTO_CONV_TRAIT ( Eigen::Matrix3d  ,
core::proto::Mat3F64   
)

◆ FARM_PROTO_CONV_TRAIT() [4/28]

farm_ng::FARM_PROTO_CONV_TRAIT ( Eigen::Matrix3f  ,
core::proto::Mat3F32   
)

◆ FARM_PROTO_CONV_TRAIT() [5/28]

farm_ng::FARM_PROTO_CONV_TRAIT ( Eigen::Vector2d  ,
core::proto::Vec2F64   
)

◆ FARM_PROTO_CONV_TRAIT() [6/28]

farm_ng::FARM_PROTO_CONV_TRAIT ( Eigen::Vector2f  ,
core::proto::Vec2F32   
)

◆ FARM_PROTO_CONV_TRAIT() [7/28]

farm_ng::FARM_PROTO_CONV_TRAIT ( Eigen::Vector2i  ,
core::proto::Vec2I64   
)

◆ FARM_PROTO_CONV_TRAIT() [8/28]

farm_ng::FARM_PROTO_CONV_TRAIT ( Eigen::Vector3d  ,
core::proto::Vec3F64   
)

◆ FARM_PROTO_CONV_TRAIT() [9/28]

farm_ng::FARM_PROTO_CONV_TRAIT ( Eigen::Vector3f  ,
core::proto::Vec3F32   
)

◆ FARM_PROTO_CONV_TRAIT() [10/28]

farm_ng::FARM_PROTO_CONV_TRAIT ( Eigen::Vector3i  ,
core::proto::Vec3I64   
)

◆ FARM_PROTO_CONV_TRAIT() [11/28]

farm_ng::FARM_PROTO_CONV_TRAIT ( Hyperplane3d  ,
core::proto::Hyperplane3F64   
)

◆ FARM_PROTO_CONV_TRAIT() [12/28]

farm_ng::FARM_PROTO_CONV_TRAIT ( sophus::AnyImage<>  ,
core::proto::DynImage   
)

◆ FARM_PROTO_CONV_TRAIT() [13/28]

farm_ng::FARM_PROTO_CONV_TRAIT ( sophus::CameraModel  ,
core::proto::CameraModel   
)

◆ FARM_PROTO_CONV_TRAIT() [14/28]

farm_ng::FARM_PROTO_CONV_TRAIT ( sophus::ImageLayout  ,
core::proto::ImageLayout   
)

◆ FARM_PROTO_CONV_TRAIT() [15/28]

farm_ng::FARM_PROTO_CONV_TRAIT ( sophus::ImageSize  ,
core::proto::ImageSize   
)

◆ FARM_PROTO_CONV_TRAIT() [16/28]

farm_ng::FARM_PROTO_CONV_TRAIT ( sophus::Isometry2F64  ,
core::proto::Isometry2F64   
)

◆ FARM_PROTO_CONV_TRAIT() [17/28]

farm_ng::FARM_PROTO_CONV_TRAIT ( sophus::Isometry3F64  ,
core::proto::Isometry3F64   
)

◆ FARM_PROTO_CONV_TRAIT() [18/28]

farm_ng::FARM_PROTO_CONV_TRAIT ( sophus::PixelFormat  ,
core::proto::PixelFormat   
)

◆ FARM_PROTO_CONV_TRAIT() [19/28]

farm_ng::FARM_PROTO_CONV_TRAIT ( sophus::QuaternionF64  ,
core::proto::QuaternionF64   
)

◆ FARM_PROTO_CONV_TRAIT() [20/28]

farm_ng::FARM_PROTO_CONV_TRAIT ( sophus::Region2F64  ,
core::proto::Region2F64   
)

◆ FARM_PROTO_CONV_TRAIT() [21/28]

farm_ng::FARM_PROTO_CONV_TRAIT ( sophus::RegionF32  ,
core::proto::RegionF32   
)

◆ FARM_PROTO_CONV_TRAIT() [22/28]

farm_ng::FARM_PROTO_CONV_TRAIT ( sophus::RegionF64  ,
core::proto::RegionF64   
)

◆ FARM_PROTO_CONV_TRAIT() [23/28]

farm_ng::FARM_PROTO_CONV_TRAIT ( sophus::RegionI  ,
core::proto::RegionI32   
)

◆ FARM_PROTO_CONV_TRAIT() [24/28]

farm_ng::FARM_PROTO_CONV_TRAIT ( sophus::Rotation2F64  ,
core::proto::Rotation2F64   
)

◆ FARM_PROTO_CONV_TRAIT() [25/28]

farm_ng::FARM_PROTO_CONV_TRAIT ( sophus::Rotation3F64  ,
core::proto::Rotation3F64   
)

◆ FARM_PROTO_CONV_TRAIT() [26/28]

farm_ng::FARM_PROTO_CONV_TRAIT ( sophus::UnitVector3F64  ,
core::proto::UnitVec3F64   
)

◆ FARM_PROTO_CONV_TRAIT() [27/28]

farm_ng::FARM_PROTO_CONV_TRAIT ( std::vector< sophus::CameraModel ,
core::proto::CameraModels   
)

◆ FARM_PROTO_CONV_TRAIT() [28/28]

farm_ng::FARM_PROTO_CONV_TRAIT ( Uri  ,
core::proto::Uri   
)

◆ feetFromMeters()

template<sophus::concepts::RealScalarType T>
T farm_ng::feetFromMeters ( meters)

Converts meters [m] to feet [ft].

◆ fromExpected()

template<class TT , class TE = Error>
std::optional<TT> farm_ng::fromExpected ( Expected< TT, TE >  expected)

◆ fromOptional()

template<class TT >
Expected<TT> farm_ng::fromOptional ( std::optional< TT >  optional)

◆ fromProt() [1/2]

template<>
auto farm_ng::fromProt ( core::proto::Uri const &  proto) -> Expected<Uri>

◆ fromProt() [2/2]

template<class TProto >
auto farm_ng::fromProt ( TProto const &  proto) -> Expected< typename FromProtoTrait< TProto >::CppType >

Function template to convert a C++ object to a proto object.

Example:

Eigen::Vector3d v(1, 2, 3);
proto::Vec3F64 proto = toProt(v);

Note: The return type is deduced from the argument type using the FromProtoTrait trait.

◆ fromProt< core::proto::CameraModel >()

template<>
auto farm_ng::fromProt< core::proto::CameraModel > ( core::proto::CameraModel const &  proto) -> Expected<sophus::CameraModel>

◆ fromProt< core::proto::CameraModels >()

template<>
auto farm_ng::fromProt< core::proto::CameraModels > ( core::proto::CameraModels const &  proto) -> Expected<std::vector<sophus::CameraModel>>

◆ fromProt< core::proto::DynImage >()

template<>
auto farm_ng::fromProt< core::proto::DynImage > ( core::proto::DynImage const &  proto) -> Expected<sophus::AnyImage<>>

◆ fromProt< core::proto::Hyperplane3F64 >()

template<>
auto farm_ng::fromProt< core::proto::Hyperplane3F64 > ( core::proto::Hyperplane3F64 const &  proto) -> Expected<Eigen::Hyperplane<double, 3>>

◆ fromProt< core::proto::ImageLayout >()

template<>
auto farm_ng::fromProt< core::proto::ImageLayout > ( core::proto::ImageLayout const &  proto) -> Expected<sophus::ImageLayout>

◆ fromProt< core::proto::ImageSize >()

template<>
auto farm_ng::fromProt< core::proto::ImageSize > ( core::proto::ImageSize const &  proto) -> Expected<sophus::ImageSize>

◆ fromProt< core::proto::Isometry2F64 >()

template<>
auto farm_ng::fromProt< core::proto::Isometry2F64 > ( core::proto::Isometry2F64 const &  proto) -> Expected<sophus::Isometry2F64>

◆ fromProt< core::proto::Isometry3F64 >()

template<>
auto farm_ng::fromProt< core::proto::Isometry3F64 > ( core::proto::Isometry3F64 const &  proto) -> Expected<sophus::Isometry3F64>

◆ fromProt< core::proto::Mat2F32 >()

template<>
auto farm_ng::fromProt< core::proto::Mat2F32 > ( core::proto::Mat2F32 const &  proto) -> Expected<Eigen::Matrix2f>

◆ fromProt< core::proto::Mat2F64 >()

template<>
auto farm_ng::fromProt< core::proto::Mat2F64 > ( core::proto::Mat2F64 const &  proto) -> Expected<Eigen::Matrix2d>

◆ fromProt< core::proto::Mat3F32 >()

template<>
auto farm_ng::fromProt< core::proto::Mat3F32 > ( core::proto::Mat3F32 const &  proto) -> Expected<Eigen::Matrix3f>

◆ fromProt< core::proto::Mat3F64 >()

template<>
auto farm_ng::fromProt< core::proto::Mat3F64 > ( core::proto::Mat3F64 const &  proto) -> Expected<Eigen::Matrix3d>

◆ fromProt< core::proto::PixelFormat >()

template<>
auto farm_ng::fromProt< core::proto::PixelFormat > ( core::proto::PixelFormat const &  proto) -> Expected<sophus::PixelFormat>

◆ fromProt< core::proto::QuaternionF64 >()

template<>
auto farm_ng::fromProt< core::proto::QuaternionF64 > ( core::proto::QuaternionF64 const &  proto) -> Expected<sophus::QuaternionF64>

◆ fromProt< core::proto::Region2F64 >()

template<>
auto farm_ng::fromProt< core::proto::Region2F64 > ( core::proto::Region2F64 const &  proto) -> Expected<sophus::Region2F64>

◆ fromProt< core::proto::RegionF32 >()

template<>
auto farm_ng::fromProt< core::proto::RegionF32 > ( core::proto::RegionF32 const &  proto) -> Expected<sophus::RegionF32>

◆ fromProt< core::proto::RegionF64 >()

template<>
auto farm_ng::fromProt< core::proto::RegionF64 > ( core::proto::RegionF64 const &  proto) -> Expected<sophus::RegionF64>

◆ fromProt< core::proto::RegionI32 >()

template<>
auto farm_ng::fromProt< core::proto::RegionI32 > ( core::proto::RegionI32 const &  proto) -> Expected<sophus::RegionI>

◆ fromProt< core::proto::Rotation2F64 >()

template<>
auto farm_ng::fromProt< core::proto::Rotation2F64 > ( core::proto::Rotation2F64 const &  proto) -> Expected<sophus::Rotation2F64>

◆ fromProt< core::proto::Rotation3F64 >()

template<>
auto farm_ng::fromProt< core::proto::Rotation3F64 > ( core::proto::Rotation3F64 const &  proto) -> Expected<sophus::Rotation3F64>

◆ fromProt< core::proto::UnitVec3F64 >()

template<>
auto farm_ng::fromProt< core::proto::UnitVec3F64 > ( core::proto::UnitVec3F64 const &  proto) -> Expected<sophus::UnitVector3F64>

◆ fromProt< core::proto::Vec2F32 >()

template<>
auto farm_ng::fromProt< core::proto::Vec2F32 > ( core::proto::Vec2F32 const &  proto) -> Expected<Eigen::Vector2f>

◆ fromProt< core::proto::Vec2F64 >()

template<>
auto farm_ng::fromProt< core::proto::Vec2F64 > ( core::proto::Vec2F64 const &  proto) -> Expected<Eigen::Vector2d>

◆ fromProt< core::proto::Vec2I64 >()

template<>
auto farm_ng::fromProt< core::proto::Vec2I64 > ( core::proto::Vec2I64 const &  proto) -> Expected<Eigen::Vector2i>

◆ fromProt< core::proto::Vec3F32 >()

template<>
auto farm_ng::fromProt< core::proto::Vec3F32 > ( core::proto::Vec3F32 const &  proto) -> Expected<Eigen::Vector3f>

◆ fromProt< core::proto::Vec3F64 >()

template<>
auto farm_ng::fromProt< core::proto::Vec3F64 > ( core::proto::Vec3F64 const &  proto) -> Expected<Eigen::Vector3d>

◆ fromProt< core::proto::Vec3I64 >()

template<>
auto farm_ng::fromProt< core::proto::Vec3I64 > ( core::proto::Vec3I64 const &  proto) -> Expected<Eigen::Vector3i>

◆ getStamp()

core::proto::Timestamp const * farm_ng::getStamp ( core::proto::Event const &  event,
std::string const &  clock_name,
std::string const &  semantics 
) -> core::proto::Timestamp const *

◆ inchesFromMeters()

template<sophus::concepts::RealScalarType T>
T farm_ng::inchesFromMeters ( m)

Converts meters [m] to inches [in].

◆ intensityImageFromProto()

Expected< sophus::IntensityImage<> > farm_ng::intensityImageFromProto ( core::proto::DynImage const &  proto)

◆ logLine()

void farm_ng::logLine ( std::string const &  line)

◆ makeA()

auto farm_ng::makeA ( bool  a_error) -> Expected<A>

◆ makeAb()

auto farm_ng::makeAb ( bool  a_error,
bool  b_error 
) -> Expected<Ab>

◆ makeAbc()

auto farm_ng::makeAbc ( bool  a_error,
bool  b_error,
bool  c_error 
) -> Expected<Abc>

◆ makeAbcAtOnce()

auto farm_ng::makeAbcAtOnce ( bool  a_error,
bool  b_error,
bool  c_error 
) -> Expected<Abc>

◆ makeWriteStamp()

core::proto::Timestamp farm_ng::makeWriteStamp ( ) -> core::proto::Timestamp

◆ metersFromFeet()

template<sophus::concepts::RealScalarType T>
T farm_ng::metersFromFeet ( feet)

Converts feet [ft] to meters [m].

◆ metersFromInches()

template<sophus::concepts::RealScalarType T>
T farm_ng::metersFromInches ( inches)

Converts inches [in] to meters [m].

◆ operator<<()

std::ostream & farm_ng::operator<< ( std::ostream &  os,
Error const &  error 
) -> std::ostream &

◆ Overload()

template<class... Ts>
farm_ng::Overload ( Ts...  ) -> Overload< Ts... >

◆ printBacktrace()

void farm_ng::printBacktrace ( )

◆ radFromArcMinute()

template<sophus::concepts::RealScalarType T>
T farm_ng::radFromArcMinute ( arc_minute)

Converts arc minutes (60th of a degree) to radians.

◆ radFromDeg() [1/2]

template<sophus::concepts::RealScalarType T>
T farm_ng::radFromDeg ( deg)

Converts degrees to radians.

◆ radFromDeg() [2/2]

template<sophus::concepts::RealEigenDenseType TPoint>
auto farm_ng::radFromDeg ( TPoint const &  v_deg)

◆ readBytesFromBinaryFile()

Expected< std::string > farm_ng::readBytesFromBinaryFile ( std::filesystem::path const &  path) -> Expected< std::string >

◆ readJsonStringFromJsonFile()

Expected< std::string > farm_ng::readJsonStringFromJsonFile ( std::filesystem::path const &  path) -> Expected< std::string >

◆ readProtobufFromBinaryFile()

template<class TProtobufT >
Expected<TProtobufT> farm_ng::readProtobufFromBinaryFile ( std::filesystem::path const &  path)

◆ readProtobufFromJsonFile()

template<class TProtobufT >
Expected<TProtobufT> farm_ng::readProtobufFromJsonFile ( std::filesystem::path const &  path)

◆ setLogLineFunction()

void farm_ng::setLogLineFunction ( std::function< void(std::string const &)>  f)

◆ stringFromLogLevel()

std::string farm_ng::stringFromLogLevel ( LogLevel  level) -> std::string

◆ sum()

auto farm_ng::sum ( Expected< A maybe_left,
Expected< A maybe_right 
) -> Expected<A>

◆ TEST() [1/6]

farm_ng::TEST ( time_series  ,
empty   
)

◆ TEST() [2/6]

farm_ng::TEST ( time_series  ,
find_near_using_threshold   
)

◆ TEST() [3/6]

farm_ng::TEST ( time_series  ,
find_nearest   
)

◆ TEST() [4/6]

farm_ng::TEST ( time_series  ,
index   
)

◆ TEST() [5/6]

farm_ng::TEST ( time_series  ,
size   
)

◆ TEST() [6/6]

farm_ng::TEST ( time_series  ,
sorted_invariant   
)

◆ tokenize()

std::vector<std::string> farm_ng::tokenize ( std::string const &  str,
char  delimiter = ' ' 
)
inline

Splits string into N tokens (substrings) based on a delimiter.

◆ toProt() [1/2]

template<class TCpp >
auto farm_ng::toProt ( TCpp const &  cpp) -> typename ToProtoTrait< TCpp >::ProtoType

Function template to convert a proto object to a C++ object.

Example:

proto::Vec3F64 proto;
proto.set_x(1);
proto.set_y(2);
proto.set_z(3);
Eigen::Vector3d v = fromProt(proto);

Note: The return type is deduced from the argument type using the ToProtoTrait trait.

◆ toProt() [2/2]

template<>
core::proto::Uri farm_ng::toProt ( Uri const &  uri)

◆ toProt< Eigen::Hyperplane< double, 3 > >()

template<>
auto farm_ng::toProt< Eigen::Hyperplane< double, 3 > > ( Eigen::Hyperplane< double, 3 > const &  plane) -> core::proto::Hyperplane3F64

◆ toProt< Eigen::Matrix2d >()

template<>
auto farm_ng::toProt< Eigen::Matrix2d > ( Eigen::Matrix2d const &  v) -> core::proto::Mat2F64

◆ toProt< Eigen::Matrix2f >()

template<>
auto farm_ng::toProt< Eigen::Matrix2f > ( Eigen::Matrix2f const &  v) -> core::proto::Mat2F32

◆ toProt< Eigen::Matrix3d >()

template<>
auto farm_ng::toProt< Eigen::Matrix3d > ( Eigen::Matrix3d const &  v) -> core::proto::Mat3F64

◆ toProt< Eigen::Matrix3f >()

template<>
auto farm_ng::toProt< Eigen::Matrix3f > ( Eigen::Matrix3f const &  v) -> core::proto::Mat3F32

◆ toProt< Eigen::Vector2d >()

template<>
auto farm_ng::toProt< Eigen::Vector2d > ( Eigen::Vector2d const &  v) -> core::proto::Vec2F64

◆ toProt< Eigen::Vector2f >()

template<>
auto farm_ng::toProt< Eigen::Vector2f > ( Eigen::Vector2f const &  v) -> core::proto::Vec2F32

◆ toProt< Eigen::Vector2i >()

template<>
auto farm_ng::toProt< Eigen::Vector2i > ( Eigen::Vector2i const &  v) -> core::proto::Vec2I64

◆ toProt< Eigen::Vector3d >()

template<>
auto farm_ng::toProt< Eigen::Vector3d > ( Eigen::Vector3d const &  v) -> core::proto::Vec3F64

◆ toProt< Eigen::Vector3f >()

template<>
auto farm_ng::toProt< Eigen::Vector3f > ( Eigen::Vector3f const &  v) -> core::proto::Vec3F32

◆ toProt< Eigen::Vector3i >()

template<>
auto farm_ng::toProt< Eigen::Vector3i > ( Eigen::Vector3i const &  v) -> core::proto::Vec3I64

◆ toProt< sophus::AnyImage<> >()

template<>
auto farm_ng::toProt< sophus::AnyImage<> > ( sophus::AnyImage<> const &  image) -> core::proto::DynImage

◆ toProt< sophus::CameraModel >()

template<>
auto farm_ng::toProt< sophus::CameraModel > ( sophus::CameraModel const &  camera_model) -> core::proto::CameraModel

◆ toProt< sophus::ImageLayout >()

template<>
auto farm_ng::toProt< sophus::ImageLayout > ( sophus::ImageLayout const &  layout) -> core::proto::ImageLayout

◆ toProt< sophus::ImageSize >()

template<>
auto farm_ng::toProt< sophus::ImageSize > ( sophus::ImageSize const &  image_size) -> core::proto::ImageSize

◆ toProt< sophus::IntensityImage<> >()

template<>
auto farm_ng::toProt< sophus::IntensityImage<> > ( sophus::IntensityImage<> const &  image) -> core::proto::DynImage

◆ toProt< sophus::Isometry2F64 >()

template<>
auto farm_ng::toProt< sophus::Isometry2F64 > ( sophus::Isometry2F64 const &  pose) -> core::proto::Isometry2F64

◆ toProt< sophus::Isometry3F64 >()

template<>
auto farm_ng::toProt< sophus::Isometry3F64 > ( sophus::Isometry3F64 const &  pose) -> core::proto::Isometry3F64

◆ toProt< sophus::PixelFormat >()

template<>
auto farm_ng::toProt< sophus::PixelFormat > ( sophus::PixelFormat const &  layout) -> core::proto::PixelFormat

◆ toProt< sophus::QuaternionF64 >()

template<>
auto farm_ng::toProt< sophus::QuaternionF64 > ( sophus::QuaternionF64 const &  quat) -> core::proto::QuaternionF64

◆ toProt< sophus::Region2F64 >()

template<>
auto farm_ng::toProt< sophus::Region2F64 > ( sophus::Region2F64 const &  region) -> core::proto::Region2F64

◆ toProt< sophus::RegionF32 >()

template<>
auto farm_ng::toProt< sophus::RegionF32 > ( sophus::RegionF32 const &  region) -> core::proto::RegionF32

◆ toProt< sophus::RegionF64 >()

template<>
auto farm_ng::toProt< sophus::RegionF64 > ( sophus::RegionF64 const &  region) -> core::proto::RegionF64

◆ toProt< sophus::RegionI >()

template<>
auto farm_ng::toProt< sophus::RegionI > ( sophus::RegionI const &  region) -> core::proto::RegionI32

◆ toProt< sophus::Rotation2F64 >()

template<>
auto farm_ng::toProt< sophus::Rotation2F64 > ( sophus::Rotation2F64 const &  rotation) -> core::proto::Rotation2F64

◆ toProt< sophus::Rotation3F64 >()

template<>
auto farm_ng::toProt< sophus::Rotation3F64 > ( sophus::Rotation3F64 const &  rotation) -> core::proto::Rotation3F64

◆ toProt< sophus::UnitVector3F64 >()

template<>
auto farm_ng::toProt< sophus::UnitVector3F64 > ( sophus::UnitVector3F64 const &  uvec) -> core::proto::UnitVec3F64

◆ toProt< std::vector< sophus::CameraModel > >()

template<>
auto farm_ng::toProt< std::vector< sophus::CameraModel > > ( std::vector< sophus::CameraModel > const &  camera_models) -> core::proto::CameraModels

◆ visit_variant()

template<class Variant , typename... Alternatives>
decltype(auto) farm_ng::visit_variant ( Variant &&  variant,
Alternatives &&...  alternatives 
)

◆ writeProtobufToBinaryFile()

Expected< Success > farm_ng::writeProtobufToBinaryFile ( std::filesystem::path const &  path,
google::protobuf::Message const &  proto 
) -> Expected< Success >

◆ writeProtobufToJsonFile()

Expected< Success > farm_ng::writeProtobufToJsonFile ( std::filesystem::path const &  path,
google::protobuf::Message const &  proto 
) -> Expected< farm_ng::Success >

TODO: Add API docs.

Variable Documentation

◆ AlwaysFalse

template<class >
constexpr bool farm_ng::AlwaysFalse = false
inlineconstexpr

◆ Arithmetic

template<typename TT >
concept farm_ng::Arithmetic = std::is_arithmetic_v<TT>

◆ DerivedFrom

template<class TDerived , class TBase >
concept farm_ng::DerivedFrom = std::is_base_of_v<TBase, TDerived>

◆ EnumType

template<class TT >
concept farm_ng::EnumType = std::is_enum_v<TT>

◆ getLogLineFunction

auto farm_ng::getLogLineFunction

◆ has_type_v

template<class T , class Variant >
constexpr bool farm_ng::has_type_v = HasType<T, Variant>::value
constexpr

◆ SameAs

template<class TT , class TU >
concept farm_ng::SameAs = std::is_same_v<TT, TU>