How to write file using model plugin?
Using coding as following:
public:
void Load(physics::ModelPtr _parent, sdf::ElementPtr _sdf) {
this->model = _parent;
this->updateConnection = event::Events::ConnectWorldUpdateBegin(
boost::bind(&ModelPluginTutorial::OnUpdate, this, _1));
std::ofstream file("Angle.txt");
for (int i = 0; i < N; i++) {
file << position[i] << std::endl;
}
file.close();
}
However things turned out unexpected,there are no file generated.who can help me out of this problem?