コード例 #1
0
ファイル: relay.cpp プロジェクト: ethz-asl/variant
int main(int argc, char **argv) {
    if (argc < 2) {
        printf("\nusage: relay TOPIC [VARIANT_TOPIC]\n\n");
        return 1;
    }

    if (!getTopicBase((argv[1]), publisherTopic)) {
        ROS_ERROR("Failed to extract topic base from [%s]", argv[1]);
        return 1;
    }

    ros::init(argc, argv, publisherTopic+"_relay",
              ros::init_options::AnonymousName);

    if (argc == 2)
        publisherTopic = std::string(argv[1])+"_relay";
    else
        publisherTopic = argv[2];
    subscriberTopic = argv[1];

    nodeHandle.reset(new ros::NodeHandle("~"));

    bool unreliable = false;
    nodeHandle->getParam("unreliable", unreliable);
    nodeHandle->getParam("lazy", lazy);

    if (unreliable)
        subscriberTransportHints.unreliable().reliable();

    subscribe();
    ros::spin();

    return 0;
}
コード例 #2
0
    bool OnInit()
    {

      // create our own copy of argv, with regular char*s.
      local_argv_ = new char*[argc];
      for (int i = 0; i < argc; ++i)
      {
        local_argv_[ i ] = strdup( wxString( argv[ i ] ).mb_str() );
      }

      ros::init(argc, local_argv_, "remote_monitor");
      nh_.reset(new ros::NodeHandle);

      //wxInitAllImageHandlers();

      CRemoteFrame* frame = new CRemoteFrame(
        nh_,
        NULL,
        wxID_ANY,
        wxT("Remote Frame"),
        wxDefaultPosition,
        wxSize(700, 350),
        wxDEFAULT_FRAME_STYLE & ~wxRESIZE_BORDER);

      SetTopWindow(frame);
      frame->Show();

      return true;
    }
コード例 #3
0
int main(int argc, char** argv)
{
    ros::init(argc, argv, "centreview");
    n.reset(new ros::NodeHandle);
    ros::NodeHandle pn("~");


    std::string collection;
    std::vector<int> indices;
    pn.param<std::string>("collection",collection, "table_centre_group");
    pn.getParam("specify_index",indices);

    if(collection=="table_centre_group"){

        mongodb_store::MessageStoreProxy table_centre_group(*n, collection);
        std::vector<boost::shared_ptr<geometry_msgs::Polygon> > result_tables;
        table_centre_group.query<geometry_msgs::Polygon>(result_tables);

        VIZ_Points vv(n,"/table_centre_group");
        std::vector<float> color;
        color.push_back(0.0);
        color.push_back(1.0);
        color.push_back(0.0);

        VIZ_Points vv2(n,"/table_centre_group2");
        std::vector<float> color2;
        color2.push_back(0.0);
        color2.push_back(0.0);
        color2.push_back(1.0);

        VIZ_Points vv3(n,"/table_centre_group3");
        std::vector<float> color3;
        color3.push_back(1.0);
        color3.push_back(0.0);
        color3.push_back(0.0);

        while (ros::ok()){
            vv.pub_polygonASpoints(result_tables,0,color);

            vv2.pub_polygonASpoints(result_tables,1,color2);

            vv3.pub_polygonASpoints(result_tables,2,color3);
            sleep(1);
        }
        return 0;
    }

}
コード例 #4
0
int main(int argc, char** argv)
{
    ros::init(argc, argv, "db_cloud_extraction");
    nh.reset(new ros::NodeHandle);
    ros::NodeHandle pn("~");

    //plane filter
    pn.param<float>("normal_angle", normal_angle, 15.0);
    //filter1
    pn.param<float>("search_radius", search_radius, 0.8);
    pn.param<int>("neighbour_required", neighbour_required, 20);
    //filter2
    pn.param<int>("statistical_knn", statistical_knn, 50);
    pn.param<float>("std_dev_dist", std_dev_dist, 1.0);

    ros::ServiceServer table_srv = nh->advertiseService("db_table_clouds", extract);
    ros::ServiceServer table_srv2 = nh->advertiseService("db_table", extract2);

    ros::spin();

}
コード例 #5
0
int main(int argc, char *argv[])
{
  /*
   * INITIALIZE ROS NODE
   */
  ros::init(argc, argv, "perception_node");
  ros::NodeHandle priv_nh_("~");

  priv_nh_.param<double>("leaf_size", leaf_size_, 0.0f);
//  priv_nh_.param<double>("passThrough_max", passThrough_max_, 1.0f);
//  priv_nh_.param<double>("passThrough_min", passThrough_min_, -1.0f);
//  priv_nh_.param<double>("maxIterations", maxIterations_, 200.0f);
//  priv_nh_.param<double>("distThreshold", distThreshold_, 0.01f);
//  priv_nh_.param<double>("clustTol", clustTol_, 0.01f);
//  priv_nh_.param<double>("clustMax", clustMax_, 10000.0);
//  priv_nh_.param<double>("clustMin", clustMin_, 300.0f);

  nh_.reset(new ros::NodeHandle());
//  ros::ServiceServer server = nh_->advertiseService("filter_cloud", &filterCallback);
  ros::spin();
  return 0;
}
コード例 #6
0
ファイル: echo.cpp プロジェクト: tdnet12434/thesis
int main(int argc, char **argv) {
  if (argc < 2) {
    printf("\nusage: echo TOPIC\n\n");
    return 1;
  }
  
  if (!getTopicBase((argv[1]), subscriberTopic)) {
    ROS_ERROR("Failed to extract topic base from [%s]", argv[1]);
    return 1;
  }
  
  ros::init(argc, argv, subscriberTopic+"_echo",
    ros::init_options::AnonymousName);
  
  subscriberTopic = argv[1];
  
  nodeHandle.reset(new ros::NodeHandle("~"));
 
  subscribe();
  ros::spin();
  
  return 0;
}
コード例 #7
0
ファイル: turtlesim.cpp プロジェクト: Team-ALFRED/SonarTest1
 TurtleApp(int& argc, char** argv)
   : QApplication(argc, argv)
 {
   ros::init(argc, argv, "turtlesim", ros::init_options::NoSigintHandler);
   nh_.reset(new ros::NodeHandle);
 }