farm-ng / farm-ng-core Goto Github PK
View Code? Open in Web Editor NEWC++ and Python library for farm-ng logging format
Home Page: https://farm-ng.github.io/farm-ng-core/
License: Apache License 2.0
C++ and Python library for farm-ng logging format
Home Page: https://farm-ng.github.io/farm-ng-core/
License: Apache License 2.0
Not sure why I have this file in Pangolin - it isn't used and I think you can omit it.
Originally posted by @stevenlovegrove in #52 (comment)
Currently, any format error such as FMT("arg1: {}, arg2:P{}", 5);
will (most likely) crash the program. This is in most cases not desired. It will turn a minor documentation error into program abortion.
Proposal:
Alternative:
@Hackerman342 @ethanrublee i have a proposal here to improve the current api and make it more user friend.
Random access here might be error prone, we could make it via dictionary and use the key as the semantics of the uri.
uris: Dict[str, uri_pb2.Uri] = reader.uris()
uri: uri_pb2.Uri = uris["oak0/video"]
Originally posted by @edgarriba in farm-ng/farm-ng-amiga#31 (comment)
As a reader of logs, i'd like to depend on event.stamps[-1]
always being the monotonic stamp, as this makes it easy/cheap to sort the events by write order without searching for the stamp by clock name.
Known missing tests:
utils/erase_test.cpp
utils/stopwatch_test.cpp
utils/tokenize_test.cpp
utils/thread_pool_test.cpp
utils/time_test.cpp
logging
for additional missing testsutils
for additional missing testspipeline
for additional missing testsThere's been some questions on the team about what our C++ conventions are around the use of the PIMPL pattern, which seems like a pattern we could offer guidance about in our C++ style guide.
To get the conversation started, here are a few statements:
Shared
that is useful for enforcing that a shared pointer is not null. By convention the factories in the pattern above return this Shared
type.And a few suggestions:
Unique
) rather than Shared
for the reasons outlined here.not_null
for a battle-tested implementation of not-null semantics that would apply to all raw and smart pointer types.template<typename T>
using Unique = gsl::not_null<std::unique_ptr<T>>;
@Hackerman342 @ethanrublee an improvement here is to merge `get_event` and `read_message` since we use all the time together. For testing and some internal use cases is good but better coupled for a more user friendly api
def read_uri_message(self, uri: uri_pb2.Uri, event_id: int) -> Any:
# get the event and offset
event: event_pb2.Event
offset: int
event, offset = self.get_event(uri, current_event)
# seek and parse the message
return self.read_message(event, offset)
maybe read_message
should be renamed to parse_message
and read_message
recive the uri and event_id
Originally posted by @edgarriba in farm-ng/farm-ng-amiga#31 (comment)
review / design behavior of ASSERT macros when compiled in RELEASE mode
options
There is no plan to chnge behavior for ASSERTs in DEBUG and RelWithDebInfo modes.
As future feature this could be part of the EventWriter
that takes as input the file base name and max length and internally handle the spliting. Same for the reader, to handle multiple files from a sequence as one. Actually, with this proposal, it will save several of files which can be a bit difficult to track in the gallery/playback app. Maybe we need to append to the parent files messages pointing to the next file ?
Originally posted by @edgarriba in https://github.com/farm-ng/workspace/issues/1084#issuecomment-1373580359
Add a small utility in the Python API that the allows to filter the events index by types
def event_has_message(event: event_pb2.Event, msg_type: Any) -> bool:
"""Check if event has a message of type msg_type.
Args:
event: event_pb2.Event
msg_type: protobuf message type
Returns:
bool: True if event has a message of type msg_type
"""
return event.uri.query.split("&")[0].split(".")[-1] == msg_type.__name__
Currently (v1.0.0-dev
) the pip
build for macos-latest
fails. This is relevant because we want to be able to build this package so macOS users can pip install farm-ng-core
again.
I think we should scrap these operator+ methods. I haven't been using them as I think they're a bit confusing.
Originally posted by @stevenlovegrove in #52 (comment)
Initial PR merging sophus2 and farm-ng-core in: #105
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.