-
Notifications
You must be signed in to change notification settings - Fork 34
CMP3103 Week 2
- maybe run
sudo apt update && sudo apt upgradeto ensure you have got the latest software available. Also, to ensure you have all relevant packages installed runsudo apt install ros-melodic-uol-cmp3103m(again). If you have not yet installed everything you need for the workshops on your own computer, make sure you follow the steps in Home Installation. Or, if you are using Splashtop to remotely access a lab computer, read Splashtop. - To work in simulation, start the simulator, see last week's tutorial at first-turtlebot-tutorial.
-
Run
rostopic listand consider what you see. Also, tryrostopic echo /odomand move in simulation using the keyop from last week. What do you see? (This is more exciting on the real robot, you probably have already done it in simulation last week) -
use
rostopic pubto make the robot move! Try to develop the following command using theTabkey for auto-completion (do not directly copy this, as it will not work):rostopic pub /mobile_base/commands/velocity geometry_msgs/Twist " linear: x: 0.0 y: 0.0 z: 0.0 angular: x: 0.0 y: 0.0 z: 0.5" -r 1(You can stop this command by hitting
[Ctrl]-Con your keyboard!) -
Watch your turtlebot move. Reflect what is happening. Try to make it go around in a circle (with about 0.5m radius) smoothly by modifying the above command.
-
Optional, but very relevant: run
roslaunch uol_turtlebot_simulator turtlebot-rviz.launchagain (you did last week?!) and in particular inspect the output of the robot's sensors! Find out how to display different sensory information of the robots: Pointcloud, "laserscans" (discuss what this actually is, as there is no laser sensor on the robot!), and images.
- Read this tutorial on how to create a publisher in python. Remember that we want to publish a
geometry_msgs/Twistto/mobile_base/commands/velocity! Make sure you look back at the code that has been developed live in the lecture as a good example. - To create a workspace and package and start VS Code correctly, please have a look at First Turtlebot coding
- Time to code our first Python program using ROS: The goal is (again) to have the turtlebot first go around in a circle of about 0.5m radius, this time from the Python program!
- In the simulation, you just run the simulation as before, and then your code in VS Code or from the command line.
- Now consider how you could implement a behaviour that takes the robot forward if the is more than 50cm space in front of it but make it turn to the left, if there isn’t enough space. This requires you to interpret the data from, e.g., the laser scanner and modify the Twist you publish depending on the data in the Laser scan.
- Optional: When you have accomplished this, the next challenge for you is to make it go in the shape of a square of 1m length each side.
Read Turtlebots! Best course of action:
- Connect to the robot: https://github.com/LCAS/teaching/wiki/Turtlebots#connecting-to-the-robot-from-your-browser
- start the ROS drivers: https://github.com/LCAS/teaching/wiki/Turtlebots#starting-the-hardware-drivers-tmule-control
- We recommend to focus on using the Jupyter Setup, rather than the VPN setup which will only be available if you can setup a VPN on your computer. So, focus on the Jupyter way!
Read Git and GitHub
What to send to the robot?*
A Twist message has two parts that are important:
-
Twist.linear: this has x,y,z components for which you can specify the speed in m/s. Please don't go beyond 0.6 -
Twist.angular: this also has x,y,z components and determines how quick the robot should rotate around one of the axes in radians/s. Please don't go beyond PI. To determine which axis you want to move along and turn around, please have a look at the picture below:
Red: x, green: y, blue: z
Copyright by Lincoln Centre for Autonomous Systems
-
CMP3103
- Using the Docker Image
- Week 1
- Week 2
- Week 3
- Week 4
- Week 5: Start working towards Coursework 2526
- Using the real Limo Robot