Pamoja.Sim
0.1.18
dotnet add package Pamoja.Sim --version 0.1.18
NuGet\Install-Package Pamoja.Sim -Version 0.1.18
<PackageReference Include="Pamoja.Sim" Version="0.1.18" />
<PackageVersion Include="Pamoja.Sim" Version="0.1.18" />
<PackageReference Include="Pamoja.Sim" />
paket add Pamoja.Sim --version 0.1.18
#r "nuget: Pamoja.Sim, 0.1.18"
#:package Pamoja.Sim@0.1.18
#addin nuget:?package=Pamoja.Sim&version=0.1.18
#tool nuget:?package=Pamoja.Sim&version=0.1.18
Pamoja.Sim
Noisy and replay sensors, a recording actuator, and a simulated robot that dead-reckons its pose. One capability of pamoja, one memory-safe Rust core with bindings for TypeScript, Python, and C#.
Install
dotnet add package Pamoja.Sim
using Pamoja.Sim;
This pulls in Pamoja.Native, the compiled engine, and Pamoja.Codec. dotnet add package Pamoja is the whole framework in one package.
Example
The guide project's example, spliced here as it ran in CI.
From bindings/dotnet/samples/Pamoja.Guides/SimGuide.cs:
// The clear distance ahead, in meters, taken from an earlier survey run. A replay
// hands it back one reading at a time, so the loop below sees the same input on
// every run: the same rover code, driven by a recording rather than a range finder.
float[] capture = [4.0f, 3.0f, 1.5f, 0.5f];
using var ahead = new Replay(capture);
using var throttle = new RecordingActuator();
using var rover = new SimulatedRobot(0.5f); // each command advances half a second
List<float> seen = [];
for (int step = 0; step < capture.Length; step++)
{
float reading = await ahead.ReadAsync();
seen.Add(reading);
// Drive on while there is room ahead, otherwise stop and turn on the spot.
bool clear = reading > 1.0f;
float vx = clear ? 1.0f : 0.0f;
float omega = clear ? 0.0f : 1.0f;
await throttle.ApplyAsync(vx);
await rover.ApplyAsync(new Twist(vx, Omega: omega));
Console.WriteLine($"{reading} m ahead, so drive at {vx} and turn at {omega}");
}
// The recording actuator kept every command, which is how a test says what the
// control loop decided rather than only what it ended up doing.
Console.WriteLine($"commands {string.Join(", ", throttle.Commands)}");
// Three half-second commands at 1 m/s reach 1.5 m along x. The last one turns on
// the spot at 1 rad/s for half a second, which moves the rover nowhere.
Pose pose = rover.Pose;
Console.WriteLine(
$"pose x {pose.X:F1} m, y {pose.Y:F1} m, heading {pose.Theta:F1} rad");
The same capability in every language
| Language | Package | Reference |
|---|---|---|
| Rust | pamoja-sim |
reference, docs.rs, install |
| TypeScript | @pamoja/sim |
reference, install |
| Python | pamoja-sim |
reference, install |
| C# | Pamoja.Sim |
reference, install |
Documentation
Pamoja.Simreference, every type in this namespace.- The Simulators guide, with the same example in Rust, TypeScript, and Python.
- Every capability, and the install page.
License
MIT
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net8.0 is compatible. net8.0-android was computed. net8.0-browser was computed. net8.0-ios was computed. net8.0-maccatalyst was computed. net8.0-macos was computed. net8.0-tvos was computed. net8.0-windows was computed. net9.0 was computed. net9.0-android was computed. net9.0-browser was computed. net9.0-ios was computed. net9.0-maccatalyst was computed. net9.0-macos was computed. net9.0-tvos was computed. net9.0-windows was computed. net10.0 was computed. net10.0-android was computed. net10.0-browser was computed. net10.0-ios was computed. net10.0-maccatalyst was computed. net10.0-macos was computed. net10.0-tvos was computed. net10.0-windows was computed. |
-
net8.0
- Pamoja.Codec (>= 0.1.18)
- Pamoja.Native (>= 0.1.18)
NuGet packages (2)
Showing the top 2 NuGet packages that depend on Pamoja.Sim:
| Package | Downloads |
|---|---|
|
Pamoja.Transports
Transports and testing: Reaching the network when no single link always works, and testing all of it with nothing plugged in. |
|
|
Pamoja
The whole pamoja framework in one package: every capability of one memory-safe Rust core, behind an idiomatic C# facade, for IoT, robotics, and drones. |
GitHub repositories
This package is not used by any popular GitHub repositories.