cu29

Module prelude

Source

Modules§

  • This module defines the configuration of the copper runtime. The configuration is a directed graph where nodes are tasks and edges are connections between tasks. The configuration is serialized in the RON format. The configuration is used to generate the runtime code at compile time.
  • CopperList is the main data structure used by Copper to communicate between tasks. It is a queue that can be used to store preallocated messages between tasks in memory order.
  • CuRuntime is the heart of what copper is running on the robot. It is exposed to the user via the copper_runtime macro injecting it as a field in their application struct.
  • This module contains all the main definition of the traits you need to implement or interact with to create a Copper task.
  • Some basic internal monitoring tooling Copper uses to monitor itself and the tasks it is running.
  • cu29::simulation Module

Macros§

  • This macro is used to log a message with parameters. The first parameter is a string literal that represents the message to be logged. Only {} is supported as a placeholder for parameters. The rest of the parameters are the values to be logged. The parameters can be named or unnamed. Named parameters are specified as name = value. Unnamed parameters are specified as value.
  • Generates the CopperList content type from a config. gen_cumsgs!(“path/to/config.toml”) It will create a new type called CuMsgs you can pass to the log reader for decoding:

Structs§

  • This represents a connection between 2 tasks (nodes) in the configuration graph.
  • This is the configuration of a component (like a task config or a monitoring config):w It is a map of key-value pairs. It is given to the new method of the task implementation.
  • Just a simple struct to hold the various bits needed to run a Copper application.
  • Not implemented yet. This mask will be used to for example filter out necessary regions of a copper list between remote systems.
  • A simple allocator that counts the number of bytes allocated and deallocated.
  • Copper friendly wrapper for a fixed size array.
  • CuConfig is the programmatic representation of the configuration graph. It is a directed graph where nodes are tasks and edges are connections between tasks.
  • For Robot times, the underlying type is a u64 representing nanoseconds. It is always positive to simplify the reasoning on the user side.
  • A Specialized statistics object for CuDuration. It will also keep track of the jitter between the values.
  • Common copper Error type.
  • This structure represents a loop in the execution plan. It is used to represent a sequence of Execution units (loop or steps) that are executed multiple times. if loop_count is None, the loop is infinite.
  • This structure represents a step in the execution plan.
  • This structure maintains the entire memory needed by Copper for one loop for the inter tasks communication within a process. P or Payload is typically a Tuple of various types of messages that are exchanged between tasks. N is the maximum number of in flight Copper List the runtime can support.
  • This is the basic structure for a log entry in Copper.
  • CuMsg is the envelope holding the msg payload and the metadata between tasks.
  • CuMsgMetadata is a structure that contains metadata common to all CuMsgs.
  • This is the main structure that will be injected as a member of the Application struct. CT is the tuple of all the tasks in order of execution. CL is the type of the copper list, representing the input/output messages for all the tasks.
  • This is a placeholder task for a sink task for the simulations. It basically does nothing in place of a real driver so it won’t try to initialize any hardware.
  • This is a placeholder task for a source task for the simulations. It basically does nothing in place of a real driver so it won’t try to initialize any hardware.
  • Represents a time range.
  • A point-in-time wall-clock measurement.
  • Accumulative stat object that can give your some real time statistics.
  • The lifetime of this struct is the lifetime of the logger.
  • A do nothing monitor if no monitor is provided. This is basically defining the default behavior of Copper in case of error.
  • A node in the configuration graph. A node represents a Task in the system Graph.
  • Homebrewed Option<CuDuration> to avoid using 128bits just to represent an Option.
  • Represents a time range with possible undefined start or end or both.
  • A running Robot clock. The clock is a monotonic clock that starts at an arbitrary reference time. It is clone resilient, ie a clone will be the same clock, even when mocked.
  • A mock clock that can be controlled by the user.
  • A simple struct that counts the number of bytes allocated and deallocated in a scope.
  • A SectionHandle is a handle to a section in the datalogger. It allows to track the lifecycle of a section of the datalogger.
  • Each concurrent sublogger is tracked through a section header. They form a linked list of sections. The entry type is used to identify the type of data in the section.
  • This allows this crate to be used outside of Copper (ie. decoupling it from the unifiedlog.
  • Use this builder to create a new DataLogger.
  • This a convience wrapper around the UnifiedLoggerRead to implement the Read trait.
  • A read side of the datalogger.
  • A write side of the datalogger.

Enums§

  • Those are the possible states along the lifetime of a CopperList.
  • This structure represents a step in the execution plan.
  • This is the state that will be passed to the simulation support to hook into the lifecycle of the tasks.
  • The state of a task.
  • Copper tasks can be of 3 types:
  • Monitor decision to be taken when a task errored out.
  • This is the answer the simulator can give to control the simulation flow.
  • The time of validity of a message can be more than one time but can be a time range of Tovs. For example a sub scan for a lidar, a set of images etc… can have a range of validity.
  • Defines the types of what can be logged in the unified logger.
  • Holder of the read or write side of the datalogger.

Constants§

Statics§

Traits§

  • A trait to provide a clock to the runtime.
  • A CopperListTuple needs to be encodable, decodable and fixed size in memory.
  • Trait to implement a monitoring task.
  • A Sink Task is a task that only consumes messages. For example drivers for actuators are Sink Tasks.
  • A Src Task is a task that only produces messages. For example drivers for sensors are Src Tasks. They are in push mode from the runtime. To set the frequency of the pulls and align them to any hw, see the runtime configuration. Note: A source has the priviledge to have a clock passed to it vs a frozen clock.
  • This is the most generic Task of copper. It is a “transform” task deriving an output from an input.
  • The internal state of a task needs to be serializable so the framework can take a snapshop of the task graph.
  • Defines a basic write, append only stream trait to be able to log or send serializable objects.

Functions§

Type Aliases§

Attribute Macros§

  • Adds #[copper_runtime(config = “path”, sim_mode = false/true)] to your application struct to generate the runtime. if sim_mode is ommited, it is set to false. This will add a “runtime” field to your struct and implement the “new” and “run” methods.