bool MotionPlayer::init(robotcontrol::RobotModel* model)
{
	if (! robotcontrol::MotionModule::init(model))
		return false;


	fs::path p((ros::package::getPath("launch") + "/motions"));
	if (! loadMotionFiles(p))
		return false;

	m_model = model;

	m_state_prone   = m_model->registerState("prone");
	m_state_supine  = m_model->registerState("supine");
	m_state_init    = m_model->registerState("init");
	m_state_relaxed = m_model->registerState("relaxed");

	initMotions();
	m_cmdPositions.resize(model->numJoints());
	m_cmdEffort.resize(model->numJoints());

	/*
	 * 	Change the initial Pose of the Robot from standing (zero-positions) to
	 * 	a sitting pose
	 */

	motion_player::PlayMotion initPose;
	initPose.request.name = "INIT_POSE";
	handlePlay(initPose.request, initPose.response);

	return true;
}
示例#2
0
//-----------------------------------------------------------------------------------------------------
void Section::init(int w,int h,int s,int vw,int vh){
	
	debug = true;

	if(debug) cout << "[[Section::init]] begin" << endl;
	//set dimensions
	screens = s;
	width = w;
	height = h;
	viewportWidth = vw;
	viewportHeight = vh ;

	//transition
	fadeOverlayAlpha = 255 ;
	fadeStep  = 10;
	fadeInFlag = false;
	fadeOutFlag = false;
	fadeOveylayOn = false;

	//get ready before play
	loading = false;
	
	initScreens();
	initMotions();
	 
	drawingCtrlView = false;
	ctrlScreen=0;
	logosSetup();
	contentManager.setSectionListener(this);

	//pause feature 
	pausedFrame=0;
	pausedToggle=false;


	if(debug) cout << "[[Section::init]] end" << endl;
}