示例#1
0
// %Tag(main)%
int main(int argc, char** argv)
{
  ros::init(argc, argv, "basic_controls");
  ros::NodeHandle n;

  // create a timer to update the published transforms
  ros::Timer frame_timer = n.createTimer(ros::Duration(0.01), frameCallback);

  server.reset( new interactive_markers::InteractiveMarkerServer("basic_controls","",false) );

  ros::Duration(0.1).sleep();

  menu_handler.insert( "First Entry", &processFeedback );
  menu_handler.insert( "Second Entry", &processFeedback );
  interactive_markers::MenuHandler::EntryHandle sub_menu_handle = menu_handler.insert( "Submenu" );
  menu_handler.insert( sub_menu_handle, "First Entry", &processFeedback );
  menu_handler.insert( sub_menu_handle, "Second Entry", &processFeedback );

  make6DofMarker( false );
  make6DofMarker( true );
  makeRandomDofMarker( );
  makeViewFacingMarker( );
  makeQuadrocopterMarker( );
  makeChessPieceMarker( );
  makePanTiltMarker( );
  makeMenuMarker( );
  makeMovingMarker( );

  server->applyChanges();

  ros::spin();

  server.reset();
}
示例#2
0
int
main (int argc, char** argv)
{
  // Initialize ROS
  ros::init(argc, argv, "interactive_marker_test");
  ros::NodeHandle n;

  // create a timer to update the published transforms
  ros::Timer frame_timer = n.createTimer(ros::Duration(0.01), frameCallback);

  server.reset( new interactive_markers::InteractiveMarkerServer("interactive_marker_test","",false) );

  ros::Duration(0.1).sleep();

  menu_handler.insert( "First Entry", &processFeedback );
  menu_handler.insert( "Second Entry", &processFeedback );
  interactive_markers::MenuHandler::EntryHandle sub_menu_handle = menu_handler.insert( "Submenu" );
  menu_handler.insert( sub_menu_handle, "First Entry", &processFeedback );
  menu_handler.insert( sub_menu_handle, "Second Entry", &processFeedback );


  makeButtonMarker( );


  server->applyChanges();

  ros::spin();

  server.reset();
}
示例#3
0
// %Tag(main)%
int main(int argc, char** argv)
{
  ros::init(argc, argv, "basic_controls");
  ros::NodeHandle n;

  // create a timer to update the published transforms
  ros::Timer frame_timer = n.createTimer(ros::Duration(0.01), frameCallback);

  server.reset( new interactive_markers::InteractiveMarkerServer("basic_controls","",false) );

  ros::Duration(0.1).sleep();

  menu_handler.insert( "First Entry", &processFeedback );
  menu_handler.insert( "Second Entry", &processFeedback );
  interactive_markers::MenuHandler::EntryHandle sub_menu_handle = menu_handler.insert( "Submenu" );
  menu_handler.insert( sub_menu_handle, "First Entry", &processFeedback );
  menu_handler.insert( sub_menu_handle, "Second Entry", &processFeedback );

  tf::Vector3 position;
  position = tf::Vector3(-3, 3, 0);
  make6DofMarker( false, visualization_msgs::InteractiveMarkerControl::NONE, position, true );
  position = tf::Vector3( 0, 3, 0);
  make6DofMarker( true, visualization_msgs::InteractiveMarkerControl::NONE, position, true );
  position = tf::Vector3( 3, 3, 0);
  makeRandomDofMarker( position );
  position = tf::Vector3(-3, 0, 0);
  make6DofMarker( false, visualization_msgs::InteractiveMarkerControl::ROTATE_3D, position, false );
  position = tf::Vector3( 0, 0, 0);
  make6DofMarker( false, visualization_msgs::InteractiveMarkerControl::MOVE_ROTATE_3D, position, true );
  position = tf::Vector3( 3, 0, 0);
  make6DofMarker( false, visualization_msgs::InteractiveMarkerControl::MOVE_3D, position, false );
  position = tf::Vector3(-3,-3, 0);
  makeViewFacingMarker( position );
  position = tf::Vector3( 0,-3, 0);
  makeQuadrocopterMarker( position );
  position = tf::Vector3( 3,-3, 0);
  makeChessPieceMarker( position );
  position = tf::Vector3(-3,-6, 0);
  makePanTiltMarker( position );
  position = tf::Vector3( 0,-6, 0);
  makeMovingMarker( position );
  position = tf::Vector3( 3,-6, 0);
  makeMenuMarker( position );
  position = tf::Vector3( 0,-9, 0);
  makeButtonMarker( position );

  server->applyChanges();

  ros::spin();

  server.reset();
}
示例#4
0
int main(int argc, char** argv) {
	ros::init(argc, argv, "GUI_planner");
	ros::NodeHandle n;
	cmove_ = new ClopemaMove;
	setPlanningScene();
	server.reset(new interactive_markers::InteractiveMarkerServer("basic_controls", "", false));
	vis_marker_array_publisher_ = n.advertise<visualization_msgs::MarkerArray>("state_validity_markers_array", 128);

	ros::Duration(0.5).sleep();

	menu_handler.insert("Plan", &planTrajectory);
	menu_handler.insert("Visualize trajectory", &visualizeTrajectory);
	menu_handler.insert("Execute trajectory", &executeTrajectory);
	menu_handler.insert("Set to the home position", &setHomePosition);
	interactive_markers::MenuHandler::EntryHandle sub_menu_handle = menu_handler.insert("Servo Power");
	menu_handler.insert(sub_menu_handle, "Turn off", &setServoPowerOff);
	menu_handler.insert(sub_menu_handle, "Turn off - force!", &setServoPowerOffForce);
	menu_handler.insert("Plan & Visualize & Execute & Turn off", &planVisExeOff);

	makeBox(1);
	makeBox(2);
	makeMenuMarker();
	publishRobotState();

	server->applyChanges();
	ros::spin();
	server.reset();
	return stop(1);
}
int main(int argc, char **argv) {
	ros::init(argc, argv, "plan_out_of_vision_tutorial");
	ros::NodeHandle nh;

	server.reset(new interactive_markers::InteractiveMarkerServer("vision_controls", "", false));
	menu_handler.insert("Visualize vision", &visualize);
	menu_handler.insert("Go out of vision - r1_arm", &planR1);
	menu_handler.insert("Go out of vision - r2_arm", &planR2);
	menu_handler.insert("Go out of vision - both", &plan);
	makeMenuMarker();

	server->applyChanges();
	ros::spin();
	server.reset();
	return 1;
}
// %Tag(main)%
int main(int argc, char** argv)
{
  ros::init(argc, argv, "foot_interface", ros::init_options::NoSigintHandler);
  ros::NodeHandle n;
  server.reset( new interactive_markers::InteractiveMarkerServer("foot_interface","",false) );

  ros::Duration(0.1).sleep();
  initTime = ros::Time::now();


  menu_handler.insert("Clean the Path and Refresh the point cloud", &processFeedback );


  interactive_markers::MenuHandler::EntryHandle sub_menu_handle = menu_handler.insert( "Foot step planning part" );
  menu_handler.insert( sub_menu_handle, "Publish Goal Location and A* plan", &processFeedback );
  menu_handler.insert( sub_menu_handle, "Publish Goal Location and Align with block", &processFeedback );
  
  interactive_markers::MenuHandler::EntryHandle sub_menu_handle1 = menu_handler.insert( "Step for Cinder block" );
  menu_handler.insert( sub_menu_handle1, "Plan walk up cinder block", &processFeedback );
  menu_handler.insert( sub_menu_handle1, "Plan walk down cinder block", &processFeedback );
  interactive_markers::MenuHandler::EntryHandle sub_menu_handle2 = menu_handler.insert( "Small foot adjustment" );
  menu_handler.insert( sub_menu_handle2, "small forward", &processFeedback );
  menu_handler.insert( sub_menu_handle2, "small left side walk", &processFeedback );
  menu_handler.insert( sub_menu_handle2, "small right side walk", &processFeedback );
  menu_handler.insert( "Publish the Foot Sequence to ATLAS", &processFeedback );
  
  interactive_markers::MenuHandler::EntryHandle sub_menu_handle3 = menu_handler.insert( "Walking Mode" );
  menu_handler.insert( sub_menu_handle3, "ramp", &processFeedback );
  menu_handler.insert( sub_menu_handle3, "zig_zag", &processFeedback );
  menu_handler.insert( sub_menu_handle3, "walk up cinder block", &processFeedback );
  menu_handler.insert( sub_menu_handle3, "walk down cinder block", &processFeedback );
 
  makeMovingMarker_Goal();
  tf::Vector3 p;
  p = tf::Vector3(0, -1, 0);
  makeMenuMarker(p);
  

      geometry_msgs::Pose position;
      position.position.x = 0+0.045;
      position.position.y = 0;
      position.position.z = 0;
      position.orientation.x = 0;
      position.orientation.y = 0;
      position.orientation.z = 0;
      position.orientation.w = 1;

    std::stringstream ss;
    ss << 1;
    std::string s = ss.str();
  makeMovingMarker(position, s, false, false);
  server->applyChanges();

  goal_location_pub_ = n.advertise<interactive_walk_planner_new::goal_pose>("/interactive_walk_planner_new/goal_pose", 100, true );
  task_mode_pub_ = n.advertise<interactive_walk_planner_new::task_mode>("/interactive_walk_planner_new/task_mode", 100, true );
  replan_message_pub_ = n.advertise<interactive_walk_planner_new::replan>("/interactive_walk_planner_new/replan_message", 100, true );
  ros::Subscriber sub_foot_sequence = n.subscribe<interactive_walk_planner_new::foot_sequence>( "/atlas/planned_foot_sequence", 100, &foot_sequenceCallback );

  //ros::Subscriber sub_ori_estimation = n.subscribe<interactive_walk_planner_new::orientation>( "/orientation_estimation/orientation", 100, &ori_estimationCallback );

  pub_wrecs_step = n.advertise<atlas_ros_msgs::AtlasStepData>("/ocu/add_step_relative_left_foot", 100);


  ros::spin();
  server.reset();
}