Simulate robot to follow list of instructions RRS feed

  • Question

  • Hi,

    I'm just starting up in using the robotics simulator and I was wondering how I would approach getting a simulated robot to follow a preset list of instructions from a file.  I'm just looking for an overview of how I would do it because I've only played with using the SimpleDashboard so far. 


    Saturday, November 17, 2012 6:56 PM


  • Hi,

    If you take a look at any of the simulated examples (i.e. ReferencePlatform2011), you will see that the typical control cycle is around getting an input from sensors, processing them, and sending commands to actuators (like the differential drive). For instance, take a look at how ObstacleAvoidanceDrive works. It takes inputs from Kinect, IRs and Sonars, does processing and then controls the drive.

    In your case, to make robot move in some pre-set pattern - I would imagine you would read the instructions from the file, and send commands to the actuators (like the drive system). You may want to do it from one of existing sensor event handlers (Kinect depth frame handler in ObstacleAvoidanceDrive drive could be a good place to start) but instead of using obstacle avoidance logic - use any other logic (i.e. read instructions line by line from the file).

    Of course you will have to design the system such that instructions are timed properly, so you may want to create your own "producer" of events that you read from the file, and process those events asynchronously much like you'd do for any other sensor.

    Sunday, November 18, 2012 6:05 AM