Esempio n. 1
0
int tutsim::
run(bool (*_servo_cb)(size_t toggle_count,
		      double wall_time_ms,
		      double sim_time_ms,
		      jspace::State & state,
		      jspace::Vector & command))
{
  if (gfx_rate_hz <= 0.0) {
    errx(EXIT_FAILURE, "invalid gfx_rate_hz %g (must be > 0)", gfx_rate_hz);
  }
  if (servo_rate_hz <= 0.0) {
    errx(EXIT_FAILURE, "invalid servo_rate_hz %g (must be > 0)", servo_rate_hz);
  }
  
  try {
    jspace::test::BRParser brp;
    boost::shared_ptr<jspace::test::BranchingRepresentation> brep(brp.parse(robot_filename));
    sim_tree.reset(brep->createTreeInfo());
    brep.reset(brp.parse(robot_filename));
    scratch_tree.reset(brep->createTreeInfo());
  }
  catch (std::runtime_error const & ee) {
    errx(EXIT_FAILURE, "%s", ee.what());
  }
  
  servo_cb = _servo_cb;
  ndof = sim_tree->info.size();
  state.init(ndof, ndof, ndof);
  write_state_to_tree(*sim_tree);
  
  Window win(win_width, win_height, win_title);
  return Fl::run();
}
 static BranchingRepresentation * _create_brep(create_xml_t create_xml) throw(runtime_error)
 {
   string const xml_filename(create_xml());
   BRParser brp;
   BranchingRepresentation * brep(brp.parse(xml_filename));
   return brep;
 }
Esempio n. 3
0
// 与えられた変換で曲面のトランスフォームを行いオブジェクトを生成する。
MGSBRep MGSBRep::operator* ( const MGTransf & tr) const{
	MGSBRep brep(*this);
	brep.m_surface_bcoef *= tr;
	return brep;
}
Esempio n. 4
0
// 与えられた変換で曲面の変換を行いオブジェクトを生成する。
MGSBRep MGSBRep::operator* ( const MGMatrix& mat ) const{
	MGSBRep brep(*this);
	brep.m_surface_bcoef *= mat;
	return brep;
}
Esempio n. 5
0
// 曲面の逆方向に平行移動を行いオブジェクトを生成する。
MGSBRep MGSBRep::operator- ( const MGVector& vec) const{
	MGSBRep brep(*this);
	brep.m_surface_bcoef -= vec;
	return brep;
}