Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
This git repos contains the YouBot application code that is needed during The European Robotics Forum 2011 workshop on the Orocos Toolchain
Purpose of the hands-on exercise
In this hands-on exercise, you can get experience with a simple, but real-life Orocos application. In the application the goal is to navigate with a mobile robot (the youbot), with respect to a (fixed) wall in the environment.
The mobile robot application
The mobile robot is equipped with a laser scanner, measuring the distance to a wall. Using this laser distance measurement, an Orocos-BFL (Bayesian Filtering Library. http://www.orocos.org/bfl) component estimates the pose (i.e. position and orientation) of the mobile robot with respect to the wall. Using this estimated pose, and a user-defined goal pose, an Orocos controller component generates control inputs (forward, sideways, and angular velocities), which are send to the mobile robot.
The Orocos application
There are 3 different modes to run the application:
The YouBot is simulated using an OROCOS component and results are plotted with kst. The whole application runs on your local computer.
The YouBot is simulated using the Morse or Gazebo simulator. All code runs on your computer, except for the simulator, which is running on a remote computer.
No more simulating here, just a real robot and real driving. All code runs on your computer, except for the YouBot component itself, which runs on the YouBot.
In order to make the YouBot do something usefull, e.g. drive to/along the wall, you need to have a good understanding of how the whole application works. Therefor, follow the steps below.
- Read the Simulation page carefully
- Study the component overview diagram to
- Understand the function of all the different components.
- Understand how they are connected to each other, e.g. what data they exchange.
- Take a close look at every component by reading the additional information to understand the different activities used in the application and how they determine the Components behaviour.
- Study the component overview diagram to
- Make the Simulation assignment, which you find at the bottom of the Simulation page.
Morse / Gazebo simulation
- Read the Morse / Gazebo simulation page carefully and study the component overview diagram to understand the difference with the Simulation application.
- Make the Morse / Gazebo assignment, which you find at the bottom of the Morse / Gazebo simulation page.
Real robot application
- Read the Real robot page carefully and study the component overview diagram to understand the difference with the Simulation application.
Writing a real-time state machine
Write an Orocos real-time state machine, which causes the mobile robot to head straight to the wall up to a distance of half a meter and subsequently, makes the robot drive parallel to the wall for one meter.
- Update the state machine file 'statemachine.osd', available in youbot_supervisor/. Read the Orocos real-time state machine documentation to find out how to do so! Give the state machine, beside an initial and final state, two additional states: 'DriveToWall' and 'DriveAlongWall'.
- Inside these states, set new goal poses using the Controller
- Send the YouBot to [0,0.5,-1.57] in the DriveToWall state
- Send the YouBot to [1,0.5,-1.57] in the DriveAlongWall state
- Let it transition from the initial state to the DriveToWall state as soon as the Controller component is started.
- Let it transition from the DriveToWall state to the DriveAlongWall state as soon as the YouBot reached its goal. Use the 'goal_reached' property, part of the Controller component, to check this.
- Let it transition from the DriveAlongWall state to the final state as soon as the YouBot reached its goal.
- Run the application in simulation and check the results. Is the YouBot doing what you expected?
- Run the application with one of the remote simulators - Always ask the permission of the workshop organizers to connect with the remote computer.