Revision 60a90290 scout/scoutsim/src/sim_frame.cpp

View differences:

scout/scoutsim/src/sim_frame.cpp
130 130
        teleop_type = TELEOP_OFF;
131 131
        teleop_l_speed = 0;
132 132
        teleop_r_speed = 0;
133
        teleop_scoutname = "scout1";
134

  
133 135
        teleop_pub = nh.advertise<motors::set_motors>("/scout1/set_motors", 1000);
134 136

  
135 137
        ROS_INFO("Starting scoutsim with node name %s",
......
240 242
        std::stringstream ss;
241 243
        ss << "/" << req.scout_name << "/set_motors";
242 244
        teleop_pub = nh.advertise<motors::set_motors>(ss.str(), 1000);
245
        teleop_scoutname = req.scout_name.c_str();
246
        ROS_INFO("Teleoping %s...",teleop_scoutname.c_str()); //debug statement
243 247

  
244 248
        return true;
245 249
    }
......
533 537
        msg.fr_set = true;
534 538
        msg.bl_set = true;
535 539
        msg.br_set = true;
540
        msg.teleop_ON = true;
536 541

  
537 542
        msg.fl_speed = teleop_l_speed;
538 543
        msg.fr_speed = teleop_r_speed;
......
544 549

  
545 550
    void SimFrame::updateScouts()
546 551
    {
552
        std::string teleop_out = "";
553

  
547 554
        if (last_scout_update.isZero())
548 555
        {
549 556
            last_scout_update = ros::WallTime::now();
......
562 569

  
563 570
        for (; it != end; ++it)
564 571
        {
572

  
573
        //default to scout1
574
        if (teleop_type != TELEOP_OFF)
575
        {
576
            teleop_out = teleop_scoutname;
577
        }
578

  
565 579
            it->second->update(SIM_TIME_REFRESH_RATE,
566 580
                               path_dc, sonar_dc,
567 581
                               path_image, lines_image, walls_image,
568 582
                               path_dc.GetBackground().GetColour(),
569 583
                               sonar_dc.GetBackground().GetColour(),
570
                               state);
584
                               state,teleop_out);
571 585
        }
572 586

  
573 587
        for (unsigned int i = 0; i < ghost_scouts.size(); ++i)

Also available in: Unified diff