raisim::server
namespace
Namespaces
Classes
classBoundedWriter — Internal: write position in a bounded buffer.classDeserializationError — A malformed bounded wire payload.classReadCursor — Internal: bounds-checked reader over an incoming wire payload.classSceneFileServer — Internal: serves the files of a RaiSim Engine scene to a viewer.classSerializationError — Internal: thrown when a server frame would overflow its BoundedWriter.structTendonVisualInstance — Renderer-independent transform of one tendon segment, expressed for a radius-one, length-one cylinder along Z.
Type aliases
WriteOutput
#include <raisim/server/SerializationHelper.hpp>
template <typename Out>
using WriteOutput = std::enable_if_t<std::is_same_v<Out, char *>||std::is_same_v<Out, BoundedWriter>, Out>Internal: the output types the writers accept, an unchecked char* or a BoundedWriter.
Functions
colorText
#include <raisim/RaisimServer.hpp>
std::string colorText(const Vec<4> &color)Returns a color as the viewer reads it: "%f, %f, %f, %f" with a '.' decimal point, whatever locale the application set (the viewer reads it in the classic locale)
appendBytes
#include <raisim/server/SerializationHelper.hpp>
static char *appendBytes(char *data, const void *source, size_t bytes)Internal: copy bytes to data (unchecked) and return the position after them.
static BoundedWriter appendBytes(
BoundedWriter data,
const void *source,
size_t bytes)Internal: copy bytes to the writer. Throws SerializationError if they do not fit.
set
#include <raisim/server/SerializationHelper.hpp>
template <typename Out, typename T>
static WriteOutput<Out> set(Out data, T val)template <typename Out, int N>
static WriteOutput<Out> set(Out data, const Vec<N> &vec)template <typename Out, int N>
static WriteOutput<Out> set(Out data, const Vec<N> &&vec)template <typename Out>
static WriteOutput<Out> set(Out data, const std::string &val)template <typename Out, typename T>
static WriteOutput<Out> set(Out data, const std::vector<T> &str)template <typename Out>
static WriteOutput<Out> set(Out data, const std::vector<std::string> &str)template <typename Out>
static WriteOutput<Out> set(Out data, const VecDyn &vec)template <typename Out>
static WriteOutput<Out> set(Out data, const std::vector<VecDyn> &vecs)template <typename Out, typename T, typename... Types>
static WriteOutput<Out> set(Out data, const T &arg, Types... args)setN
#include <raisim/server/SerializationHelper.hpp>
template <typename Out, typename T>
static WriteOutput<Out> setN(Out data, const T *val, int64_t N)appendInFloat
#include <raisim/server/SerializationHelper.hpp>
template <typename Out, typename Values>
static WriteOutput<Out> appendInFloat(Out data, const Values &values)setInFloat
#include <raisim/server/SerializationHelper.hpp>
template <typename Out, size_t N>
static WriteOutput<Out> setInFloat(Out data, const Vec<N> &vec)template <typename Out, size_t N, size_t M>
static WriteOutput<Out> setInFloat(
Out data,
const Vec<N> &first,
const Vec<M> &second)template <typename Out>
static WriteOutput<Out> setInFloat(Out data, double val)template <typename Out>
static WriteOutput<Out> setInFloat(Out data, const std::vector<double> &val)template <typename Out, typename T>
static WriteOutput<Out> setInFloat(Out data, const T &val)template <typename Out, typename T, typename... Types>
static WriteOutput<Out> setInFloat(Out data, const T &arg, Types... args)get
#include <raisim/server/SerializationHelper.hpp>
template <typename T>
static char *get(char *data, T *val)static char *get(char *data, std::string *str)template <typename T>
static char *get(char *data, std::vector<T> *vec)template <typename T, typename... Types>
static char *get(char *data, T *arg, Types... args)template <typename T>
static void get(ReadCursor &reader, T *val)static void get(ReadCursor &reader, std::string *str)template <typename T>
static void get(ReadCursor &reader, std::vector<T> *vec)template <typename T, typename... Types>
static void get(ReadCursor &reader, T *arg, Types *... args)getInFloat
#include <raisim/server/SerializationHelper.hpp>
template <typename T>
static char *getInFloat(char *data, T *val)static char *getInFloat(char *data, double *val)template <typename T, typename... Types>
static char *getInFloat(char *data, T *arg, Types... args)template <typename T>
static void getInFloat(ReadCursor &reader, T *val)static void getInFloat(ReadCursor &reader, double *val)template <typename T, typename... Types>
static void getInFloat(ReadCursor &reader, T *arg, Types *... args)getN
#include <raisim/server/SerializationHelper.hpp>
template <typename T>
static char *getN(char *data, T *val, int32_t N)template <typename T>
static void getN(ReadCursor &reader, T *val, int32_t count)buildTendonVisualInstances
#include <raisim/server/TendonVisuals.hpp>
void buildTendonVisualInstances(
const Tendon &tendon,
std::vector<TendonVisualInstance> &instances,
std::vector<Tendon::VisualSegment> &segments)Build the renderer-independent transforms for a radius-one, length-one Z cylinder. Each segment is independent: pulley branches must never be joined by a line. Only visualization consumers call this; it adds no simulation-step work and never writes to the tendon, so a renderer cannot perturb the length, velocity or gradients the physics thread reads. Callers still hold the world lock, as for every other object read in the server update. Produces nothing for non-spatial or disabled tendons, a non-positive width or a transparent color; degenerate or non-finite segments are skipped.
Parameters
| Parameter | Description |
|---|---|
tendon (in) | the tendon to visualize |
instances (out) | one transform per drawable segment (cleared first) |
segments (out) | scratch storage for the tendon's visual segments (cleared first) |