Project

General

Profile

Revision 144137a1

ID144137a12c1437f71d49b144279823dc836cb14b

Added by Alex Zirbel over 12 years ago

Got motor control working with scoutsim

Behaviors can now use the MotorControl class to change the speed of the motors in the simulator. The simulator correctly handles the command.
At the moment, the set_motors command is limited to 'scout1'. We should look into prefixes to specify which scout (scout1, scout2, etc) each behavior should command.
Also changed alex_behavior to be a good demonstration of the motors.

View differences:

scout/scoutsim/src/sim_frame.h
48 48
            bool spawnCallback(scoutsim::Spawn::Request&, scoutsim::Spawn::Response&);
49 49
            bool killCallback(scoutsim::Kill::Request&, scoutsim::Kill::Response&);
50 50

  
51
            ros::NodeHandle nh_;
52
            wxTimer* update_timer_;
53
            wxBitmap path_bitmap_;
54
            wxImage path_image_;
55
            wxMemoryDC path_dc_;
51
            ros::NodeHandle nh;
52
            wxTimer* update_timer;
53
            wxBitmap path_bitmap;
54
            wxImage path_image;
55
            wxMemoryDC path_dc;
56 56

  
57
            uint64_t frame_count_;
57
            uint64_t frame_count;
58 58

  
59
            ros::WallTime last_scout_update_;
59
            ros::WallTime last_scout_update;
60 60

  
61
            ros::ServiceServer clear_srv_;
62
            ros::ServiceServer reset_srv_;
63
            ros::ServiceServer spawn_srv_;
64
            ros::ServiceServer kill_srv_;
61
            ros::ServiceServer clear_srv;
62
            ros::ServiceServer reset_srv;
63
            ros::ServiceServer spawn_srv;
64
            ros::ServiceServer kill_srv;
65 65

  
66 66
            typedef std::map<std::string, ScoutPtr> M_Scout;
67
            M_Scout scouts_;
68
            uint32_t id_counter_;
67
            M_Scout scouts;
68
            uint32_t id_counter;
69 69

  
70
            wxImage scout_images_[SCOUTSIM_NUM_SCOUTS];
70
            wxImage scout_images[SCOUTSIM_NUM_SCOUTS];
71 71

  
72
            float meter_;
73
            float width_in_meters_;
74
            float height_in_meters_;
72
            float meter;
73
            float width_in_meters;
74
            float height_in_meters;
75 75
    };
76 76

  
77 77
}

Also available in: Unified diff