22 #ifndef PSI_CYLINDER_WORLD_H
23 #define PSI_CYLINDER_WORLD_H
44 #include <boost/shared_ptr.hpp>
66 virtual void render()
const;
92 double rad = heading_;
111 pos_ += distance * dir_;
137 struct Action_context
143 std::vector<double> memory;
145 typedef boost::shared_ptr<Action_context> Action_context_ptr;
150 sampling_period_(0.5)
154 const std::vector<std::vector<Start_state> >& start_state,
156 const std::vector<std::vector<std::vector<Action> > >& actions
171 return entity_states_;
177 sampling_period_ = 1/
r;
213 switch(context.action->type)
242 Action_context& context
254 Action_context& context
268 Action_context& context
283 Action_context& context
300 Action_context& context
304 double round(
double a)
309 size_t duration_to_samples(
double length)
311 return round(length * sampling_rate_) + 1;
315 std::vector<std::vector<std::vector<Entity_state> > > entity_states_;
317 double sampling_rate_;
318 double sampling_period_;
Entity_state()
Definition: psi_cylinder_world.cpp:115
void set_heading(double heading)
direction in radians
Definition: psi_cylinder_world.h:88
void set_height(double h)
Definition: psi_cylinder_world.h:101
bool simulate(const std::vector< std::vector< Start_state > > &start_state, const std::vector< std::vector< std::vector< Action > > > &actions)
Definition: psi_cylinder_world.cpp:177
void set_sampling_rate(double r)
Definition: psi_cylinder_world.h:174
Class that represents an axis-aligned 2D rectangle. It is defined in terms of its (2D) center...
Definition: gr_2D_bounding_box.h:51
double get_actions_length(const std::vector< Action > &actions)
return the length of simulation, as defined by a sequence of extended actions
Definition: psi_cylinder_world.cpp:376
kjb::Vector get_direction_3d() const
Definition: psi_cylinder_world.h:78
void execute_follow_action(size_t time, Action_context &context)
Definition: psi_cylinder_world.cpp:531
void execute_walk_action(size_t time, Action_context &context)
Definition: psi_cylinder_world.cpp:443
r
Definition: APPgetLargeConnectedEdges.m:127
Definition: psi_action.h:58
double get_width() const
Definition: psi_cylinder_world.h:83
This class implements vectors, in the linear-algebra sense, with real-valued elements.
Definition: m_vector.h:87
std::vector< double > quantize_walk_through_points_action(const std::vector< double > ¶meters)
size_t length(const C &cner)
Counts the total number of elements in a 2D STL-style container.
Definition: l_util.h:17
St_perspective_camera for modeling a perspective camera using the classic Forsyth and Ponce parametri...
void execute_walk_through_points_action(size_t time, Action_context &context)
Definition: psi_cylinder_world.cpp:491
void execute_walk_in_arc_action(size_t time, Action_context &context)
Definition: psi_cylinder_world.cpp:462
Bbox get_bounding_box(const std::vector< kjb::Vector > &points_3d, const kjb::Perspective_camera &cam)
Definition: psi_bbox.cpp:172
std::vector< size_t > quantize_action_durations(const std::vector< Action > &actions)
Definition: psi_cylinder_world.cpp:396
St_perspective_camera for modeling a perspective camera using the classic Forsyth and Ponce parametri...
const kjb::Vector & get_direction() const
Definition: psi_cylinder_world.h:77
const kjb::Vector & get_position() const
Definition: psi_cylinder_world.h:74
Definition: psi_action.h:58
Definition: psi_cylinder_world.h:61
void execute_action(size_t time, Action_context &context)
Definition: psi_cylinder_world.h:211
Int_matrix floor(const Matrix &m)
Definition: m_matrix.cpp:2026
Definition: perspective_camera.h:93
Definition: psi_cylinder_world.h:133
Simple_simulator()
Definition: psi_cylinder_world.h:148
Definition: psi_action.h:59
#define KJB_THROW_2(ex, msg)
Definition: l_exception.h:48
double get_height() const
Definition: psi_cylinder_world.h:82
virtual void render() const
Definition: psi_cylinder_world.cpp:123
void set_width(double w)
Definition: psi_cylinder_world.h:102
double get_heading() const
Definition: psi_cylinder_world.h:80
Definition: psi_action.h:76
Object thrown when an argument to a function is not acceptable.
Definition: l_exception.h:377
Definition: g_cylinder.h:32
void set_position(const kjb::Vector &p)
Definition: psi_cylinder_world.h:85
kjb::Cylinder get_cylinder() const
Definition: psi_cylinder_world.h:67
Definition: psi_action.h:58
void move_forward(double distance)
Definition: psi_cylinder_world.h:109
Definition for the Vector class, a thin wrapper on the KJB Vector struct and its related functionalit...
const std::vector< std::vector< std::vector< Entity_state > > > & get_entity_states() const
returns 2d array or entity states, indexed by states[actor][frame]
Definition: psi_cylinder_world.h:169
Definition: psi_action.h:58
kjb::Vector get_position_3d() const
Definition: psi_cylinder_world.h:75
void execute_null_action(size_t time, Action_context &context)
Definition: psi_cylinder_world.cpp:429