12 using namespace se2ez;
24 mrobot_->addActiveRobot(arobot);
34 auto state = std::make_shared<State>(robot);
41 .emplace(std::piecewise_construct,
44 SE2EZ_WARN(
"Robot Named %1 already exists thus it is not added", name);
53 for (
const auto &entry :
robots_)
54 mrobot_->addFixedRobot(entry.second.robot, entry.second.state, entry.first);
60 for (
const auto &r1 : robots_)
61 for (
const auto &f1 : r1.second.robot->getFrameNames())
62 for (
const auto &r2 : robots_)
63 for (
const auto &f2 : r2.second.robot->getFrameNames())
64 mrobot_->getACM()->disable(r1.first +
":" + f1, r2.first +
":" + f2);
74 SE2EZ_WARN(
"Robot Named:%1, does not exist in Scene", name);
108 const auto &result =
robots_.find(name);
112 return result->second.robot;
118 for (
const auto &entry :
robots_)
126 for (
const auto &entry :
robots_)
127 entry.second.state->setRandom(entry.second.robot);
RobotData(const RobotPtr &r, const StatePtr &s)
Constructor.
A shared pointer wrapper for se2ez::State.
T forward_as_tuple(T... args)
const RobotPtr & getSceneRobot()
Returns a new aggregated robot including all the passive and active robots.
Scene(const RobotPtr &arobot)
Constructor. Nothing interesting right now.
const std::vector< std::string > getRobotNames()
Gets the all the names of the robots active and passive.
const RobotPtr & getRobot(const std::string &name)
Returns robot the robot named name, throws error otherwise.
void addRobot(const RobotPtr &robot, const std::string &name)
Attach a robot as passive to the scene at a zero state.
void compileScene()
creates the scene, is called after a robot is added.
A representation of a robot (in this case, a kinematic tree in the plane).
bool dirty
Does the scene robot need updating?
std::map< std::string, RobotData > robots_
Map of robots and their names.
void removeRobot(const std::string &name)
Removes the specific robot from the Scene.
#define SE2EZ_WARN(fmt,...)
void setRandom()
Sets every passive robot to a random state.
A shared pointer wrapper for se2ez::Robot.
std::string format(const std::string &fmt, Args &&... args)
const std::string & getSignature()
Returns the mrobot signature.
const RobotPtr & getActiveRobot()
Returns a the active robot.
const RobotPtr arobot_
Active Robot.
void clear()
Completely clears internal structures, a brand new scene!
RobotPtr mrobot_
Mega Robot.
T emplace_back(T... args)