iCub-main
BlenderSimulation.h
Go to the documentation of this file.
1 // -*- mode:C++; tab-width:4; c-basic-offset:4; indent-tabs-mode:nil -*-
2 /*
3 * Copyright (C) Paul Fitzpatrick
4 * CopyPolicy: Released under the terms of the GNU GPL v2.0.
5 *
6 */
7 
8 #ifndef ICUBSIMULATION_BLENDERSIMULATION_INC
9 #define ICUBSIMULATION_BLENDERSIMULATION_INC
10 
11 #include "Simulation.h"
12 
13 #include <yarp/os/Time.h>
14 
15 class BlenderSimulation : public Simulation {
16 public:
17  virtual void init(RobotStreamer *streamer, RobotConfig *config) {}
18 
19  virtual void drawView(bool left, bool right, bool wide) {}
20 
21  virtual bool getImage(yarp::sig::ImageOf<yarp::sig::PixelRgb>& img) {
22  img.resize(320,240);
23  img.zero();
24  return true;
25  }
26 
27  virtual void clearBuffer() {
28  }
29 
30  virtual void simLoop(int h,int w) {
31  int n = 60;
32  for (int i=0; i<n; i++) {
33  printf("Fake simulation cycle %d of %d\n", i+1, n);
34  yarp::os::Time::delay(1);
35  }
36  }
37 
38  virtual bool checkSync(bool reset) {
39  return true;
40  }
41 };
42 
43 #endif
BlenderSimulation::init
virtual void init(RobotStreamer *streamer, RobotConfig *config)
Initialization.
Definition: BlenderSimulation.h:17
h
h
Definition: compute_ekf_sym.m:23
Simulation.h
RobotConfig
Definition: RobotConfig.h:55
BlenderSimulation::simLoop
virtual void simLoop(int h, int w)
Run the simulation.
Definition: BlenderSimulation.h:30
BlenderSimulation::clearBuffer
virtual void clearBuffer()
Signal that we're done with a view.
Definition: BlenderSimulation.h:27
BlenderSimulation
Definition: BlenderSimulation.h:15
BlenderSimulation::checkSync
virtual bool checkSync(bool reset)
Definition: BlenderSimulation.h:38
RobotStreamer
Definition: RobotStreamer.h:29
BlenderSimulation::drawView
virtual void drawView(bool left, bool right, bool wide)
Render the requested view.
Definition: BlenderSimulation.h:19
n
int n
Definition: debugFunctions.cpp:58
Simulation
Definition: Simulation.h:28
BlenderSimulation::getImage
virtual bool getImage(yarp::sig::ImageOf< yarp::sig::PixelRgb > &img)
Definition: BlenderSimulation.h:21