No Submission Required.
Demo: required on Gazebo and the real robot, pick your team's timeslot here.
Due time: lab session
Grading rubric:
Safety is always the top priority.
No food or beverage allowed in the lab.
Report any suspicious cables, wires, etc.
Organize your station before you leave.
Cut off all power supply (both robot base and NUC).
Organize wires, cables, etc.
Do not leave your personal information on the robot.
Create your own folder when you work, and delete code when you leave.
The robot is shared by three lab sections.
Do NOT make any changes to the wiring on the robot.
Please save the battery (recharging takes time), and charge the robot if you do not have it running.
Choose either Point A* or Orient A* from Lab 5.
Choose either Gradient Descent Path Smoothing or 3rd-order Polynomial Time-Scaling from Lab6.
Combine these together into a single file named turtlebot.py.
Use the following start, goal, and obstacles to test your code in gazebo and ensure that the script has no errors.
start = (0, 0)
goal = (9, 2)
obstacles = [(1, 0), (1, 1), (4, 1), (4, 2), (4, 3), (5, 1), (5, 2), (5, 3),(8, 0), (8, -1)]
Be prepared to show this in the beginning of your chosen time slot.
Connection with the robot and roslaunch
One of the ways to connect to the robot is via Secure SHell (SSH). Thus, in this case, you need first to connect to the local Wi-Fi router (for further information please ask the Teaching Assistant) and then to the robot. To connect to the robot, you can open an SSH connection terminal,
ssh ee106_nucx@192.168.0.X
where nucx stands for the nuc number, as mentioned on the robot and X is the final digits of the robot’s IP. Since you are connected to the remote shell of the robot, you can navigate in the ~/catkin_ws folder of its ROS workspace.
First we need to enable the robot ROS node. Thus, execute in the same terminal,
roslaunch kobuki_node minimal.launch --screen
To execute your locally saved ROS node, you need first to secure copy (scp) it in the robot’s directory and then execute it. So, open a new terminal in your VMware and execute,
scp `path_to_your_script` ee106_nucx@192.168.0.X:/home/ee106_nucx/turtlebot2_ws/src/ee144w25/src/turtlebot.py
Then, on the same terminal follow the above instructions of performing SSH, and obtain access on the TurtleBot by a new terminal.
Before you copy the turtlebot.py to the robot make these changes to your script.
Remove self.reset_gazebo()
Change the velocity publisher from cmd_vel to /mobile_base/commands/velocity.
As the file is copied on the Robot, you can navigate to the ee144w25 ROS package, and provide permission on the copied ROS node with the command chmod +x turtlebot.py. To execute your ROS node on the Turtlebot2, perform the following command on the SSH terminal,
rosrun ee144w25 turtlebot.py
To interrupt the behavior, you can cancel the execution of the ROS node in the same way as the Gazebo. In case you want to perform changes on your code, you can do this locally on your computer, and then copy back the new updated code on the robot.
To disconnect, just run
exit
To shutdown your remote computer, run
sudo shutdown now
The TAs will provide you a map with start (GREEN), goal (RED), and obstacles (BLUE).
The grid size of the map is 0.5m which is slightly larger than the robot.
Grey grids represent the wall (obstacles) and the robot should not collide.
The starting point is the origin (0,0) of the grid map represented in green.
Identify the positions of the obstacles and goal using origin to generate your path.
Once you execute the path, you need to reach the goal and hit the ball at the goal.
ROS Bag Recording and Data Logging (Optional)
One of the ways to record the data being produced during a ROS scenario you can use the ROS bag command. Specifically, this command enables the ROS data logging feature to capture information that is being published via the ROS Topics and save it locally. The information is saved in ROS Bag file format (.bag), which can be accessed at a later time and be replayed back to replay the captured data of the scenario.
In our scenario, the ROS Bag recording can be used to save the implemented scenario of the TurtleBot3 and then can be replayed to visualize the data captured during the real scenario. To save the ROS Bag you can execute while the robot is running,
rosbag record -a
The locally saved ROS Bag can be replayed back, by doing,
rosbag play name_of_the_rosbag.bag --clock -l
By using the Space button you can pause the replay. Additionally, by using the rostopic list command you can see that the captured ROS Topics are being replayed back.
Bonus points
If you have time within your 30 minute time slot you can run your collision avoidance code on the robot for the given map. You can combine this with this the rest of the code and be prepared to test it on the real robot.