void MyController::onInit(InitEvent &evt) 
{  
  m_my = getRobotObj(myname());

  // 初期位置取得
  m_my->getPosition(m_inipos);

  // 車輪の半径と車輪間隔距離
  m_radius = 10.0;
  m_distance = 10.0;

  m_time = 0.0;

  // 車輪の半径と車輪間距離設定
  m_my->setWheel(m_radius, m_distance);
  m_state = 0;

  // ここではゴミの名前が分かっているとします
  m_trashes.push_back("can_0");  
  m_trashes.push_back("can_1");  
  m_trashes.push_back("petbottle_0");

  srand((unsigned)time( NULL ));

  // 車輪の回転速度
  m_vel = 0.3;

  // 関節の回転速度
  m_jvel = 0.6;
}  
Ejemplo n.º 2
0
void RobotController::onInit(InitEvent &evt)
{
	joint_veloc = 0.8;

	my = getRobotObj(myname());

	// 車輪間距離
	m_distance = 10.0;

	// 車輪半径
	m_radius  = 10.0;

	// 車輪の半径と車輪間距離設定
	my->setWheel(m_radius, m_distance);

	m_grasp_left = false;
	Change_Robot_speed = 5; // to change the robot's velocity
	Robot_speed  = Change_Robot_speed;
	m_state = 0;

	// objects position
	m_BottleFront = Vector3d(40.0, 30, -40.0);
	m_MuccupFront = Vector3d(0.0, 30, -40.0);
	m_CanFront = Vector3d(-40.0, 30, -40.0);

	// trashBoxs position
	m_BurnableFront = Vector3d(-120.0, 30, -60);
	m_UnburnableFront = Vector3d(-120.0, 30, 70);
	m_RecycleFront = Vector3d(-60.0, 30, -100);

	m_relayPoint1 = Vector3d(100, 30, -70);
	m_relayPoint2 = Vector3d(0, 30, -70);
	m_relayFrontTable = Vector3d(0, 30,-20);

	m_relayFrontTable_reset = Vector3d(-80, 30,-50);
	m_relayFrontTrash = Vector3d(-80, 30, -80);

	cycle = 27;

	m_onActionReturn = 0.01;

	srand((unsigned)time( NULL ));

	// grasp初期化
	m_grasp = false;

	m_trashes.push_back("petbottle");
	m_trashes.push_back("mugcup");
	m_trashes.push_back("can");

	// ゴミ箱登録
	m_trashboxs.push_back("recycle");
	m_trashboxs.push_back("burnable");
	m_trashboxs.push_back("unburnable");
}
Ejemplo n.º 3
0
void CameraController::onInit(InitEvent &evt) 
{  
  // カメラ初期方向 1:45 2:135 3:315 4:225
  // ロボット初期位置取得
  r_my = getRobotObj("robot_004");
  r_my->getPosition(r_pos);

  // カメラ番号取得
  m_my = getObj(myname());  
  m_name = m_my->name();

  // 定点カメラをロボットの方向に回転
  rotateTowardRobot(r_pos);
}
Ejemplo n.º 4
0
void CameraController::onInit(InitEvent &evt)
{
  // カメラ初期方向 1:45 2:135 3:315 4:225
  // ロボット初期位置取得
  r_my = getRobotObj("robot_004");
  r_my->getPosition(r_pos);

  // カメラ番号取得
  m_my = getObj(myname());
  m_my->getPosition(m_rotatePos);
  m_pathPos = Vector3d(m_rotatePos.x() -500, m_rotatePos.y() + 1700, m_rotatePos.z());
  m_name = m_my->name();

  configuringPath = false;

  // 定点カメラをロボットの方向に回転
  // rotateTowardRobot(r_pos);
  rotateTowardGround();

}
void DemoRobotController::onInit(InitEvent &evt)
{
	// get robot's name
	m_robotObject = getRobotObj(myname());

	// set wheel configuration
	m_radius = 10.0;
	m_distance = 10.0;
	m_robotObject->setWheel(m_radius, m_distance);

	m_time = 0.0;
	m_time1 = 0.0;
	m_time4 = 0.0;

	m_state = 10;  // switch of initial behavior
	refreshRateOnAction = 0.1;     // refresh-rate for onAction proc.

	// angular velocity of wheel and moving speed of robot
	m_angularVelocity = 1.5;
	m_movingSpeed = m_angularVelocity*m_radius;  // conversion: rad/ms -> m/ms)

	// rotation speed of joint
	m_jointVelocity = 0.5;

	m_trashName1 = "petbottle_1";
	m_trashName2 = "can_0";

	m_trashBoxName1 = "trashbox_0";  // for recycle
	m_trashBoxName2 = "trashbox_1";  // for burnable

	// set positions;
	m_frontTrashBox1  = Vector3d(-80.0, 0.0, -90);  // for recycle material
	m_frontTrashBox2  = Vector3d( 20.0, 0.0, -90);  // for burnable material
	m_relayPoint1     = Vector3d(190.0, 0.0, -65.0);
	m_frontTrash1     = Vector3d(273.0, 0.0, -65.0);
	m_frontTrash2     = Vector3d(305.0, 0.0, -80.0);

	m_grasp = false;
}
void MyController::onInit(InitEvent &evt) 
{



  start = false;
  elevator = false;
  crowd = false;
  end = false;
  stop = false;

  first = false;
  i=0;

  m_my = getRobotObj(myname());

  // 初期位置取得
  m_my->getPosition(m_inipos);

  // 車輪の半径と車輪間隔距離
  m_radius = 10.0;
  m_distance = 10.0;

  m_time = 0.0;

  // 車輪の半径と車輪間距離設定
  m_my->setWheel(m_radius, m_distance);
  m_state = 0;

  srand((unsigned)time( NULL ));

  // 車輪の回転速度
  m_vel = 0.3;

  // 関節の回転速度
  m_jvel = 0.6;

}  
Ejemplo n.º 7
0
void RobotController::onInit(InitEvent &evt)
{
  m_robotState = 0;
  //エージェントの正面の定義はz軸の正の向きを向いていると仮定する
  m_defaultNormalVector = Vector3d(0,0,1);
  m_onActionReturn = 1.0;
  m_speedDelta = 2.0;

  m_avatar = "man_000";

  m_my = getRobotObj(myname());

  // 初期位置取得
  //m_my->getPosition(m_inipos);
  m_my->getPartsPosition(m_inipos,"RARM_LINK2");

  pos_a = Vector3d(-100, 30, -110);//
  pos_b = Vector3d(0, 30, -110);  ///

  // 車輪間距離
  m_distance = 10.0;

  // 車輪半径
  m_radius  = 10.0;

  // 移動終了時間初期化
  m_time = 0.0;
  m_time_LA1 = 0.0;
  m_time_LA4 = 0.0;
  m_time_RA1 = 0.0;
  m_time_RA4 = 0.0;

  // 車輪の半径と車輪間距離設定
  m_my->setWheel(m_radius, m_distance);
  m_state = 20;

  srand((unsigned)time( NULL ));

  // 車輪の回転速度
  m_vel = 0.3;

  // 関節の回転速度
  m_jvel = 0.6;

  // grasp初期化
  m_grasp = false;
  m_recogSrv = NULL;
  m_sended = false;

  // ここではゴミの名前が分かっているとします
  //m_trashes.push_back("petbottle_0");
  //m_trashes.push_back("petbottle_1");
  //m_trashes.push_back("petbottle_2");
  //m_trashes.push_back("petbottle_3");
  m_trashes.push_back("petbottle");
  //m_trashes.push_back("banana");
  //m_trashes.push_back("chigarette");
  //m_trashes.push_back("chocolate");
  //m_trashes.push_back("mayonaise_0");
  //m_trashes.push_back("mayonaise_1");
  m_trashes.push_back("mugcup");
  //m_trashes.push_back("can_0");
  //m_trashes.push_back("can_1");
  m_trashes.push_back("can");
  //m_trashes.push_back("can_3");

  // ゴミ箱登録
  m_trashboxs.push_back("bluetrashbox");
  m_trashboxs.push_back("redtrashbox");
  m_trashboxs.push_back("greentrashbox");
  m_trashboxs.push_back("wagon");

}
void RobotController::onInit(InitEvent &evt)
{
  m_robotState = 0;
  //エージェントの正面の定義はz軸の正の向きを向いていると仮定する
  m_defaultNormalVector = Vector3d(0,0,1);
  m_onActionReturn = 0.01;
  m_speedDelta = 2.0;

  m_my = getRobotObj(myname());

  // 初期位置取得
  m_my->getPartsPosition(m_inipos,"RARM_LINK2");

	m_relayPoint0 = Vector3d(0, 30, 0);
	m_relayPoint1 = Vector3d(0, 30, 350);
	m_relayPoint2 = Vector3d(-400, 30, 0);
	
	m_kitchenPoint = Vector3d(200, 30, 350);;
	m_bedroomPoint = Vector3d(-400, 30, 200);;
	m_lobbyPoint = Vector3d(-400, 30, -200);;

  // 車輪間距離
  m_distance = 10.0;

  // 車輪半径
  m_radius  = 10.0;

  // 移動終了時間初期化
  m_time = 0.0;
  m_time_LA1 = 0.0;
  m_time_LA4 = 0.0;
  m_time_RA1 = 0.0;
  m_time_RA4 = 0.0;

  // 車輪の半径と車輪間距離設定
  m_my->setWheel(m_radius, m_distance);
  m_state = 0;

  srand((unsigned)time( NULL ));

  // 車輪の回転速度
  m_vel = 1.0;

  // 関節の回転速度
  m_jvel = 1.0;

  // grasp初期化
  m_grasp = false;
  m_recogSrv = NULL;
  m_sended = false;

  // ここではゴミの名前が分かっているとします
  m_trashes.push_back("petbottle_1");
  m_trashes.push_back("can_0");
  m_trashes.push_back("apple");

  // ゴミ箱登録
  m_trashboxs.push_back("trashbox_0");
  m_trashboxs.push_back("trashbox_1");
  m_trashboxs.push_back("trashbox_2");

	broadcastMsgToSrv("Waiting 'start' message\n");

}