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/scoutsim.cpp
26 26
class ScoutApp : public wxApp
27 27
{
28 28
public:
29
  char** local_argv_;
30
  ros::NodeHandlePtr nh_;
29
  char** local_argv;
30
  ros::NodeHandlePtr nh;
31 31

  
32 32
  ScoutApp()
33 33
  {
......
43 43
#endif
44 44

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

  
52
    ros::init(argc, local_argv_, "scoutsim");
53
    nh_.reset(new ros::NodeHandle);
52
    ros::init(argc, local_argv, "scoutsim");
53
    nh.reset(new ros::NodeHandle);
54 54

  
55 55
    wxInitAllImageHandlers();
56 56

  
......
66 66
  {
67 67
    for ( int i = 0; i < argc; ++i )
68 68
    {
69
      free( local_argv_[ i ] );
69
      free( local_argv[ i ] );
70 70
    }
71
    delete [] local_argv_;
71
    delete [] local_argv;
72 72

  
73 73
    return 0;
74 74
  }

Also available in: Unified diff