diff --git a/.nojekyll b/.nojekyll new file mode 100644 index 00000000..e69de29b diff --git a/AgentInterface_8cpp.html b/AgentInterface_8cpp.html new file mode 100644 index 00000000..764b02cf --- /dev/null +++ b/AgentInterface_8cpp.html @@ -0,0 +1,141 @@ + + +
+ + + + +
+ vulp
+ 2.4.0
+
+ |
+
Go to the source code of this file.
++Namespaces | |
vulp | |
vulp.spine | |
Inter-process communication protocol with the spine. | |
+Functions | |
void | vulp.spine::allocate_file (int file_descriptor, int bytes) |
Allocate file with some error handling. More... | |
+ vulp
+ 2.4.0
+
+ |
+
+ vulp
+ 2.4.0
+
+ |
+
#include <fcntl.h>
#include <spdlog/spdlog.h>
#include <sys/mman.h>
#include <sys/stat.h>
#include <cstring>
#include <string>
#include "vulp/spine/Request.h"
Go to the source code of this file.
++Classes | |
class | vulp.spine::AgentInterface |
Memory map to shared memory. More... | |
+Namespaces | |
vulp | |
vulp.spine | |
Inter-process communication protocol with the spine. | |
+ vulp
+ 2.4.0
+
+ |
+
+ vulp
+ 2.4.0
+
+ |
+
#include <string>
Go to the source code of this file.
++Classes | |
struct | vulp::actuation::BulletContactData |
Contact information for a single link. More... | |
+Namespaces | |
vulp | |
vulp::actuation | |
Send actions to actuators or simulators. | |
+ vulp
+ 2.4.0
+
+ |
+
+ vulp
+ 2.4.0
+
+ |
+
#include <string>
#include "RobotSimulator/b3RobotSimulatorClientAPI.h"
#include "vulp/actuation/ImuData.h"
Go to the source code of this file.
++Classes | |
struct | vulp::actuation::BulletImuData |
+Namespaces | |
vulp | |
vulp::actuation | |
Send actions to actuators or simulators. | |
+ vulp
+ 2.4.0
+
+ |
+
+ vulp
+ 2.4.0
+
+ |
+
#include "vulp/actuation/BulletInterface.h"
#include <algorithm>
#include <memory>
#include <string>
#include "tools/cpp/runfiles/runfiles.h"
#include "vulp/actuation/bullet_utils.h"
Go to the source code of this file.
++Namespaces | |
vulp | |
vulp::actuation | |
Send actions to actuators or simulators. | |
+Functions | |
std::string | vulp::actuation::find_plane_urdf (const std::string argv0) |
+ vulp
+ 2.4.0
+
+ |
+
+ vulp
+ 2.4.0
+
+ |
+
#include <palimpsest/Dictionary.h>
#include <spdlog/spdlog.h>
#include <limits>
#include <map>
#include <string>
#include <vector>
#include "RobotSimulator/b3RobotSimulatorClientAPI.h"
#include "vulp/actuation/BulletContactData.h"
#include "vulp/actuation/BulletImuData.h"
#include "vulp/actuation/BulletJointProperties.h"
#include "vulp/actuation/Interface.h"
#include "vulp/actuation/moteus/Output.h"
#include "vulp/actuation/moteus/ServoReply.h"
Go to the source code of this file.
++Classes | |
class | vulp::actuation::BulletInterface |
Actuation interface for the Bullet simulator. More... | |
struct | vulp::actuation::BulletInterface::Parameters |
Interface parameters. More... | |
+Namespaces | |
vulp | |
vulp::actuation | |
Send actions to actuators or simulators. | |
+ vulp
+ 2.4.0
+
+ |
+
+ vulp
+ 2.4.0
+
+ |
+
#include <string>
#include "RobotSimulator/b3RobotSimulatorClientAPI.h"
Go to the source code of this file.
++Classes | |
struct | vulp::actuation::BulletJointProperties |
Properties for robot joints in the Bullet simulation. More... | |
+Namespaces | |
vulp | |
vulp::actuation | |
Send actions to actuators or simulators. | |
+ vulp
+ 2.4.0
+
+ |
+
+ vulp
+ 2.4.0
+
+ |
+
#include <palimpsest/Dictionary.h>
Go to the source code of this file.
++Classes | |
class | vulp::control::Controller |
Base class for controllers. More... | |
+Namespaces | |
vulp | |
vulp::control | |
WIP: Process higher-level actions down to joint commands. | |
+ vulp
+ 2.4.0
+
+ |
+
+ vulp
+ 2.4.0
+
+ |
+
#include "vulp/observation/sources/CpuTemperature.h"
Go to the source code of this file.
++Namespaces | |
vulp | |
vulp::observation | |
State observation. | |
vulp::observation::sources | |
+ vulp
+ 2.4.0
+
+ |
+
+ vulp
+ 2.4.0
+
+ |
+
Go to the source code of this file.
++Classes | |
class | vulp::observation::sources::CpuTemperature |
Source for CPU temperature readings. More... | |
+Namespaces | |
vulp | |
vulp::observation | |
State observation. | |
vulp::observation::sources | |
+Variables | |
constexpr unsigned | vulp::observation::sources::kCpuTemperatureBufferSize = 12 |
Characters required to read the temperature in [mC] from the kernel. More... | |
+ vulp
+ 2.4.0
+
+ |
+
+ vulp
+ 2.4.0
+
+ |
+
#include <palimpsest/Dictionary.h>
#include <limits>
#include <string>
#include <unordered_map>
#include <vector>
#include "vulp/exceptions/TypeError.h"
#include "vulp/observation/Observer.h"
Go to the source code of this file.
++Classes | |
class | vulp::observation::HistoryObserver< T > |
Report high-frequency history vectors to lower-frequency agents. More... | |
+Namespaces | |
vulp | |
vulp::observation | |
State observation. | |
+ vulp
+ 2.4.0
+
+ |
+
+ vulp
+ 2.4.0
+
+ |
+
#include <Eigen/Core>
#include <Eigen/Geometry>
Go to the source code of this file.
++Classes | |
struct | vulp::actuation::ImuData |
Data filtered from an onboard IMU such as the pi3hat's. More... | |
+Namespaces | |
vulp | |
vulp::actuation | |
Send actions to actuators or simulators. | |
+ vulp
+ 2.4.0
+
+ |
+
+ vulp
+ 2.4.0
+
+ |
+
#include "vulp/actuation/Interface.h"
#include <palimpsest/Dictionary.h>
#include <limits>
#include <map>
#include <string>
#include <vector>
#include "vulp/actuation/default_action.h"
#include "vulp/actuation/moteus/Mode.h"
#include "vulp/actuation/moteus/ServoCommand.h"
Go to the source code of this file.
++Namespaces | |
vulp | |
vulp::actuation | |
Send actions to actuators or simulators. | |
+ vulp
+ 2.4.0
+
+ |
+
+ vulp
+ 2.4.0
+
+ |
+
#include <palimpsest/Dictionary.h>
#include <map>
#include <string>
#include <vector>
#include "vulp/actuation/ImuData.h"
#include "vulp/actuation/ServoLayout.h"
#include "vulp/actuation/moteus/Data.h"
#include "vulp/actuation/moteus/Output.h"
#include "vulp/actuation/resolution.h"
Go to the source code of this file.
++Classes | |
class | vulp::actuation::Interface |
Base class for actuation interfaces. More... | |
+Namespaces | |
vulp | |
vulp::actuation | |
Send actions to actuators or simulators. | |
+ vulp
+ 2.4.0
+
+ |
+
+ vulp
+ 2.4.0
+
+ |
+
#include "vulp/observation/sources/Joystick.h"
Go to the source code of this file.
++Namespaces | |
vulp | |
vulp::observation | |
State observation. | |
vulp::observation::sources | |
+ vulp
+ 2.4.0
+
+ |
+
+ vulp
+ 2.4.0
+
+ |
+
#include <fcntl.h>
#include <linux/joystick.h>
#include <stdio.h>
#include <unistd.h>
#include <string>
#include "vulp/observation/Source.h"
Go to the source code of this file.
++Classes | |
class | vulp::observation::sources::Joystick |
Source for a joystick controller. More... | |
+Namespaces | |
vulp | |
vulp::observation | |
State observation. | |
vulp::observation::sources | |
+Variables | |
constexpr double | vulp::observation::sources::kJoystickDeadband = 0.1 |
Deadband between 0.0 and 1.0. More... | |
+ vulp
+ 2.4.0
+
+ |
+
+ vulp
+ 2.4.0
+
+ |
+
#include "vulp/observation/sources/Keyboard.h"
Go to the source code of this file.
++Namespaces | |
vulp | |
vulp::observation | |
State observation. | |
vulp::observation::sources | |
+ vulp
+ 2.4.0
+
+ |
+
+ vulp
+ 2.4.0
+
+ |
+
#include <fcntl.h>
#include <stdio.h>
#include <string.h>
#include <sys/ioctl.h>
#include <sys/select.h>
#include <termios.h>
#include <unistd.h>
#include <chrono>
#include <iostream>
#include <string>
#include "vulp/observation/Source.h"
Go to the source code of this file.
++Classes | |
class | vulp::observation::sources::Keyboard |
Source for reading Keyboard inputs. More... | |
+Namespaces | |
vulp | |
vulp::observation | |
State observation. | |
vulp::observation::sources | |
+Functions | |
bool | is_lowercase_alpha (unsigned char c) |
bool | is_uppercase_alpha (unsigned char c) |
bool | is_printable_ascii (unsigned char c) |
+Variables | |
constexpr ssize_t | kMaxKeyBytes = 3 |
Maximum number of bytes to encode a key. More... | |
constexpr int64_t | kPollingIntervalMS = 50 |
Polling interval in milliseconds. More... | |
constexpr unsigned char | UP_BYTES [] = {0x1B, 0x5B, 0x41} |
constexpr unsigned char | DOWN_BYTES [] = {0x1B, 0x5B, 0x42} |
constexpr unsigned char | RIGHT_BYTES [] = {0x1B, 0x5B, 0x43} |
constexpr unsigned char | LEFT_BYTES [] = {0x1B, 0x5B, 0x44} |
+
|
+ +inline | +
Definition at line 36 of file Keyboard.h.
+ +
+
|
+ +inline | +
Definition at line 42 of file Keyboard.h.
+ +
+
|
+ +inline | +
Definition at line 39 of file Keyboard.h.
+ +
+
|
+ +constexpr | +
Definition at line 32 of file Keyboard.h.
+ +
+
|
+ +constexpr | +
Maximum number of bytes to encode a key.
+ +Definition at line 25 of file Keyboard.h.
+ +
+
|
+ +constexpr | +
Polling interval in milliseconds.
+ +Definition at line 28 of file Keyboard.h.
+ +
+
|
+ +constexpr | +
Definition at line 34 of file Keyboard.h.
+ +
+
|
+ +constexpr | +
Definition at line 33 of file Keyboard.h.
+ +
+
|
+ +constexpr | +
Definition at line 31 of file Keyboard.h.
+ +
+ vulp
+ 2.4.0
+
+ |
+
+ vulp
+ 2.4.0
+
+ |
+
#include "vulp/actuation/MockInterface.h"
Go to the source code of this file.
++Namespaces | |
vulp | |
vulp::actuation | |
Send actions to actuators or simulators. | |
+ vulp
+ 2.4.0
+
+ |
+
+ vulp
+ 2.4.0
+
+ |
+
#include <palimpsest/Dictionary.h>
#include <spdlog/spdlog.h>
#include <Eigen/Geometry>
#include <limits>
#include <map>
#include <string>
#include "vulp/actuation/ImuData.h"
#include "vulp/actuation/Interface.h"
#include "vulp/actuation/moteus/protocol.h"
Go to the source code of this file.
++Classes | |
class | vulp::actuation::MockInterface |
+Namespaces | |
vulp | |
vulp::actuation | |
Send actions to actuators or simulators. | |
+ vulp
+ 2.4.0
+
+ |
+
+ vulp
+ 2.4.0
+
+ |
+
#include "vulp/observation/ObserverPipeline.h"
#include <palimpsest/exceptions/KeyError.h>
#include "vulp/exceptions/ObserverError.h"
Go to the source code of this file.
++Namespaces | |
vulp | |
vulp::observation | |
State observation. | |
+ vulp
+ 2.4.0
+
+ |
+
+ vulp
+ 2.4.0
+
+ |
+
#include <memory>
#include <vector>
#include "vulp/observation/Observer.h"
#include "vulp/observation/Source.h"
Go to the source code of this file.
++Classes | |
class | vulp::observation::ObserverPipeline |
Observer pipeline. More... | |
+Namespaces | |
vulp | |
vulp::observation | |
State observation. | |
+ vulp
+ 2.4.0
+
+ |
+
+ vulp
+ 2.4.0
+
+ |
+
#include <palimpsest/Dictionary.h>
#include <string>
Go to the source code of this file.
++Classes | |
class | vulp::observation::Observer |
Base class for observers. More... | |
+Namespaces | |
vulp | |
vulp::observation | |
State observation. | |
+ vulp
+ 2.4.0
+
+ |
+
+ vulp
+ 2.4.0
+
+ |
+
#include "vulp/actuation/Pi3HatInterface.h"
Go to the source code of this file.
++Namespaces | |
vulp | |
vulp::actuation | |
Send actions to actuators or simulators. | |
+ vulp
+ 2.4.0
+
+ |
+
+ vulp
+ 2.4.0
+
+ |
+
#include <mjbots/pi3hat/pi3hat.h>
#include <pthread.h>
#include <spdlog/spdlog.h>
#include <Eigen/Geometry>
#include <condition_variable>
#include <functional>
#include <map>
#include <memory>
#include <mutex>
#include <stdexcept>
#include <string>
#include <thread>
#include <utility>
#include <vector>
#include "vulp/actuation/ImuData.h"
#include "vulp/actuation/Interface.h"
#include "vulp/actuation/moteus/protocol.h"
#include "vulp/utils/realtime.h"
Go to the source code of this file.
++Classes | |
class | vulp::actuation::Pi3HatInterface |
Interface to moteus controllers. More... | |
+Namespaces | |
vulp | |
vulp::actuation | |
Send actions to actuators or simulators. | |
+Typedefs | |
using | vulp::actuation::Pi3Hat = ::mjbots::pi3hat::Pi3Hat |
+ vulp
+ 2.4.0
+
+ |
+
+ vulp
+ 2.4.0
+
+ |
+
+ vulp
+ 2.4.0
+
+ |
+
#include <cstdint>
Go to the source code of this file.
++Namespaces | |
vulp | |
vulp.spine | |
Inter-process communication protocol with the spine. | |
+Enumerations | |
enum class | vulp.spine::Request : uint32_t { + vulp.spine::kNone = 0 +, vulp.spine::kObservation = 1 +, vulp.spine::kAction = 2 +, vulp.spine::kStart = 3 +, + vulp.spine::kStop = 4 +, vulp.spine::kError = 5 + + } |
+ vulp
+ 2.4.0
+
+ |
+
+ vulp
+ 2.4.0
+
+ |
+
#include <map>
#include <string>
Go to the source code of this file.
++Classes | |
class | vulp::actuation::ServoLayout |
Map between servos, their busses and the joints they actuate. More... | |
+Namespaces | |
vulp | |
vulp::actuation | |
Send actions to actuators or simulators. | |
+ vulp
+ 2.4.0
+
+ |
+
+ vulp
+ 2.4.0
+
+ |
+
#include <palimpsest/Dictionary.h>
#include <string>
Go to the source code of this file.
++Classes | |
class | vulp::observation::Source |
Base class for sources. More... | |
+Namespaces | |
vulp | |
vulp::observation | |
State observation. | |
+ vulp
+ 2.4.0
+
+ |
+
+ vulp
+ 2.4.0
+
+ |
+
#include "vulp/spine/Spine.h"
#include <mpacklog/Logger.h>
#include <limits>
#include "vulp/exceptions/ObserverError.h"
Go to the source code of this file.
++Namespaces | |
vulp | |
vulp.spine | |
Inter-process communication protocol with the spine. | |
+ vulp
+ 2.4.0
+
+ |
+
+ vulp
+ 2.4.0
+
+ |
+
#include <mpacklog/Logger.h>
#include <algorithm>
#include <future>
#include <map>
#include <memory>
#include <string>
#include <vector>
#include "vulp/actuation/Interface.h"
#include "vulp/observation/ObserverPipeline.h"
#include "vulp/observation/observe_servos.h"
#include "vulp/observation/observe_time.h"
#include "vulp/spine/AgentInterface.h"
#include "vulp/spine/StateMachine.h"
#include "vulp/utils/SynchronousClock.h"
#include "vulp/utils/handle_interrupts.h"
#include "vulp/utils/realtime.h"
Go to the source code of this file.
++Classes | |
class | vulp.spine::Spine |
Loop transmitting actions to the actuation and observations to the agent. More... | |
struct | vulp.spine::Spine::Parameters |
Spine parameters. More... | |
+Namespaces | |
vulp | |
vulp.spine | |
Inter-process communication protocol with the spine. | |
+Variables | |
constexpr size_t | vulp.spine::kMebibytes = 1 << 20 |
+ vulp
+ 2.4.0
+
+ |
+
+ vulp
+ 2.4.0
+
+ |
+
#include "vulp/spine/StateMachine.h"
#include <spdlog/spdlog.h>
#include "vulp/utils/handle_interrupts.h"
Go to the source code of this file.
++Namespaces | |
vulp | |
vulp.spine | |
Inter-process communication protocol with the spine. | |
+ vulp
+ 2.4.0
+
+ |
+
+ vulp
+ 2.4.0
+
+ |
+
#include "vulp/spine/AgentInterface.h"
Go to the source code of this file.
++Classes | |
class | vulp.spine::StateMachine |
Spine state machine. More... | |
+Namespaces | |
vulp | |
vulp.spine | |
Inter-process communication protocol with the spine. | |
+Enumerations | |
enum class | vulp.spine::State : uint32_t { + vulp.spine::kSendStops = 0 +, vulp.spine::kReset = 1 +, vulp.spine::kIdle = 2 +, vulp.spine::kObserve = 3 +, + vulp.spine::kAct = 4 +, vulp.spine::kShutdown = 5 +, vulp.spine::kOver = 6 + + } |
States of the state machine. More... | |
enum class | vulp.spine::Event : uint32_t { vulp.spine::kCycleBeginning = 0 +, vulp.spine::kCycleEnd = 1 +, vulp.spine::kInterrupt = 2 + } |
Events that may trigger transitions between states. More... | |
+Functions | |
constexpr const char * | vulp.spine::state_name (const State &state) noexcept |
Name of a state. More... | |
+Variables | |
constexpr unsigned | vulp.spine::kNbStopCycles = 5 |
When sending stop cycles, send at least that many. More... | |
+ vulp
+ 2.4.0
+
+ |
+
+ vulp
+ 2.4.0
+
+ |
+
Go to the source code of this file.
++Namespaces | |
vulp | |
vulp.utils | |
Utility functions. | |
+ vulp
+ 2.4.0
+
+ |
+
+ vulp
+ 2.4.0
+
+ |
+
#include <spdlog/spdlog.h>
#include <chrono>
Go to the source code of this file.
++Classes | |
class | vulp.utils::SynchronousClock |
Synchronous (blocking) clock. More... | |
+Namespaces | |
vulp | |
vulp.utils | |
Utility functions. | |
+ vulp
+ 2.4.0
+
+ |
+
+ vulp
+ 2.4.0
+
+ |
+
▼Nvulp | |
▼Nactuation | Send actions to actuators or simulators |
CBulletContactData | Contact information for a single link |
CBulletImuData | |
▼CBulletInterface | Actuation interface for the Bullet simulator |
CParameters | Interface parameters |
CBulletJointProperties | Properties for robot joints in the Bullet simulation |
CImuData | Data filtered from an onboard IMU such as the pi3hat's |
CInterface | Base class for actuation interfaces |
CMockInterface | |
CPi3HatInterface | Interface to moteus controllers |
CServoLayout | Map between servos, their busses and the joints they actuate |
▼Ncontrol | WIP: Process higher-level actions down to joint commands |
CController | Base class for controllers |
▼Nobservation | State observation |
▼Nsources | |
CCpuTemperature | Source for CPU temperature readings |
CJoystick | Source for a joystick controller |
CKeyboard | Source for reading Keyboard inputs |
CHistoryObserver | Report high-frequency history vectors to lower-frequency agents |
CObserver | Base class for observers |
CObserverPipeline | Observer pipeline |
CSource | Base class for sources |
▼Nspine | Inter-process communication protocol with the spine |
▼Nexceptions | |
CVulpException | Base class for exceptions raised by Vulp |
CPerformanceIssue | Exception raised when a performance issue is detected |
CSpineError | Exception raised when the spine sets an error flag in the request field of the shared memory map |
▼Nrequest | |
CRequest | Flag set by the agent to request an operation from the spine |
▼Nspine_interface | |
CSpineInterface | Interface to interact with a spine from a Python agent |
CAgentInterface | Memory map to shared memory |
▼CSpine | Loop transmitting actions to the actuation and observations to the agent |
CParameters | Spine parameters |
CStateMachine | Spine state machine |
▼Nutils | Utility functions |
CSynchronousClock | Synchronous (blocking) clock |
+ vulp
+ 2.4.0
+
+ |
+
#include <spdlog/spdlog.h>
#include <string>
#include "RobotSimulator/b3RobotSimulatorClientAPI.h"
#include "vulp/actuation/BulletImuData.h"
Go to the source code of this file.
++Namespaces | |
vulp | |
vulp::actuation | |
Send actions to actuators or simulators. | |
+Functions | |
btQuaternion | vulp::actuation::bullet_from_eigen (const Eigen::Quaterniond &quat) |
Convert an Eigen quaternion to a Bullet one. More... | |
btVector3 | vulp::actuation::bullet_from_eigen (const Eigen::Vector3d &v) |
Convert an Eigen vector to a Bullet one. More... | |
Eigen::Quaterniond | vulp::actuation::eigen_from_bullet (const btQuaternion &quat) |
Convert a Bullet quaternion to an Eigen one. More... | |
Eigen::Vector3d | vulp::actuation::eigen_from_bullet (const btVector3 &v) |
Convert a Bullet vector to an Eigen one. More... | |
int | vulp::actuation::find_link_index (b3RobotSimulatorClientAPI &bullet, int robot, const std::string &link_name) noexcept |
Find the index of a link. More... | |
void | vulp::actuation::read_imu_data (BulletImuData &imu_data, b3RobotSimulatorClientAPI &bullet, int robot, const int imu_link_index, double dt) |
Compute IMU readings from the IMU link state. More... | |
+ vulp
+ 2.4.0
+
+ |
+
+ vulp
+ 2.4.0
+
+ |
+
+ vulp
+ 2.4.0
+
+ |
+
This is the complete list of members for vulp::actuation::BulletInterface, including all inherited members.
+
+ vulp
+ 2.4.0
+
+ |
+
Actuation interface for the Bullet simulator. + More...
+ +#include <BulletInterface.h>
+Classes | |
struct | Parameters |
Interface parameters. More... | |
+Public Member Functions | |
BulletInterface (const ServoLayout &layout, const Parameters ¶ms) | |
Initialize interface. More... | |
~BulletInterface () | |
Disconnect interface. More... | |
void | reset (const Dictionary &config) override |
Reset interface. More... | |
void | cycle (const moteus::Data &data, std::function< void(const moteus::Output &)> callback) final |
Spin a new communication cycle. More... | |
void | observe (Dictionary &observation) const override |
Write actuation-interface observations to dictionary. More... | |
Eigen::Matrix4d | transform_base_to_world () const noexcept |
Get the groundtruth floating base transform. More... | |
Eigen::Vector3d | linear_velocity_base_to_world_in_world () const noexcept |
Get the groundtruth floating base linear velocity. More... | |
Eigen::Vector3d | angular_velocity_base_in_base () const noexcept |
Get the groundtruth floating base angular velocity. More... | |
void | reset_contact_data () |
Reset contact data. More... | |
void | reset_joint_angles () |
Reset joint angles to zero. More... | |
void | reset_joint_properties () |
Reset joint properties to defaults. More... | |
void | reset_base_state (const Eigen::Vector3d &position_base_in_world, const Eigen::Quaterniond &orientation_base_in_world, const Eigen::Vector3d &linear_velocity_base_to_world_in_world, const Eigen::Vector3d &angular_velocity_base_in_base) |
Reset the pose and velocity of the floating base in the world frame. More... | |
const std::map< std::string, BulletJointProperties > & | joint_properties () |
Joint properties (accessor used for testing) More... | |
const std::map< std::string, moteus::ServoReply > & | servo_reply () |
Internal map of servo replies (accessor used for testing) More... | |
double | compute_joint_torque (const std::string &joint_name, const double feedforward_torque, const double target_position, const double target_velocity, const double kp_scale, const double kd_scale, const double maximum_torque) |
Reproduce the moteus position controller in Bullet. More... | |
![]() | |
Interface (const ServoLayout &servo_layout) | |
Initialize actuation interface for a given servo layout. More... | |
virtual | ~Interface ()=default |
Virtual destructor so that derived destructors are called properly. More... | |
const ServoLayout & | servo_layout () const noexcept |
Get servo layout. More... | |
const std::map< int, int > & | servo_bus_map () const noexcept |
Map from servo ID to the CAN bus the servo is connected to. More... | |
const std::map< int, std::string > & | servo_joint_map () const noexcept |
Map from servo ID to joint name. More... | |
std::vector< moteus::ServoCommand > & | commands () |
Get servo commands. More... | |
const std::vector< moteus::ServoReply > & | replies () const |
Get servo replies. More... | |
moteus::Data & | data () |
Get joint command-reply data. More... | |
void | initialize_action (Dictionary &action) |
Initialize action dictionary with keys corresponding to the servo layout. More... | |
void | write_position_commands (const Dictionary &action) |
Write position commands from an action dictionary. More... | |
void | write_stop_commands () noexcept |
Stop all servos. More... | |
Actuation interface for the Bullet simulator.
+ +Definition at line 25 of file BulletInterface.h.
+vulp::actuation::BulletInterface::BulletInterface | +( | +const ServoLayout & | +layout, | +
+ | + | const Parameters & | +params | +
+ | ) | ++ |
Initialize interface.
+[in] | layout | Servo layout. |
[in] | params | Interface parameters. |
std::runtime_error | If the simulator did not start properly. |
Definition at line 27 of file BulletInterface.cpp.
+ +vulp::actuation::BulletInterface::~BulletInterface | +( | +) | ++ |
Disconnect interface.
+ +Definition at line 108 of file BulletInterface.cpp.
+ +
+
|
+ +noexcept | +
Get the groundtruth floating base angular velocity.
+Definition at line 334 of file BulletInterface.cpp.
+ +double vulp::actuation::BulletInterface::compute_joint_torque | +( | +const std::string & | +joint_name, | +
+ | + | const double | +feedforward_torque, | +
+ | + | const double | +target_position, | +
+ | + | const double | +target_velocity, | +
+ | + | const double | +kp_scale, | +
+ | + | const double | +kd_scale, | +
+ | + | const double | +maximum_torque | +
+ | ) | ++ |
Reproduce the moteus position controller in Bullet.
+[in] | joint_name | Name of the joint. |
[in] | feedforward_torque | Feedforward torque command in [N] * [m]. |
[in] | target_position | Target angular position in [rad]. |
[in] | target_velocity | Target angular velocity in [rad] / [s]. |
[in] | kp_scale | Multiplicative factor applied to the proportional gain in torque control. |
[in] | kd_scale | Multiplicative factor applied to the derivative gain in torque control. |
[in] | maximum_torque | Maximum torque in [N] * [m] from the command. |
Definition at line 289 of file BulletInterface.cpp.
+ +
+
|
+ +finalvirtual | +
Spin a new communication cycle.
+data | Buffer to read commands from and write replies to. |
callback | Function to call when the cycle is over. |
The callback will be invoked from an arbitrary thread when the communication cycle has completed. All memory pointed to by data
must remain valid until the callback is invoked.
Implements vulp::actuation::Interface.
+ +Definition at line 186 of file BulletInterface.cpp.
+ +
+
|
+ +inline | +
Joint properties (accessor used for testing)
+ +Definition at line 243 of file BulletInterface.h.
+ +
+
|
+ +noexcept | +
Get the groundtruth floating base linear velocity.
+Definition at line 326 of file BulletInterface.cpp.
+ +
+
|
+ +overridevirtual | +
Write actuation-interface observations to dictionary.
+[out] | observation | Dictionary to write ot. |
Implements vulp::actuation::Interface.
+ +Definition at line 170 of file BulletInterface.cpp.
+ +
+
|
+ +overridevirtual | +
Reset interface.
+[in] | config | Additional configuration dictionary. |
Implements vulp::actuation::Interface.
+ +Definition at line 110 of file BulletInterface.cpp.
+ +void vulp::actuation::BulletInterface::reset_base_state | +( | +const Eigen::Vector3d & | +position_base_in_world, | +
+ | + | const Eigen::Quaterniond & | +orientation_base_in_world, | +
+ | + | const Eigen::Vector3d & | +linear_velocity_base_to_world_in_world, | +
+ | + | const Eigen::Vector3d & | +angular_velocity_base_in_base | +
+ | ) | ++ |
Reset the pose and velocity of the floating base in the world frame.
+[in] | position_base_in_world | Position of the base in the world frame. |
[in] | orientation_base_in_world | Orientation of the base in the world frame. |
[in] | linear_velocity_base_to_world_in_world | Linear velocity of the base in the world frame. |
[in] | angular_velocity_base_in_base | Body angular velocity of the base (in the base frame). |
Definition at line 122 of file BulletInterface.cpp.
+ +void vulp::actuation::BulletInterface::reset_contact_data | +( | +) | ++ |
Reset contact data.
+ +Definition at line 140 of file BulletInterface.cpp.
+ +void vulp::actuation::BulletInterface::reset_joint_angles | +( | +) | ++ |
Reset joint angles to zero.
+ +Definition at line 146 of file BulletInterface.cpp.
+ +void vulp::actuation::BulletInterface::reset_joint_properties | +( | +) | ++ |
Reset joint properties to defaults.
+ +Definition at line 153 of file BulletInterface.cpp.
+ +
+
|
+ +inline | +
Internal map of servo replies (accessor used for testing)
+ +Definition at line 248 of file BulletInterface.h.
+ +
+
|
+ +noexcept | +
Get the groundtruth floating base transform.
+ +Definition at line 314 of file BulletInterface.cpp.
+ +
+ vulp
+ 2.4.0
+
+ |
+
This is the complete list of members for vulp::actuation::Interface, including all inherited members.
+commands() | vulp::actuation::Interface | inline |
cycle(const moteus::Data &data, std::function< void(const moteus::Output &)> callback)=0 | vulp::actuation::Interface | pure virtual |
data() | vulp::actuation::Interface | inline |
initialize_action(Dictionary &action) | vulp::actuation::Interface | |
Interface(const ServoLayout &servo_layout) | vulp::actuation::Interface | inlineexplicit |
observe(Dictionary &observation) const =0 | vulp::actuation::Interface | pure virtual |
replies() const | vulp::actuation::Interface | inline |
reset(const Dictionary &config)=0 | vulp::actuation::Interface | pure virtual |
servo_bus_map() const noexcept | vulp::actuation::Interface | inline |
servo_joint_map() const noexcept | vulp::actuation::Interface | inline |
servo_layout() const noexcept | vulp::actuation::Interface | inline |
write_position_commands(const Dictionary &action) | vulp::actuation::Interface | |
write_stop_commands() noexcept | vulp::actuation::Interface | inline |
~Interface()=default | vulp::actuation::Interface | virtual |
+ vulp
+ 2.4.0
+
+ |
+
Base class for actuation interfaces. + More...
+ +#include <Interface.h>
+Public Member Functions | |
Interface (const ServoLayout &servo_layout) | |
Initialize actuation interface for a given servo layout. More... | |
virtual | ~Interface ()=default |
Virtual destructor so that derived destructors are called properly. More... | |
virtual void | cycle (const moteus::Data &data, std::function< void(const moteus::Output &)> callback)=0 |
Spin a new communication cycle. More... | |
virtual void | reset (const Dictionary &config)=0 |
Reset interface using a new servo layout. More... | |
virtual void | observe (Dictionary &observation) const =0 |
Write servo and IMU observations to dictionary. More... | |
const ServoLayout & | servo_layout () const noexcept |
Get servo layout. More... | |
const std::map< int, int > & | servo_bus_map () const noexcept |
Map from servo ID to the CAN bus the servo is connected to. More... | |
const std::map< int, std::string > & | servo_joint_map () const noexcept |
Map from servo ID to joint name. More... | |
std::vector< moteus::ServoCommand > & | commands () |
Get servo commands. More... | |
const std::vector< moteus::ServoReply > & | replies () const |
Get servo replies. More... | |
moteus::Data & | data () |
Get joint command-reply data. More... | |
void | initialize_action (Dictionary &action) |
Initialize action dictionary with keys corresponding to the servo layout. More... | |
void | write_position_commands (const Dictionary &action) |
Write position commands from an action dictionary. More... | |
void | write_stop_commands () noexcept |
Stop all servos. More... | |
Base class for actuation interfaces.
+ +Definition at line 24 of file Interface.h.
+
+
|
+ +inlineexplicit | +
Initialize actuation interface for a given servo layout.
+[in] | servo_layout | Servo layout. |
Definition at line 30 of file Interface.h.
+ +
+
|
+ +virtualdefault | +
Virtual destructor so that derived destructors are called properly.
+ +
+
|
+ +inline | +
Get servo commands.
+ +Definition at line 87 of file Interface.h.
+ +
+
|
+ +pure virtual | +
Spin a new communication cycle.
+[in,out] | data | Buffer to read commands from and write replies to. |
callback | Function to call when the cycle is over. |
The callback will be invoked from an arbitrary thread when the communication cycle has completed. All memory pointed to by data
must remain valid until the callback is invoked.
Implemented in vulp::actuation::Pi3HatInterface, vulp::actuation::MockInterface, and vulp::actuation::BulletInterface.
+ +
+
|
+ +inline | +
Get joint command-reply data.
+This field is meant to become internal when we refactor spine servo observations into actuation interfaces.
+ +Definition at line 97 of file Interface.h.
+ +void vulp::actuation::Interface::initialize_action | +( | +Dictionary & | +action | ) | ++ |
Initialize action dictionary with keys corresponding to the servo layout.
+[out] | action | Action dictionary. |
Definition at line 27 of file Interface.cpp.
+ +
+
|
+ +pure virtual | +
Write servo and IMU observations to dictionary.
+[out] | observation | Dictionary to write ot. |
Implemented in vulp::actuation::Pi3HatInterface, vulp::actuation::MockInterface, and vulp::actuation::BulletInterface.
+ +
+
|
+ +inline | +
Get servo replies.
+ +Definition at line 90 of file Interface.h.
+ +
+
|
+ +pure virtual | +
Reset interface using a new servo layout.
+[in] | config | Additional configuration dictionary. |
Implemented in vulp::actuation::Pi3HatInterface, vulp::actuation::MockInterface, and vulp::actuation::BulletInterface.
+ +
+
|
+ +inlinenoexcept | +
Map from servo ID to the CAN bus the servo is connected to.
+ +Definition at line 77 of file Interface.h.
+ +
+
|
+ +inlinenoexcept | +
Map from servo ID to joint name.
+ +Definition at line 82 of file Interface.h.
+ +
+
|
+ +inlinenoexcept | +
Get servo layout.
+ +Definition at line 74 of file Interface.h.
+ +void vulp::actuation::Interface::write_position_commands | +( | +const Dictionary & | +action | ) | ++ |
Write position commands from an action dictionary.
+[in] | action | Action to read commands from. |
Definition at line 40 of file Interface.cpp.
+ +
+
|
+ +inlinenoexcept | +
Stop all servos.
+[out] | commands | Servo commands to set to stop. |
This function does not and should not throw, as it will be called by default if any exception is caught from the spine control loop.
+ +Definition at line 118 of file Interface.h.
+ +
+ vulp
+ 2.4.0
+
+ |
+
This is the complete list of members for vulp::actuation::MockInterface, including all inherited members.
+
+ vulp
+ 2.4.0
+
+ |
+
#include <MockInterface.h>
+Public Member Functions | |
MockInterface (const ServoLayout &layout, const double dt) | |
Create mock actuator interface. More... | |
~MockInterface ()=default | |
Default destructor. More... | |
void | reset (const Dictionary &config) override |
Reset interface. More... | |
void | observe (Dictionary &observation) const override |
Write actuation-interface observations to dictionary. More... | |
void | cycle (const moteus::Data &data, std::function< void(const moteus::Output &)> callback) final |
Simulate a new communication cycle. More... | |
![]() | |
Interface (const ServoLayout &servo_layout) | |
Initialize actuation interface for a given servo layout. More... | |
virtual | ~Interface ()=default |
Virtual destructor so that derived destructors are called properly. More... | |
const ServoLayout & | servo_layout () const noexcept |
Get servo layout. More... | |
const std::map< int, int > & | servo_bus_map () const noexcept |
Map from servo ID to the CAN bus the servo is connected to. More... | |
const std::map< int, std::string > & | servo_joint_map () const noexcept |
Map from servo ID to joint name. More... | |
std::vector< moteus::ServoCommand > & | commands () |
Get servo commands. More... | |
const std::vector< moteus::ServoReply > & | replies () const |
Get servo replies. More... | |
moteus::Data & | data () |
Get joint command-reply data. More... | |
void | initialize_action (Dictionary &action) |
Initialize action dictionary with keys corresponding to the servo layout. More... | |
void | write_position_commands (const Dictionary &action) |
Write position commands from an action dictionary. More... | |
void | write_stop_commands () noexcept |
Stop all servos. More... | |
Definition at line 20 of file MockInterface.h.
+vulp::actuation::MockInterface::MockInterface | +( | +const ServoLayout & | +layout, | +
+ | + | const double | +dt | +
+ | ) | ++ |
Create mock actuator interface.
+[in] | params | Interface parameters. |
Definition at line 11 of file MockInterface.cpp.
+ +
+
|
+ +default | +
Default destructor.
+ +
+
|
+ +finalvirtual | +
Simulate a new communication cycle.
+data | Buffer to read commands from and write replies to. |
callback | Function to call when the cycle is over. |
The callback will be invoked from an arbitrary thread when the communication cycle has completed. All memory pointed to by data
must remain valid until the callback is invoked.
Implements vulp::actuation::Interface.
+ +Definition at line 39 of file MockInterface.cpp.
+ +
+
|
+ +overridevirtual | +
Write actuation-interface observations to dictionary.
+[out] | observation | Dictionary to write ot. |
Implements vulp::actuation::Interface.
+ +Definition at line 29 of file MockInterface.cpp.
+ +
+
|
+ +overridevirtual | +
Reset interface.
+[in] | config | Additional configuration dictionary. |
Implements vulp::actuation::Interface.
+ +Definition at line 27 of file MockInterface.cpp.
+ +
+ vulp
+ 2.4.0
+
+ |
+
This is the complete list of members for vulp::actuation::Pi3HatInterface, including all inherited members.
+
+ vulp
+ 2.4.0
+
+ |
+
Interface to moteus controllers. + More...
+ +#include <Pi3HatInterface.h>
+Public Member Functions | |
Pi3HatInterface (const ServoLayout &layout, const int can_cpu, const Pi3Hat::Configuration &pi3hat_config) | |
Configure interface and spawn CAN thread. More... | |
~Pi3HatInterface () | |
Stop CAN thread. More... | |
void | reset (const Dictionary &config) override |
Reset interface. More... | |
void | observe (Dictionary &observation) const override |
Write actuation-interface observations to dictionary. More... | |
void | cycle (const moteus::Data &data, std::function< void(const moteus::Output &)> callback) final |
Spin a new communication cycle. More... | |
![]() | |
Interface (const ServoLayout &servo_layout) | |
Initialize actuation interface for a given servo layout. More... | |
virtual | ~Interface ()=default |
Virtual destructor so that derived destructors are called properly. More... | |
const ServoLayout & | servo_layout () const noexcept |
Get servo layout. More... | |
const std::map< int, int > & | servo_bus_map () const noexcept |
Map from servo ID to the CAN bus the servo is connected to. More... | |
const std::map< int, std::string > & | servo_joint_map () const noexcept |
Map from servo ID to joint name. More... | |
std::vector< moteus::ServoCommand > & | commands () |
Get servo commands. More... | |
const std::vector< moteus::ServoReply > & | replies () const |
Get servo replies. More... | |
moteus::Data & | data () |
Get joint command-reply data. More... | |
void | initialize_action (Dictionary &action) |
Initialize action dictionary with keys corresponding to the servo layout. More... | |
void | write_position_commands (const Dictionary &action) |
Write position commands from an action dictionary. More... | |
void | write_stop_commands () noexcept |
Stop all servos. More... | |
Interface to moteus controllers.
+Internally it uses a background thread to operate the pi3hat, enabling the main thread to perform work while servo communication is taking place.
+ +Definition at line 43 of file Pi3HatInterface.h.
+vulp::actuation::Pi3HatInterface::Pi3HatInterface | +( | +const ServoLayout & | +layout, | +
+ | + | const int | +can_cpu, | +
+ | + | const Pi3Hat::Configuration & | +pi3hat_config | +
+ | ) | ++ |
Configure interface and spawn CAN thread.
+[in] | layout | Servo layout. |
[in] | can_cpu | CPUID of the core to run the CAN thread on. |
[in] | pi3hat_config | Configuration for the pi3hat. |
Definition at line 15 of file Pi3HatInterface.cpp.
+ +vulp::actuation::Pi3HatInterface::~Pi3HatInterface | +( | +) | ++ |
Stop CAN thread.
+ +Definition at line 22 of file Pi3HatInterface.cpp.
+ +
+
|
+ +finalvirtual | +
Spin a new communication cycle.
+[in] | data | Buffer to read commands from and write replies to. |
[in] | callback | Function to call when the cycle is over. |
The callback will be invoked from an arbitrary thread when the communication cycle has completed. All memory pointed to by data
must remain valid until the callback is invoked.
Implements vulp::actuation::Interface.
+ +Definition at line 54 of file Pi3HatInterface.cpp.
+ +
+
|
+ +overridevirtual | +
Write actuation-interface observations to dictionary.
+[out] | observation | Dictionary to write ot. |
Implements vulp::actuation::Interface.
+ +Definition at line 40 of file Pi3HatInterface.cpp.
+ +
+
|
+ +overridevirtual | +
Reset interface.
+[in] | config | Additional configuration dictionary. |
Implements vulp::actuation::Interface.
+ +Definition at line 38 of file Pi3HatInterface.cpp.
+ +
+ vulp
+ 2.4.0
+
+ |
+
This is the complete list of members for vulp::actuation::ServoLayout, including all inherited members.
+add_servo(const int servo_id, const int bus_id, const std::string &joint_name) | vulp::actuation::ServoLayout | inline |
bus(const int servo_id) const | vulp::actuation::ServoLayout | inline |
joint_name(const int servo_id) const | vulp::actuation::ServoLayout | inline |
servo_bus_map() const noexcept | vulp::actuation::ServoLayout | inline |
servo_joint_map() const noexcept | vulp::actuation::ServoLayout | inline |
size() const noexcept | vulp::actuation::ServoLayout | inline |
+ vulp
+ 2.4.0
+
+ |
+
Map between servos, their busses and the joints they actuate. + More...
+ +#include <ServoLayout.h>
+Public Member Functions | |
void | add_servo (const int servo_id, const int bus_id, const std::string &joint_name) |
Add a servo to the layout. More... | |
int | bus (const int servo_id) const |
Get identifier of the CAN bus a servo is connected to. More... | |
const std::string & | joint_name (const int servo_id) const |
Get the name of the joint a servo actuates. More... | |
const std::map< int, int > & | servo_bus_map () const noexcept |
Get the full servo-bus map. More... | |
const std::map< int, std::string > & | servo_joint_map () const noexcept |
Get the full servo-joint map. More... | |
size_t | size () const noexcept |
Get the number of servos in the layout. More... | |
Map between servos, their busses and the joints they actuate.
+ +Definition at line 12 of file ServoLayout.h.
+
+
|
+ +inline | +
Add a servo to the layout.
+[in] | servo_id | Servo ID (id.id for moteus) |
[in] | bus_id | CAN bus the servo is connected to. |
[in] | joint_name | Name of the joint the servo actuates. |
Definition at line 20 of file ServoLayout.h.
+ +
+
|
+ +inline | +
Get identifier of the CAN bus a servo is connected to.
+[in] | servo_id | Servo ID. |
std::out_of_range | if the servo is not in the layout. |
Definition at line 34 of file ServoLayout.h.
+ +
+
|
+ +inline | +
Get the name of the joint a servo actuates.
+[in] | servo_id | Servo ID. |
std::out_of_range | if the servo is not in the layout. |
Definition at line 44 of file ServoLayout.h.
+ +
+
|
+ +inlinenoexcept | +
Get the full servo-bus map.
+ +Definition at line 49 of file ServoLayout.h.
+ +
+
|
+ +inlinenoexcept | +
Get the full servo-joint map.
+ +Definition at line 54 of file ServoLayout.h.
+ +
+
|
+ +inlinenoexcept | +
Get the number of servos in the layout.
+ +Definition at line 59 of file ServoLayout.h.
+ +
+ vulp
+ 2.4.0
+
+ |
+
This is the complete list of members for vulp::control::Controller, including all inherited members.
+act(Dictionary &action, const Dictionary &observation)=0 | vulp::control::Controller | pure virtual |
+ vulp
+ 2.4.0
+
+ |
+
Base class for controllers. + More...
+ +#include <Controller.h>
+Public Member Functions | |
virtual void | act (Dictionary &action, const Dictionary &observation)=0 |
Decide action. More... | |
Base class for controllers.
+ +Definition at line 14 of file Controller.h.
+
+
|
+ +pure virtual | +
Decide action.
+[out] | action | Dictionary to write the full action to. |
[in] | observation | Latest observation. |
+ vulp
+ 2.4.0
+
+ |
+
This is the complete list of members for vulp::observation::HistoryObserver< T >, including all inherited members.
+HistoryObserver(const std::vector< std::string > &keys, size_t size, const T &default_value) | vulp::observation::HistoryObserver< T > | inline |
prefix() const noexcept final | vulp::observation::HistoryObserver< T > | inlinevirtual |
read(const Dictionary &observation) final | vulp::observation::HistoryObserver< T > | inlinevirtual |
reset(const Dictionary &config) final | vulp::observation::HistoryObserver< T > | inlinevirtual |
write(Dictionary &observation) final | vulp::observation::HistoryObserver< T > | inlinevirtual |
~Observer() | vulp::observation::Observer | inlinevirtual |
+ vulp
+ 2.4.0
+
+ |
+
Report high-frequency history vectors to lower-frequency agents. + More...
+ +#include <HistoryObserver.h>
+Public Member Functions | |
HistoryObserver (const std::vector< std::string > &keys, size_t size, const T &default_value) | |
Initialize observer. More... | |
std::string | prefix () const noexcept final |
Prefix of outputs in the observation dictionary. More... | |
void | reset (const Dictionary &config) final |
Reset observer. More... | |
void | read (const Dictionary &observation) final |
Read inputs from other observations. More... | |
void | write (Dictionary &observation) final |
Write outputs, called if reading was successful. More... | |
![]() | |
virtual | ~Observer () |
Destructor is virtual to deallocate lists of observers properly. More... | |
Report high-frequency history vectors to lower-frequency agents.
+This observer allows processing higher-frequency signals from the spine as vectors of observations reported to lower-frequency agents.
+ +Definition at line 28 of file HistoryObserver.h.
+
+
|
+ +inline | +
Initialize observer.
+[in] | keys | List of keys to read values from in input observations. |
[in] | size | Size of the history vector. |
[in] | default_value | Value to initialize history vectors. |
Definition at line 36 of file HistoryObserver.h.
+ +
+
|
+ +inlinefinalvirtualnoexcept | +
Prefix of outputs in the observation dictionary.
+ +Reimplemented from vulp::observation::Observer.
+ +Definition at line 41 of file HistoryObserver.h.
+ +
+
|
+ +inlinefinalvirtual | +
Read inputs from other observations.
+[in] | observation | Dictionary to read other observations from. |
Reimplemented from vulp::observation::Observer.
+ +Definition at line 53 of file HistoryObserver.h.
+ +
+
|
+ +inlinefinalvirtual | +
Reset observer.
+[in] | config | Configuration dictionary. |
Reimplemented from vulp::observation::Observer.
+ +Definition at line 47 of file HistoryObserver.h.
+ +
+
|
+ +inlinefinalvirtual | +
Write outputs, called if reading was successful.
+[out] | observation | Dictionary to write observations to. |
Reimplemented from vulp::observation::Observer.
+ +Definition at line 61 of file HistoryObserver.h.
+ +
+ vulp
+ 2.4.0
+
+ |
+
This is the complete list of members for vulp::observation::Observer, including all inherited members.
+prefix() const noexcept | vulp::observation::Observer | inlinevirtual |
read(const Dictionary &observation) | vulp::observation::Observer | inlinevirtual |
reset(const Dictionary &config) | vulp::observation::Observer | inlinevirtual |
write(Dictionary &observation) | vulp::observation::Observer | inlinevirtual |
~Observer() | vulp::observation::Observer | inlinevirtual |
+ vulp
+ 2.4.0
+
+ |
+
Base class for observers. + More...
+ +#include <Observer.h>
+Public Member Functions | |
virtual | ~Observer () |
Destructor is virtual to deallocate lists of observers properly. More... | |
virtual std::string | prefix () const noexcept |
Prefix of outputs in the observation dictionary. More... | |
virtual void | reset (const Dictionary &config) |
Reset observer. More... | |
virtual void | read (const Dictionary &observation) |
Read inputs from other observations. More... | |
virtual void | write (Dictionary &observation) |
Write outputs, called if reading was successful. More... | |
Base class for observers.
+ +Definition at line 15 of file Observer.h.
+
+
|
+ +inlinevirtual | +
Destructor is virtual to deallocate lists of observers properly.
+ +Definition at line 18 of file Observer.h.
+ +
+
|
+ +inlinevirtualnoexcept | +
Prefix of outputs in the observation dictionary.
+ +Reimplemented in vulp::observation::HistoryObserver< T >.
+ +Definition at line 21 of file Observer.h.
+ +
+
|
+ +inlinevirtual | +
Read inputs from other observations.
+[in] | observation | Dictionary to read other observations from. |
Reimplemented in vulp::observation::HistoryObserver< T >.
+ +Definition at line 38 of file Observer.h.
+ +
+
|
+ +inlinevirtual | +
Reset observer.
+[in] | config | Configuration dictionary. |
Reimplemented in vulp::observation::HistoryObserver< T >.
+ +Definition at line 29 of file Observer.h.
+ +
+
|
+ +inlinevirtual | +
Write outputs, called if reading was successful.
+[out] | observation | Dictionary to write observations to. |
Reimplemented in vulp::observation::HistoryObserver< T >.
+ +Definition at line 47 of file Observer.h.
+ +
+ vulp
+ 2.4.0
+
+ |
+
This is the complete list of members for vulp::observation::ObserverPipeline, including all inherited members.
+append_observer(std::shared_ptr< Observer > observer) | vulp::observation::ObserverPipeline | inline |
connect_source(std::shared_ptr< Source > source) | vulp::observation::ObserverPipeline | inline |
iterator typedef | vulp::observation::ObserverPipeline | |
nb_observers() | vulp::observation::ObserverPipeline | inline |
nb_sources() | vulp::observation::ObserverPipeline | inline |
observers() | vulp::observation::ObserverPipeline | inline |
reset(const Dictionary &config) | vulp::observation::ObserverPipeline | |
run(Dictionary &observation) | vulp::observation::ObserverPipeline | |
sources() | vulp::observation::ObserverPipeline | inline |
+ vulp
+ 2.4.0
+
+ |
+
#include <ObserverPipeline.h>
+Public Types | |
using | iterator = ObserverPtrVector::iterator |
+Public Member Functions | |
void | reset (const Dictionary &config) |
Reset observers. More... | |
void | connect_source (std::shared_ptr< Source > source) |
void | append_observer (std::shared_ptr< Observer > observer) |
SourcePtrVector & | sources () |
Sources of the pipeline. More... | |
size_t | nb_sources () |
Number of sources in the pipeline. More... | |
ObserverPtrVector & | observers () |
Observers of the pipeline. Order matters. More... | |
size_t | nb_observers () |
Number of observers in the pipeline. More... | |
void | run (Dictionary &observation) |
Run observer pipeline on an observation dictionary. More... | |
Observer pipeline.
+An observer pipeline is a list of sources and observers, to be executed in that order. Observers further down the pipeline may depend on the results of those that precede them, which are written to the observation dictionary. The pipeline is thus assumed to be topologically sorted.
+ +Definition at line 22 of file ObserverPipeline.h.
+using vulp::observation::ObserverPipeline::iterator = ObserverPtrVector::iterator | +
Definition at line 28 of file ObserverPipeline.h.
+ +
+
|
+ +inline | +
Definition at line 52 of file ObserverPipeline.h.
+ +
+
|
+ +inline | +
Definition at line 44 of file ObserverPipeline.h.
+ +
+
|
+ +inline | +
Number of observers in the pipeline.
+ +Definition at line 66 of file ObserverPipeline.h.
+ +
+
|
+ +inline | +
Number of sources in the pipeline.
+ +Definition at line 60 of file ObserverPipeline.h.
+ +
+
|
+ +inline | +
Observers of the pipeline. Order matters.
+ +Definition at line 63 of file ObserverPipeline.h.
+ +void vulp::observation::ObserverPipeline::reset | +( | +const Dictionary & | +config | ) | ++ |
Reset observers.
+[in] | config | Overall configuration dictionary. |
Definition at line 15 of file ObserverPipeline.cpp.
+ +void vulp::observation::ObserverPipeline::run | +( | +Dictionary & | +observation | ) | ++ |
Run observer pipeline on an observation dictionary.
+[in,out] | observation | Observation dictionary. |
Definition at line 21 of file ObserverPipeline.cpp.
+ +
+
|
+ +inline | +
Sources of the pipeline.
+ +Definition at line 57 of file ObserverPipeline.h.
+ +
+ vulp
+ 2.4.0
+
+ |
+
This is the complete list of members for vulp::observation::Source, including all inherited members.
+prefix() const noexcept | vulp::observation::Source | inlinevirtual |
write(Dictionary &observation) | vulp::observation::Source | inlinevirtual |
~Source() | vulp::observation::Source | inlinevirtual |
+ vulp
+ 2.4.0
+
+ |
+
Base class for sources. + More...
+ +#include <Source.h>
+Public Member Functions | |
virtual | ~Source () |
Destructor is virtual to deallocate lists of observers properly. More... | |
virtual std::string | prefix () const noexcept |
Prefix of output in the observation dictionary. More... | |
virtual void | write (Dictionary &observation) |
Write output to a dictionary. More... | |
Base class for sources.
+Sources run before observers. They write their observations without reading other observations from the pipeline, although they may of course read data from other media (such as the file system).
+ + +
+
|
+ +inlinevirtual | +
+
|
+ +inlinevirtualnoexcept | +
Prefix of output in the observation dictionary.
+This prefix is looked up by the spine to feed observation(prefix)
to the write function.
Reimplemented in vulp::observation::sources::Keyboard, vulp::observation::sources::Joystick, and vulp::observation::sources::CpuTemperature.
+ + + +
+
|
+ +inlinevirtual | +
Write output to a dictionary.
+[out] | observation | Dictionary to write observations to. |
Reimplemented in vulp::observation::sources::Keyboard, vulp::observation::sources::Joystick, and vulp::observation::sources::CpuTemperature.
+ + + +
+ vulp
+ 2.4.0
+
+ |
+
This is the complete list of members for vulp::observation::sources::CpuTemperature, including all inherited members.
+CpuTemperature(const char *temp_path="/sys/class/thermal/thermal_zone0/temp") | vulp::observation::sources::CpuTemperature | |
is_disabled() const | vulp::observation::sources::CpuTemperature | inline |
prefix() const noexcept final | vulp::observation::sources::CpuTemperature | inlinevirtual |
write(Dictionary &observation) final | vulp::observation::sources::CpuTemperature | virtual |
~CpuTemperature() override | vulp::observation::sources::CpuTemperature | |
~Source() | vulp::observation::Source | inlinevirtual |
+ vulp
+ 2.4.0
+
+ |
+
Source for CPU temperature readings. + More...
+ +#include <CpuTemperature.h>
+Public Member Functions | |
CpuTemperature (const char *temp_path="/sys/class/thermal/thermal_zone0/temp") | |
Open file to query temperature from the kernel. More... | |
~CpuTemperature () override | |
Close file. More... | |
std::string | prefix () const noexcept final |
Prefix of output in the observation dictionary. More... | |
void | write (Dictionary &observation) final |
Write output to a dictionary. More... | |
bool | is_disabled () const |
Check if temperature observations are disabled. More... | |
![]() | |
virtual | ~Source () |
Destructor is virtual to deallocate lists of observers properly. More... | |
Source for CPU temperature readings.
+Definition at line 19 of file CpuTemperature.h.
+vulp::observation::sources::CpuTemperature::CpuTemperature | +( | +const char * | +temp_path = "/sys/class/thermal/thermal_zone0/temp" | ) | ++ |
Open file to query temperature from the kernel.
+[in] | temp_path | Path to thermal-zone special file from the Linux kernel. |
Definition at line 8 of file CpuTemperature.cpp.
+ +
+
|
+ +override | +
Close file.
+ +Definition at line 13 of file CpuTemperature.cpp.
+ +
+
|
+ +inline | +
Check if temperature observations are disabled.
+ +Definition at line 42 of file CpuTemperature.h.
+ +
+
|
+ +inlinefinalvirtualnoexcept | +
Prefix of output in the observation dictionary.
+ +Reimplemented from vulp::observation::Source.
+ +Definition at line 33 of file CpuTemperature.h.
+ +
+
|
+ +finalvirtual | +
Write output to a dictionary.
+[out] | observation | Dictionary to write observations to. |
Reimplemented from vulp::observation::Source.
+ +Definition at line 19 of file CpuTemperature.cpp.
+ +
+ vulp
+ 2.4.0
+
+ |
+
This is the complete list of members for vulp::observation::sources::Joystick, including all inherited members.
+Joystick(const std::string &device_path="/dev/input/js0") | vulp::observation::sources::Joystick | |
prefix() const noexcept final | vulp::observation::sources::Joystick | inlinevirtual |
present() const noexcept | vulp::observation::sources::Joystick | inline |
write(Dictionary &output) final | vulp::observation::sources::Joystick | virtual |
~Joystick() override | vulp::observation::sources::Joystick | |
~Source() | vulp::observation::Source | inlinevirtual |
+ vulp
+ 2.4.0
+
+ |
+
Source for a joystick controller. + More...
+ +#include <Joystick.h>
+Public Member Functions | |
Joystick (const std::string &device_path="/dev/input/js0") | |
Open the device file. More... | |
~Joystick () override | |
Close device file. More... | |
bool | present () const noexcept |
Check if the device file was opened successfully. More... | |
std::string | prefix () const noexcept final |
Prefix of output in the observation dictionary. More... | |
void | write (Dictionary &output) final |
Write output to a dictionary. More... | |
![]() | |
virtual | ~Source () |
Destructor is virtual to deallocate lists of observers properly. More... | |
Source for a joystick controller.
+Axes are the same for PS4 and Xbox controllers, but buttons differ slightly. See comments in read for the exact mapping.
+Definition at line 27 of file Joystick.h.
+vulp::observation::sources::Joystick::Joystick | +( | +const std::string & | +device_path = "/dev/input/js0" | ) | ++ |
Open the device file.
+[in] | device_path | Path to the joystick device file. |
Definition at line 8 of file Joystick.cpp.
+ +
+
|
+ +override | +
Close device file.
+ +Definition at line 16 of file Joystick.cpp.
+ +
+
|
+ +inlinefinalvirtualnoexcept | +
Prefix of output in the observation dictionary.
+ +Reimplemented from vulp::observation::Source.
+ +Definition at line 42 of file Joystick.h.
+ +
+
|
+ +inlinenoexcept | +
Check if the device file was opened successfully.
+ +Definition at line 39 of file Joystick.h.
+ +
+
|
+ +finalvirtual | +
Write output to a dictionary.
+[out] | output | Dictionary to write observations to. |
Reimplemented from vulp::observation::Source.
+ +Definition at line 115 of file Joystick.cpp.
+ +
+ vulp
+ 2.4.0
+
+ |
+
This is the complete list of members for vulp::observation::sources::Keyboard, including all inherited members.
+Keyboard() | vulp::observation::sources::Keyboard | |
prefix() const noexcept final | vulp::observation::sources::Keyboard | inlinevirtual |
write(Dictionary &output) final | vulp::observation::sources::Keyboard | virtual |
~Keyboard() override | vulp::observation::sources::Keyboard | |
~Source() | vulp::observation::Source | inlinevirtual |
+ vulp
+ 2.4.0
+
+ |
+
Source for reading Keyboard inputs. + More...
+ +#include <Keyboard.h>
+Public Member Functions | |
Keyboard () | |
Constructor sets up the terminal in non-canonical mode where input is available immediately without waiting for a newline. More... | |
~Keyboard () override | |
Destructor. More... | |
std::string | prefix () const noexcept final |
Prefix of output in the observation dictionary. More... | |
void | write (Dictionary &output) final |
Write output to a dictionary. More... | |
![]() | |
virtual | ~Source () |
Destructor is virtual to deallocate lists of observers properly. More... | |
Source for reading Keyboard inputs.
+Definition at line 71 of file Keyboard.h.
+vulp::observation::sources::Keyboard::Keyboard | +( | +) | ++ |
Constructor sets up the terminal in non-canonical mode where input is available immediately without waiting for a newline.
+ +Definition at line 7 of file Keyboard.cpp.
+ +
+
|
+ +override | +
Destructor.
+ +Definition at line 20 of file Keyboard.cpp.
+ +
+
|
+ +inlinefinalvirtualnoexcept | +
Prefix of output in the observation dictionary.
+ +Reimplemented from vulp::observation::Source.
+ +Definition at line 82 of file Keyboard.h.
+ +
+
|
+ +finalvirtual | +
Write output to a dictionary.
+[out] | output | Dictionary to write observations to. |
Reimplemented from vulp::observation::Source.
+ +Definition at line 83 of file Keyboard.cpp.
+ +
+ vulp
+ 2.4.0
+
+ |
+
This is the complete list of members for vulp.spine::AgentInterface, including all inherited members.
+AgentInterface(const std::string &name, size_t size) | vulp.spine::AgentInterface | |
data() const | vulp.spine::AgentInterface | inline |
request() const | vulp.spine::AgentInterface | inline |
set_request(Request request) | vulp.spine::AgentInterface | |
size() const | vulp.spine::AgentInterface | inline |
write(char *data, size_t size) | vulp.spine::AgentInterface | |
~AgentInterface() | vulp.spine::AgentInterface |
+ vulp
+ 2.4.0
+
+ |
+
Memory map to shared memory. + More...
+ +#include <AgentInterface.h>
+Public Member Functions | |
AgentInterface (const std::string &name, size_t size) | |
Open interface to the agent at a given shared-memory file. More... | |
~AgentInterface () | |
Unmap memory and unlink shared memory object. More... | |
void | set_request (Request request) |
Set current request in shared memory. More... | |
void | write (char *data, size_t size) |
Write data to the data buffer in shared memory. More... | |
Request | request () const |
Get current request from shared memory. More... | |
uint32_t | size () const |
Get size of current data buffer. More... | |
const char * | data () const |
Get pointer to data buffer. More... | |
Memory map to shared memory.
+On memory mapping, shared memory and memory-mapped files: https://w3.cs.jmu.edu/kirkpams/OpenCSF/Books/csf/html/MMap.html
+ +Definition at line 32 of file AgentInterface.h.
+vulp.spine::AgentInterface::AgentInterface | +( | +const std::string & | +name, | +
+ | + | size_t | +size | +
+ | ) | ++ |
Open interface to the agent at a given shared-memory file.
+[in] | name | Name of the shared memory file (e.g. "/vulp"). |
[in] | size | Size in bytes. |
Shared memory objects are available as files in /dev/shm
.
Definition at line 32 of file AgentInterface.cpp.
+ +vulp.spine::AgentInterface::~AgentInterface | +( | +) | ++ |
Unmap memory and unlink shared memory object.
+ +Definition at line 76 of file AgentInterface.cpp.
+ +
+
|
+ +inline | +
Get pointer to data buffer.
+ +Definition at line 66 of file AgentInterface.h.
+ +
+
|
+ +inline | +
Get current request from shared memory.
+ +Definition at line 60 of file AgentInterface.h.
+ +void vulp.spine::AgentInterface::set_request | +( | +Request | +request | ) | ++ |
Set current request in shared memory.
+[in] | request | New request. |
Definition at line 85 of file AgentInterface.cpp.
+ +
+
|
+ +inline | +
Get size of current data buffer.
+ +Definition at line 63 of file AgentInterface.h.
+ +void vulp.spine::AgentInterface::write | +( | +char * | +data, | +
+ | + | size_t | +size | +
+ | ) | ++ |
Write data to the data buffer in shared memory.
+[in] | data | Data to write. |
[in] | size | Number of bytes to write. |
Definition at line 89 of file AgentInterface.cpp.
+ +
+ vulp
+ 2.4.0
+
+ |
+
This is the complete list of members for vulp.spine::Spine, including all inherited members.
+actuation_ | vulp.spine::Spine | protected |
actuation_output_ | vulp.spine::Spine | protected |
agent_interface_ | vulp.spine::Spine | protected |
caught_interrupt_ | vulp.spine::Spine | protected |
cycle() | vulp.spine::Spine | |
frequency_ | vulp.spine::Spine | protected |
ipc_buffer_ | vulp.spine::Spine | protected |
latest_replies_ | vulp.spine::Spine | protected |
logger_ | vulp.spine::Spine | protected |
observer_pipeline_ | vulp.spine::Spine | protected |
reset(const palimpsest::Dictionary &config) | vulp.spine::Spine | |
run() | vulp.spine::Spine | |
simulate(unsigned nb_substeps) | vulp.spine::Spine | |
Spine(const Parameters ¶ms, actuation::Interface &interface, observation::ObserverPipeline &observers) | vulp.spine::Spine | |
state_cycle_beginning_ | vulp.spine::Spine | protected |
state_cycle_end_ | vulp.spine::Spine | protected |
state_machine_ | vulp.spine::Spine | protected |
working_dict_ | vulp.spine::Spine | protected |
+ vulp
+ 2.4.0
+
+ |
+
Loop transmitting actions to the actuation and observations to the agent. + More...
+ +#include <Spine.h>
+Classes | |
struct | Parameters |
Spine parameters. More... | |
+Public Member Functions | |
Spine (const Parameters ¶ms, actuation::Interface &interface, observation::ObserverPipeline &observers) | |
Initialize spine. More... | |
void | reset (const palimpsest::Dictionary &config) |
Reset the spine with a new configuration. More... | |
void | run () |
Run the spine loop until termination. More... | |
void | cycle () |
Spin one cycle of the spine loop. More... | |
void | simulate (unsigned nb_substeps) |
Alternative to run where the actuation interface is cycled a fixed number of times, and communication cycles are not frequency-regulated. More... | |
+Protected Attributes | |
const unsigned | frequency_ |
Frequency of the spine loop in [Hz]. More... | |
actuation::Interface & | actuation_ |
Interface that communicates with actuators. More... | |
AgentInterface | agent_interface_ |
Shared memory mapping for inter-process communication. More... | |
std::future< actuation::moteus::Output > | actuation_output_ |
Future used to wait for moteus replies. More... | |
std::vector< actuation::moteus::ServoReply > | latest_replies_ |
Latest servo replies. They are copied and thread-safe. More... | |
palimpsest::Dictionary | working_dict_ |
All data from observation to action goes to this dictionary. More... | |
observation::ObserverPipeline | observer_pipeline_ |
Pipeline of observers, executed in that order. More... | |
mpacklog::Logger | logger_ |
Logger for the working_dict_ produced at each cycle. More... | |
std::vector< char > | ipc_buffer_ |
Buffer used to serialize/deserialize dictionaries in IPC. More... | |
const bool & | caught_interrupt_ |
Boolean flag that becomes true when an interruption is caught. More... | |
StateMachine | state_machine_ |
Internal state machine. More... | |
State | state_cycle_beginning_ |
State after the last Event::kCycleBeginning. More... | |
State | state_cycle_end_ |
State after the last Event::kCycleEnd. More... | |
Loop transmitting actions to the actuation and observations to the agent.
+The spine acts as the intermediary between the actuation interface (e.g. moteus servos connected to the CAN-FD bus) and an agent communicating over shared memory (the agent interface). It packs observations to the agent from actuation replies and commands to the actuation from agent actions.
+The spine processes requests at the beginning and end of each control cycle according to its StateMachine. The overall specification of the state machine is summarized in the following diagram:
+See StateMachine for more details.
+ + +vulp.spine::Spine::Spine | +( | +const Parameters & | +params, | +
+ | + | actuation::Interface & | +interface, | +
+ | + | observation::ObserverPipeline & | +observers | +
+ | ) | ++ |
void vulp.spine::Spine::cycle | +( | +) | ++ |
void vulp.spine::Spine::reset | +( | +const palimpsest::Dictionary & | +config | ) | ++ |
Reset the spine with a new configuration.
+[in] | config | New global configuration dictionary, used to derive the servo layout (which servo is on which bus, corresponds to which joint) and forwarded to other components (e.g. observers). |
void vulp.spine::Spine::run | +( | +) | ++ |
Run the spine loop until termination.
+Each iteration of the loop runs observers, computes the action and cycles the actuation interface. Additionally, this function collects debug values and logs everything.
+void vulp.spine::Spine::simulate | +( | +unsigned | +nb_substeps | ) | ++ |
Alternative to run where the actuation interface is cycled a fixed number of times, and communication cycles are not frequency-regulated.
+[in] | nb_substeps | Number of actuation cycles per action. |
Thus function assumes the agent alternates acting and observing. Simulation steps are triggered at startup (to construct the initial observation) and at each action request.
+Note that there is currently a delay of three substeps between observation and simulation. That is, the internal simulation state is always three substeps ahead compared to the values written to the observation dictionary in cycle_actuation. This decision is discussed in https://github.com/orgs/upkie/discussions/238#discussioncomment-8984290
+ + + +
+
|
+ +protected | +
+
|
+ +protected | +
+
|
+ +protected | +
+
|
+ +protected | +
+
|
+ +protected | +
+
|
+ +protected | +
+
|
+ +protected | +
+
|
+ +protected | +
Logger for the working_dict_ produced at each cycle.
+ + + +
+
|
+ +protected | +
+
|
+ +protected | +
State after the last Event::kCycleBeginning.
+ + + +
+
|
+ +protected | +
State after the last Event::kCycleEnd.
+ + + +
+
|
+ +protected | +
+
|
+ +protected | +
+ vulp
+ 2.4.0
+
+ |
+
This is the complete list of members for vulp.spine::StateMachine, including all inherited members.
+is_over_after_this_cycle() const noexcept | vulp.spine::StateMachine | inline |
process_event(const Event &event) noexcept | vulp.spine::StateMachine | |
state() const noexcept | vulp.spine::StateMachine | inline |
StateMachine(AgentInterface &interface) noexcept | vulp.spine::StateMachine | explicit |
+ vulp
+ 2.4.0
+
+ |
+
Spine state machine. + More...
+ +#include <StateMachine.h>
+Public Member Functions | |
StateMachine (AgentInterface &interface) noexcept | |
Initialize state machine. More... | |
void | process_event (const Event &event) noexcept |
Process a new event. More... | |
const State & | state () const noexcept |
Get current state. More... | |
bool | is_over_after_this_cycle () const noexcept |
Whether we transition to the terminal state at the next end-cycle event. More... | |
Spine state machine.
+The overall specification of the state machine is summarized in the following diagram:
+States have the following purposes:
+There are three possible events:
+begin
: beginning of a control cycle,end
: end of a control cycle.SIGINT
: the process received an interrupt signal.Guards, indicated between brackets, may involve two variables:
+req
: the current request from the agent.stop_cycles
: the number of stop commands cycled in the current state (only available in "stop" and "shutdown" states). Definition at line 88 of file StateMachine.h.
+
+
|
+ +explicitnoexcept | +
Initialize state machine.
+[in] | interface | Interface to communicate with the agent. |
Definition at line 12 of file StateMachine.cpp.
+ +
+
|
+ +inlinenoexcept | +
Whether we transition to the terminal state at the next end-cycle event.
+ +Definition at line 106 of file StateMachine.h.
+ +
+
|
+ +noexcept | +
Process a new event.
+[in] | event | New event. |
Definition at line 17 of file StateMachine.cpp.
+ +
+
|
+ +inlinenoexcept | +
Get current state.
+ +Definition at line 103 of file StateMachine.h.
+ +
+ vulp
+ 2.4.0
+
+ |
+
Exception raised when a performance issue is detected. + More...
+Exception raised when a performance issue is detected.
+ +Definition at line 15 of file exceptions.py.
+
+ vulp
+ 2.4.0
+
+ |
+
Exception raised when the spine sets an error flag in the request field of the shared memory map. + More...
+Exception raised when the spine sets an error flag in the request field of the shared memory map.
+ +Definition at line 21 of file exceptions.py.
+
+ vulp
+ 2.4.0
+
+ |
+
Base class for exceptions raised by Vulp. + More...
+Base class for exceptions raised by Vulp.
+ +Definition at line 9 of file exceptions.py.
+
+ vulp
+ 2.4.0
+
+ |
+
This is the complete list of members for vulp.spine.request.Request, including all inherited members.
+kAction | vulp.spine.request.Request | static |
kError | vulp.spine.request.Request | static |
kNone | vulp.spine.request.Request | static |
kObservation | vulp.spine.request.Request | static |
kStart | vulp.spine.request.Request | static |
kStop | vulp.spine.request.Request | static |
+ vulp
+ 2.4.0
+
+ |
+
Flag set by the agent to request an operation from the spine. + More...
++Static Public Attributes | |
int | kNone = 0 |
int | kObservation = 1 |
int | kAction = 2 |
int | kStart = 3 |
int | kStop = 4 |
int | kError = 5 |
Flag set by the agent to request an operation from the spine.
+Once the spine has processed the request, it resets the flag to kNone in shared memory.
+ +Definition at line 10 of file request.py.
+
+
|
+ +static | +
Definition at line 21 of file request.py.
+ +
+
|
+ +static | +
Definition at line 24 of file request.py.
+ +
+
|
+ +static | +
Definition at line 19 of file request.py.
+ +
+
|
+ +static | +
Definition at line 20 of file request.py.
+ +
+
|
+ +static | +
Definition at line 22 of file request.py.
+ +
+
|
+ +static | +
Definition at line 23 of file request.py.
+ +
+ vulp
+ 2.4.0
+
+ |
+
This is the complete list of members for vulp.spine.spine_interface.SpineInterface, including all inherited members.
+__del__(self) | vulp.spine.spine_interface.SpineInterface | |
__init__(self, str shm_name="/vulp", int retries=1, bool perf_checks=True) | vulp.spine.spine_interface.SpineInterface | |
get_first_observation(self) | vulp.spine.spine_interface.SpineInterface | |
get_observation(self) | vulp.spine.spine_interface.SpineInterface | |
set_action(self, dict action) | vulp.spine.spine_interface.SpineInterface | |
start(self, dict config) | vulp.spine.spine_interface.SpineInterface | |
stop(self) | vulp.spine.spine_interface.SpineInterface |
+ vulp
+ 2.4.0
+
+ |
+
Interface to interact with a spine from a Python agent. + More...
++Public Member Functions | |
def | __init__ (self, str shm_name="/vulp", int retries=1, bool perf_checks=True) |
Connect to the spine shared memory. More... | |
def | __del__ (self) |
Close memory mapping. More... | |
dict | get_observation (self) |
Ask the spine to write the latest observation to shared memory. More... | |
dict | get_first_observation (self) |
Get first observation after a reset. More... | |
None | set_action (self, dict action) |
None | start (self, dict config) |
Reset the spine to a new configuration. More... | |
None | stop (self) |
Tell the spine to stop all actuators. More... | |
Interface to interact with a spine from a Python agent.
+ +Definition at line 60 of file spine_interface.py.
+def vulp.spine.spine_interface.SpineInterface.__init__ | +( | ++ | self, | +
+ | + | str | +shm_name = "/vulp" , |
+
+ | + | int | +retries = 1 , |
+
+ | + | bool | +perf_checks = True |
+
+ | ) | ++ |
Connect to the spine shared memory.
+shm_name | Name of the shared memory object. |
retries | Number of times to try opening the shared-memory file. |
perf_checks | If true, run performance checks after construction. |
Definition at line 68 of file spine_interface.py.
+ +def vulp.spine.spine_interface.SpineInterface.__del__ | +( | ++ | self | ) | ++ |
Close memory mapping.
+Note that the spine process will unlink the shared memory object, so we don't unlink it here.
+ +Definition at line 97 of file spine_interface.py.
+ +dict vulp.spine.spine_interface.SpineInterface.get_first_observation | +( | ++ | self | ) | ++ |
Get first observation after a reset.
+Definition at line 123 of file spine_interface.py.
+ +dict vulp.spine.spine_interface.SpineInterface.get_observation | +( | ++ | self | ) | ++ |
Ask the spine to write the latest observation to shared memory.
+Definition at line 107 of file spine_interface.py.
+ +None vulp.spine.spine_interface.SpineInterface.set_action | +( | ++ | self, | +
+ | + | dict | +action | +
+ | ) | ++ |
Definition at line 132 of file spine_interface.py.
+ +None vulp.spine.spine_interface.SpineInterface.start | +( | ++ | self, | +
+ | + | dict | +config | +
+ | ) | ++ |
Reset the spine to a new configuration.
+config | Configuration dictionary. |
Definition at line 137 of file spine_interface.py.
+ +None vulp.spine.spine_interface.SpineInterface.stop | +( | ++ | self | ) | ++ |
Tell the spine to stop all actuators.
+ +Definition at line 147 of file spine_interface.py.
+ +
+ vulp
+ 2.4.0
+
+ |
+
This is the complete list of members for vulp.utils::SynchronousClock, including all inherited members.
+measured_period() const noexcept | vulp.utils::SynchronousClock | inline |
skip_count() const noexcept | vulp.utils::SynchronousClock | inline |
slack() const noexcept | vulp.utils::SynchronousClock | inline |
SynchronousClock(double frequency) | vulp.utils::SynchronousClock | explicit |
wait_for_next_tick() | vulp.utils::SynchronousClock |
+ vulp
+ 2.4.0
+
+ |
+
Synchronous (blocking) clock. + More...
+ +#include <SynchronousClock.h>
+Public Member Functions | |
SynchronousClock (double frequency) | |
Initialize clock. More... | |
void | wait_for_next_tick () |
Wait until the next tick of the internal clock. More... | |
double | measured_period () const noexcept |
Get measured period in seconds. More... | |
int | skip_count () const noexcept |
Get last number of clock cycles skipped. More... | |
double | slack () const noexcept |
Get the last sleep duration duration in seconds. More... | |
Synchronous (blocking) clock.
+This clock ticks at a fixed frequency. It provides a method to wait for the next tick (which is always blocking, see below), and reports missed ticks if applicable.
+The difference between a blocking clock and a rate limiter lies in the behavior when skipping cycles. A rate limiter does nothing if there is no time left, as the caller's rate does not need to be limited. On the contrary, a synchronous clock waits for the next tick, which is by definition in the future, so it always waits for a non-zero duration.
+Internally all durations in this class are stored in microseconds.
+ +Definition at line 26 of file SynchronousClock.h.
+
+
|
+ +explicit | +
Initialize clock.
+frequency | Desired tick frequency in [Hz]. It should be an integer that divides one million. |
Definition at line 20 of file SynchronousClock.cpp.
+ +
+
|
+ +inlinenoexcept | +
Get measured period in seconds.
+ +Definition at line 45 of file SynchronousClock.h.
+ +
+
|
+ +inlinenoexcept | +
Get last number of clock cycles skipped.
+ +Definition at line 48 of file SynchronousClock.h.
+ +
+
|
+ +inlinenoexcept | +
Get the last sleep duration duration in seconds.
+ +Definition at line 51 of file SynchronousClock.h.
+ +void vulp.utils::SynchronousClock::wait_for_next_tick | +( | +) | ++ |
Wait until the next tick of the internal clock.
+Definition at line 39 of file SynchronousClock.cpp.
+ +
+ vulp
+ 2.4.0
+
+ |
+
Go to the source code of this file.
++Namespaces | |
vulp | |
vulp::actuation | |
Send actions to actuators or simulators. | |
vulp::actuation::default_action | |
+Variables | |
constexpr double | vulp::actuation::default_action::kFeedforwardTorque = 0.0 |
constexpr double | vulp::actuation::default_action::kVelocity = 0.0 |
constexpr double | vulp::actuation::default_action::kKpScale = 1.0 |
constexpr double | vulp::actuation::default_action::kKdScale = 1.0 |
constexpr double | vulp::actuation::default_action::kMaximumTorque = 1.0 |
+ vulp
+ 2.4.0
+
+ |
+
+ vulp
+ 2.4.0
+
+ |
+
File in vulp/actuation | Includes file in vulp/utils |
---|---|
Pi3HatInterface.h | realtime.h |
+ vulp
+ 2.4.0
+
+ |
+
File in vulp/spine | Includes file in vulp/actuation |
---|---|
Spine.h | Interface.h |
+ vulp
+ 2.4.0
+
+ |
+
File in vulp/spine | Includes file in vulp/observation |
---|---|
Spine.h | observe_servos.h |
Spine.h | observe_time.h |
Spine.h | ObserverPipeline.h |
+ vulp
+ 2.4.0
+
+ |
+
File in vulp/spine | Includes file in vulp/utils |
---|---|
Spine.h | handle_interrupts.h |
Spine.h | realtime.h |
Spine.h | SynchronousClock.h |
StateMachine.cpp | handle_interrupts.h |
+ vulp
+ 2.4.0
+
+ |
+
+Files | |
file | __init__.py [code] |
file | handle_interrupts.cpp [code] |
file | handle_interrupts.h [code] |
file | low_pass_filter.h [code] |
file | math.h [code] |
file | random_string.h [code] |
file | realtime.h [code] |
file | serialize.py [code] |
file | SynchronousClock.cpp [code] |
file | SynchronousClock.h [code] |
+ vulp
+ 2.4.0
+
+ |
+
+Files | |
file | CpuTemperature.cpp [code] |
file | CpuTemperature.h [code] |
file | Joystick.cpp [code] |
file | Joystick.h [code] |
file | Keyboard.cpp [code] |
file | Keyboard.h [code] |
+ vulp
+ 2.4.0
+
+ |
+
+Directories | |
directory | actuation |
directory | control |
directory | observation |
directory | spine |
directory | utils |
+ vulp
+ 2.4.0
+
+ |
+
+Files | |
file | __init__.py [code] |
file | AgentInterface.cpp [code] |
file | AgentInterface.h [code] |
file | exceptions.py [code] |
file | Request.h [code] |
file | request.py [code] |
file | Spine.cpp [code] |
file | Spine.h [code] |
file | spine_interface.py [code] |
file | StateMachine.cpp [code] |
file | StateMachine.h [code] |
+ vulp
+ 2.4.0
+
+ |
+
+Files | |
file | bullet_utils.h [code] |
file | BulletContactData.h [code] |
file | BulletImuData.h [code] |
file | BulletInterface.cpp [code] |
file | BulletInterface.h [code] |
file | BulletJointProperties.h [code] |
file | default_action.h [code] |
file | ImuData.h [code] |
file | Interface.cpp [code] |
file | Interface.h [code] |
file | MockInterface.cpp [code] |
file | MockInterface.h [code] |
file | Pi3HatInterface.cpp [code] |
file | Pi3HatInterface.h [code] |
file | resolution.h [code] |
file | ServoLayout.h [code] |
+ vulp
+ 2.4.0
+
+ |
+
+ vulp
+ 2.4.0
+
+ |
+
+Directories | |
directory | sources |
+Files | |
file | HistoryObserver.h [code] |
file | observe_servos.cpp [code] |
file | observe_servos.h [code] |
file | observe_time.h [code] |
file | Observer.h [code] |
file | ObserverPipeline.cpp [code] |
file | ObserverPipeline.h [code] |
file | Source.h [code] |
+ vulp
+ 2.4.0
+
+ |
+
Go to the source code of this file.
++Classes | |
class | vulp.spine.exceptions.VulpException |
Base class for exceptions raised by Vulp. More... | |
class | vulp.spine.exceptions.PerformanceIssue |
Exception raised when a performance issue is detected. More... | |
class | vulp.spine.exceptions.SpineError |
Exception raised when the spine sets an error flag in the request field of the shared memory map. More... | |
+Namespaces | |
vulp.spine.exceptions | |
+ vulp
+ 2.4.0
+
+ |
+
+ vulp
+ 2.4.0
+
+ |
+
+ vulp
+ 2.4.0
+
+ |
+
+ vulp
+ 2.4.0
+
+ |
+
+ vulp
+ 2.4.0
+
+ |
+
+ vulp
+ 2.4.0
+
+ |
+
+ vulp
+ 2.4.0
+
+ |
+
+ vulp
+ 2.4.0
+
+ |
+
+ vulp
+ 2.4.0
+
+ |
+
+ vulp
+ 2.4.0
+
+ |
+
This page explains how to interpret the graphs that are generated by doxygen.
+Consider the following example:
This will result in the following graph:
+The boxes in the above graph have the following meaning:
+The arrows have the following meaning:
+
+ vulp
+ 2.4.0
+
+ |
+
#include "vulp/utils/handle_interrupts.h"
Go to the source code of this file.
++Namespaces | |
vulp | |
vulp.utils | |
Utility functions. | |
vulp::utils::internal | |
+Functions | |
void | vulp::utils::internal::handle_interrupt (int _) |
Internal handler to set interrupt_flag. More... | |
const bool & | vulp.utils::handle_interrupts () |
Redirect interrupts to setting a global interrupt boolean. More... | |
+Variables | |
bool | vulp::utils::internal::interrupt_flag = false |
Internal interrupt flag. More... | |
+ vulp
+ 2.4.0
+
+ |
+
+ vulp
+ 2.4.0
+
+ |
+
#include <signal.h>
#include <cstddef>
Go to the source code of this file.
++Namespaces | |
vulp | |
vulp.utils | |
Utility functions. | |
vulp::utils::internal | |
+Functions | |
void | vulp::utils::internal::handle_interrupt (int _) |
Internal handler to set interrupt_flag. More... | |
const bool & | vulp.utils::handle_interrupts () |
Redirect interrupts to setting a global interrupt boolean. More... | |
+ vulp
+ 2.4.0
+
+ |
+
+ vulp
+ 2.4.0
+
+ |
+
Cvulp.spine::AgentInterface | Memory map to shared memory |
Cvulp::actuation::BulletContactData | Contact information for a single link |
Cvulp::actuation::BulletJointProperties | Properties for robot joints in the Bullet simulation |
Cvulp::control::Controller | Base class for controllers |
▼CException | |
▼Cvulp.spine.exceptions.VulpException | Base class for exceptions raised by Vulp |
Cvulp.spine.exceptions.PerformanceIssue | Exception raised when a performance issue is detected |
Cvulp.spine.exceptions.SpineError | Exception raised when the spine sets an error flag in the request field of the shared memory map |
▼Cvulp::actuation::ImuData | Data filtered from an onboard IMU such as the pi3hat's |
Cvulp::actuation::BulletImuData | |
▼Cvulp::actuation::Interface | Base class for actuation interfaces |
Cvulp::actuation::BulletInterface | Actuation interface for the Bullet simulator |
Cvulp::actuation::MockInterface | |
Cvulp::actuation::Pi3HatInterface | Interface to moteus controllers |
▼Cvulp::observation::Observer | Base class for observers |
Cvulp::observation::HistoryObserver< T > | Report high-frequency history vectors to lower-frequency agents |
Cvulp::observation::ObserverPipeline | Observer pipeline |
Cvulp::actuation::BulletInterface::Parameters | Interface parameters |
Cvulp.spine::Spine::Parameters | Spine parameters |
Cvulp::actuation::ServoLayout | Map between servos, their busses and the joints they actuate |
▼Cvulp::observation::Source | Base class for sources |
Cvulp::observation::sources::CpuTemperature | Source for CPU temperature readings |
Cvulp::observation::sources::Joystick | Source for a joystick controller |
Cvulp::observation::sources::Keyboard | Source for reading Keyboard inputs |
Cvulp.spine::Spine | Loop transmitting actions to the actuation and observations to the agent |
Cvulp.spine.spine_interface.SpineInterface | Interface to interact with a spine from a Python agent |
Cvulp.spine::StateMachine | Spine state machine |
Cvulp.utils::SynchronousClock | Synchronous (blocking) clock |
▼CIntEnum | |
Cvulp.spine.request.Request | Flag set by the agent to request an operation from the spine |
+ vulp
+ 2.4.0
+
+ |
+
Vulp provides an action-observation loop to control robots from a standalone "agent" process, like this:
+ +
The agent can be a simple Python script with few dependencies.
+Vulp is designed for robots built with the mjbots stack (moteus servo controllers and pi3hat communication board). It provides a robot/simulation switch to train or test agents in Bullet before running them on the real system.
+Vulp supports Linux and macOS for development, and Raspberry Pi OS for robot deployment.
+Check out the upkie
repository for an example where Vulp is used to implement simulation environments, real-robot spines, state observers and locomotion agents.
More accurately, Vulp is a tiny inter-process communication (IPC) protocol shipped with reference libraries (currently in Python and C++, other languages welcome). It is suitable for tasks that require real-time but not high-frequency performance. The main use case for this is balancing, as there is theoretical and empirical evidence suggesting that bipeds and quadrupeds can balance themselves as leisurely as 5–15 Hz, although balance control is frequently implemented at 200–1000 Hz. And if you are wondering whether Python is suitable for real-time applications, we were too! Until we tried it out.
+In Vulp, a fast program, called a spine, talks to a slow program, called an agent, in a standard action-observation loop. Spine and agent run in separate processes and exchange action
and observation
dictionaries through shared memory. For instance, action
can be a set of joint commands and observation
a set of joint observations. Vulp provides a pipeline API to grow more complex spines with additional controllers (for higher-level actions) and observers (for richer observations). For example, a spine can run an inverse kinematics solver, or output its own ground contact estimation.
All design decisions have their pros and cons. Take a look at the features and non-features below to decide if Vulp is a fit to your use case.
+If any of the non-features is a no-go to you, you may also want to check out these existing alternatives:
+ControllerInterface
implementing the dictionary-based IPC protocol.If your robot is built with some of the following open hardware components, you can also use their corresponding Python bindings directly:
+Using control bindings directly is a simpler alternative if you don't need the action-observation loop and simulation/real-robot switch from Vulp.
+Python agents talk with Vulp spines via the SpineInterface
, which can process both actions and observations in about 0.7 ± 0.3 ms. This leaves plenty of room to implement other control components in a low-frequency loop. You may also be surprised at how Python performance has improved in recent years (most "tricks" that were popular ten years ago have been optimized away in CPython 3.8+). To consider one data point, here are the cycle periods measured in a complete Python agent for Upkie (the Pink balancer from upkie
) running on a Raspberry Pi 4 Model B (Quad core ARM Cortex-A72 @ 1.5GHz). It performs non-trivial tasks like balancing and whole-body inverse kinematics by quadratic programming:
Note that the aforementioned 0.7 ± 0.3 ms processing time happens on the Python side, and is thus included in the 5.0 ms cycles represented by the orange curve. Meanwhile the spine is set to a reference frequency of 1.0 kHz and its corresponding cycle period was measured here at 1.0 ± 0.05 ms.
+Make sure you switch Bazel's compilation mode to "opt" when running both robot experiments and simulations. The compilation mode is "fastbuild" by default. Note that it is totally fine to compile agents in "fastbuild" during development while testing them on a spine compiled in "opt" that keeps running in the background.
+This happens when your CPU is not powerful enough to run the simulator in real-time along with your agent and spine. You can call Spine::simulate
with nb_substeps = 1
instead of Spine::run
, which will result in the correct simulation time from the agent's point of view but make the simulation slower than real-time from your point of view.
Make sure you configure CPU isolation and set the scaling governor to performance
for real-time performance on a Raspberry Pi.
Interface description languages like Protocol Buffers are strongly typed: they formally specify a data exchange format that has to be written down and maintained, but brings benefits like versioning or breaking-change detection. Vulp, on the other hand, follows a weakly-typed, self-describing approach that is better suited to prototyping with rapidly-changing APIs: the spec is in the code. If an agent and spine communicate with incompatible/incomplete actions/observations, execution will break, begging for developers to fix it.
+Vulp is designed for prototyping: it strives to eliminate intermediaries when it can, and keep a low barrier of entry. Python bindings bring the benefits of typing and are a good choice in production contexts, but like interface description languages, they also add overhead in terms of developer training, bookkeeping code and compilation time. Vulp rather goes for a crash-early approach: fast changes, fast blunders (interface errors raise exceptions that end execution), fast fixes (know immediately when an error was introduced).
+That is not possible. One of the core assumptions in Vulp is that the agent and the spine are two respective processes communicating via one single shared-memory area. In this Vulp differs from e.g. ROS, which is multi-process by design. This design choice is discussed in #55.
+Vulp means "fox" in Romansh, a language spoken in the Swiss canton of the Grisons. Foxes are arguably quite reliable in their reaction times 🦊
+
+ vulp
+ 2.4.0
+
+ |
+
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
+ vulp
+ 2.4.0
+
+ |
+
#include <stdexcept>
#include <string>
#include "vulp/exceptions/FilterError.h"
Go to the source code of this file.
++Namespaces | |
vulp | |
vulp.utils | |
Utility functions. | |
+Functions | |
double | vulp.utils::low_pass_filter (double prev_output, double cutoff_period, double new_input, double dt) |
Low-pass filter as an inline function. More... | |