1 #ifndef SIMULATION_GUI_H 2 #define SIMULATION_GUI_H 4 #include <Klampt/Simulation/Simulator.h> 53 virtual bool OnCommand(
const string& cmd,
const string& args);
98 void DrawContacts(Real pointSize = 5.0, Real fscale = 0.01, Real nscale=0.05);
113 bool LoadMultiPath(
const char* fn,
bool constrainedInterpolate=
true,Real interpolateTolerance=1e-2,Real durationScale=1.0);
117 bool SendLinearPath(
const vector<Real>& times,
const vector<Config>& milestones,Real pathDelay=0.1);
120 bool OutputROS(
const char* prefix=
"klampt");
123 void DoLogging(
const char* fn=
"simtest_log.csv");
bool LoadMultiPath(const char *fn, bool constrainedInterpolate=true, Real interpolateTolerance=1e-2, Real durationScale=1.0)
Loads a multipath file and possibly discretizes it into a fine-grained linear path before sending...
void SetTorqueColors()
Sets the colors of robots to indicate torque magnitudes.
void DrawWrenches(Real fscale=-1)
Draws wrenches.
void DrawContacts(Real pointSize=5.0, Real fscale=0.01, Real nscale=0.05)
Draws contact points.
Generic simulation program.
Definition: SimulationGUI.h:38
virtual void RenderWorld()
Renders the state of the simulation.
A physical simulator for a WorldModel.
Definition: Simulator.h:69
void DoSensorLogging_LinearPath(int robot, const char *fn="simtest_sensed_log.path")
Logs the robot's sensed configuration to the given linear path file.
void DoStateLogging_LinearPath(int robot, const char *fn="simtest_state_log.path")
Logs the robot's simulation state to the given linear path file.
A backend that processes mouse motion calls into dragging callbacks. Makes it a bit easier to determi...
Definition: NavigationGUI.h:15
void ConnectSerialController(int robot, int port=3456, Real writeRate=10)
Connects a robot to a SerialController listening for new connections on the given port...
void DoContactWrenchLogging(const char *fn="simtest_wrench_log.csv")
Logs contact wrenches to the given CSV file.
bool LoadFile(const char *fn)
Loads some file, figuring out the type from the extension.
void DrawClock(int x, int y)
Renders the simulation clock (when in screen mode)
void SetForceColors()
Sets the colors of robots to indicate force magnitudes.
bool LoadPath(const char *fn)
Loads some file, figuring out the type from the extension.
bool LoadState(const char *fn)
Loads a simulation state file.
bool SendLinearPath(const vector< Real > ×, const vector< Config > &milestones, Real pathDelay=0.1)
bool OutputROS(const char *prefix="klampt")
Outputs simulation data to ROS with the given prefix.
void DrawSensor(int robot=-1, int sensor=-1)
virtual void InitController(int robot)
Initializes default controllers and sensors for the indicated robot.
void DoContactStateLogging(const char *fn="simtest_contact_log.csv")
Logs contact changes to the given CSV file.
virtual void InitContactFeedbackAll()
Initializes all contact feedback.
set< pair< int, int > > inContact
the contact state on the last DoContactStateLogging call
Definition: SimulationGUI.h:47
bool LoadLinearPath(const char *fn)
Loads and sends a linear path file.
void ResetSim()
Returns the simulation to its initial state.
virtual void InitSim()
Initializes simulation default controllers, sensors, and contact feedback.
void DoCommandLogging_LinearPath(int robot, const char *fn="simtest_command_log.path")
Logs the robot's commands to the given linear path file.
bool LoadAndInitSim(const char *xmlFile)
Loads from a world XML file.
A generic gui with a WorldModel which allows clicking on entities and loading files.
Definition: WorldGUI.h:23
A backend that manages a camera and performs OpenGL scene management.
Definition: NavigationGUI.h:51
Definition: ContactDistance.h:6
void DoLogging(const char *fn="simtest_log.csv")
Logs the state of all objects in the world to the given CSV file.
bool LoadMilestones(const char *fn)
Loads and sends a milestone path file.
The main world class containing multiple robots, objects, and static geometries (terrains). Lights and other viewport information may also be stored here.
Definition: World.h:24