system
. system
has input/output ports that could be connected with other systems. A system
block can be a diagram
or a leafsystem
. leafsystem
is the minimum build block and a diagram
is composed of multiple leafsystem
or diagram
.leafsystem
functions as basic components in robotics systems, like signals, sensors, controllers, planners, etc.diagram
to represent systems that internally have several connected systems that function as a whole. diagram
itself is a system and can be nested. The root diagram contains all the sub-systems and sub-diagrams.diagram
.context
is data of system states and parameters cached in a separate place. Each diagram
and each system
has its own context
. The context
and the diagram
are the only two information a simulator
needs to simulate. Given the context
, all methods called on a system
should be completely deterministic and repeatable (ref. Underactuated Robotics textbook).diagram->CreateDefaultContext()
which creates the context with default values for all the subsystems. Values in the context, such as the initial state and the initial time, can be independently set before the simulation begins.simulator
takes in the system diagram
together with its context
, to simulate by updating parameters such as integral continuous state derivatives, compute discrete state updates, allocates the various outputs of a system
, etc.diagram
that contains a unique leafsystem
namedMultibodyPlant
is considered as a robotic system. MultibodyPlant
internally uses rigid body tree algorithms to compute the robot kinematics, dynamics, jacobian, etc. MultibodyPlant
is a system
. So it has input/output ports that could be connected to other systems like controllers and visualizers.MultibodyPlant
for simulation.