0% found this document useful (0 votes)
103 views20 pages

IMSE-7139 Cyber Physical Systems: Prof. Ning Xi

Here are the steps to record and play back a ROS bag file: 1. Launch turtlesim and turtle_teleop_key nodes as before. 2. In a new terminal, run "rosbag record -a" to record all topics. 3. Control the turtle using keyboard arrows. 4. Press Ctrl-C to stop recording when finished. 5. The bag file will be saved in the current directory. 6. To play it back, run "rosbag play bag_file_name.bag" 7. The turtle movement should replay as recorded in the bag file. This allows recording ROS messages for later playback or analysis. The bag file contains

Uploaded by

Haonan WANG
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
103 views20 pages

IMSE-7139 Cyber Physical Systems: Prof. Ning Xi

Here are the steps to record and play back a ROS bag file: 1. Launch turtlesim and turtle_teleop_key nodes as before. 2. In a new terminal, run "rosbag record -a" to record all topics. 3. Control the turtle using keyboard arrows. 4. Press Ctrl-C to stop recording when finished. 5. The bag file will be saved in the current directory. 6. To play it back, run "rosbag play bag_file_name.bag" 7. The turtle movement should replay as recorded in the bag file. This allows recording ROS messages for later playback or analysis. The bag file contains

Uploaded by

Haonan WANG
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 20

IMSE-7139

Cyber Physical Systems


Lab 0

Prof. Ning Xi

1
Content

 Final Grade
 Lab Report Format
 Vmware Installation
 Testing

2
Final Grade

3
Lab Report Format

1. Members Individual Responsibilities


i. Member 1:
ii. Member 2:
iii. Member 3:
iv. Member 4:
2. Group Report
i. Lab set up
ii. Tests and data collection
iii. Analysis
3. Individual report
i. Individual activity
ii. Discussion and answer questions
4. Report submission: Individuality
i. Group report 4

ii. Individual report


Lab 0

Circular motion
Lab 0

Reciprocating motion
Lab 0

Build map
Lab 0

Navigation
Computer Requirement

 OS Requirements
 Windows 10
 Windows 8.1
 Windows 7
 Hardware requirements:
 Standard x86-PCs with 64-bit Intel and AMD processors.
 22.0 GB of available disk space for the application.
 1.3GHz speed or faster
 2GB RAM minimum/ 4GB RAM and above recommended

9
Download Installation File

 Download the files with your HKU account:


https://drive.google.com/drive/folders/15XzI
ErBaUoOzZFYHeVQiEDfehyaT6FP_?usp=sharing

10
Checking the Virtualization Option

 CTRL + ALT + DEL


 Open Task Manager
 If “Virtualization Option” is disable, You
need to turn it on in BIOS.
 Google “Bios virtualization technology”

11
Install Virtual Machine

 Double click “VMware-workstation-full-16.1.2-17966106.exe” to install


 Double-click “VMware Workstation Pro” on the desktop

12
Steps

 Click “open a virtual machine”


 Open “turtlebot2Env.vmx”
 Double click “turtlebot”
 Double click “resume this virtule machine”

User name: xuan


Password: 1234

13
Network Setting For Your Own Laptop

2 3

4
Network Setting For Your Own Laptop

6
8
What is ROS?

Why ROS? Efficient communication.


What can ROS do? Subscribe and publish information from different nodes.
Our environment:
Ubuntu16.04, ROS kinetic
18
Lab: Start your first ROS project!
Change your IP:
sudo gedit ~/.bashrc
#export ROS_MASTER_URI=http://192.168.9.128:11311
#export ROS_HOSTNAME=192.168.1.102
source ~/.bashrc
 Open a new terminal,
 Run “roscore”
 Open a new terminal, (Ctrl&Alt&T)
 Run “rosrun turtlesim turtlesim_node”
 Open a new terminal,
 Run “rosrun turtlesim turtle_teleop_key”
 Select the control window and press the arrow keys,you
can see the turtle moving:

19
Lab: Auxiliary tools
1. View topics: rostopic list

2. View topic information: rostopic info “topic name”


3. Monitor topic: rostopic echo “topic name”
For example check the speed of the turtle,
open a new terminal,“rostopic echo /turtle1/cmd_vel”
Use the keyboard to control turtle, what happened?
4. Pub a topic to control the turtle:
rostopic pub /turtle1/cmd_vel geometry_msgs/Twist "linear:
x: 1.0
y: 0.0
z: 0.0
angular:
x: 0.0
y: 0.0
z: 0.0"
Lab: How ROS communicate
Lab: Record rosbag
It can record a bag, republish the messages from one or more bags, summarize the contents of a bag,
check a bag's message definitions, filter a bag's messages based on a Python expression, compress and
decompress a bag and rebuild a bag's index.

1. Continuate cotroling you turtle, run “rosbag record –a”


2. Press “ctrl+c” to save your bag file
3. Run “rosbag play your_bag_name.bag”

You might also like