Great Deal! Get Instant $10 FREE in Account on First Order + 10% Cashback on Every Order Order Now

Final Exam CENG 4351 Fall 2022 Assigment Modify your gazebo_ddrobot_demo_1.world file to add a green cylinder that slides along an imaginary rail on the top of the chassis as shown in the attached...

1 answer below »
Final Exam CENG 4351 Fall 2022
Assigment
Modify your gazebo_ddrobot_demo_1.world file to add a green cylinder that slides along an imaginary rail on the top of the chassis as shown in the attached video.
The green cylinder has a radius of 0.05 meters and a length of 2.5 meters. Its mass properties are :
Mass = 0.05 kg
Inertia matrix =
 
Your code should also include a collision model for the green cylinder which is geometrically identical to its visual model.
Run gazebo simulation and use Kazam to record a similar video on your computer showing also your commands on the terminals.
 
Hint: the green cylinder can be modeled as an additional link that is connected to the chassis by a prismatic joint which is the rail.
 
Clearly label your code and video files and submit them to blackboard.
 
Bring up Turtlebot3 simulation with turtlebot3_dqn_stage4.launch.py file, then perform SLAM and navigate from the initial turtlebot3 pose, to poses 1,2,3,4,5 in that order.
Use Kazam (or a video software of your choice) to record the entire process (in multiple files if needed). Clearly label the video file(s) and submit them to blackboard.
Modify the file turtle_goto_goal.py in your Homework 3 to add another turtle that will run like in the attached video.
Colcon build your code, make a run with at least 2 sets of commanded motion for each turtle. Use Kazam to record the whole computer screen for the entire run. Clearly label your code and video files and submit them to blackboard.

To install Turtlebot3 Simulation and perform SLAM and
Navigation on it in an Ubuntu 20.04 Virtual Machine
1. Install required packages: open a terminal and run the following commands
foxy (or source /opt
os/foxy/setup.bash)
sudo apt-get update
sudo apt-get upgrade
sudo apt install ros-foxy-gazebo-ros-pkgs ros-foxy-cartographer ros-foxy-cartographer-
os ros-foxy-navigation2 ros-foxy-nav2-
ingup
sudo apt install ros-foxy-turtlebot3-msgs ros-foxy-dynamixel-sdk ros-foxy-hls-lfcd-
lds-drive
mkdir -p ~/turtlebot3_ws/src
cd turtlebot3_ws/src
git clone -b foxy-devel https:
github.com/ROBOTIS-GIT/turtlebot3
git clone -b foxy-devel https:
github.com/ROBOTIS-GIT/turtlebot3_simulations.git
2. Build the Turtlebot3 simulation (still using the same terminal)
cd ~/turtlebot3_ws
colcon build --symlink-install --parallel-workers 1
2. Launch the Turtlebot3 simulation: open a new terminal and run the following
commands
foxy
export TURTLEBOT3_MODEL=waffle_pi
source ~/turtlebot3_ws/install/setup.bash
os2 launch turtlebot3_gazebo turtlebot3_world.launch.py
3. Launch the mapping program: open a new terminal and run the following commands
foxy
export TURTLEBOT3_MODEL=waffle_pi
source ~/turtlebot3_ws/install/setup.bash
os2 launch turtlebot3_cartographer cartographer.launch.py use_sim_time:=True
4. Launch the teleop keyboard to drive the simulated Turtlebot3 around the arena: open
a new terminal and run the following commands
foxy
export TURTLEBOT3_MODEL=waffle_pi
source ~/turtlebot3_ws/install/setup.bash
os2 run turtlebot3_teleop teleop_keyboard
(Note: w=forward, x=backward, a=rotate CCW, d=rotate CW, s=stop)
(Drive the simulated Turtlebot3 completely around the arena so the cartographer
software can create a map)
5. To save the map: open a new terminal and run the following commands:
foxy
export TURTLEBOT3_MODEL=waffle_pi
https:
urldefense.com/v3/__https:/github.com/ROBOTIS-GIT/turtlebot3__;!!BCR0FSePrR4x!UIte99QQKzuZByaqp9DhQ_QvGAUj8h6pZyUv_sI29vEqQxeOaqurtYd6nuD0K8o$
https:
urldefense.com/v3/__https:/github.com/ROBOTIS-GIT/turtlebot3_simulations.git__;!!BCR0FSePrR4x!UIte99QQKzuZByaqp9DhQ_QvGAUj8h6pZyUv_sI29vEqQxeOaqurtYd6GE0drGM$
https:
urldefense.com/v3/__http:/turtlebot3_world.launch.py__;!!BCR0FSePrR4x!UIte99QQKzuZByaqp9DhQ_QvGAUj8h6pZyUv_sI29vEqQxeOaqurtYd6rhCwNUM$
https:
urldefense.com/v3/__http:/cartographer.launch.py__;!!BCR0FSePrR4x!UIte99QQKzuZByaqp9DhQ_QvGAUj8h6pZyUv_sI29vEqQxeOaqurtYd6R4_boL4$
source ~/turtlebot3_ws/install/setup.bash
os2 run nav2_map_server map_saver_cli -f ~/map
(The map will be saved in two files map.pgm and map.yaml at the home directory)
6. To navigate: first terminate all applications in all windows that were used in
creating the map, then relaunch the Turtlebot3 simulation with commands in the step 2
above. Finally, open a new terminal and launch the navigation software by running the
following commands
foxy
export TURTLEBOT3_MODEL=waffle_pi
source ~/turtlebot3_ws/install/setup.bash
os2 launch turtlebot3_navigation2 navigation2.launch.py map:=$HOME/map.yaml
7. Estimate the Initial Pose by
a) Click the 2D Pose Estimate button in the RViz2 menu
) Click on the map where the actual robot is located and drag the large green
a
ow toward the direction where the robot is facing.
c) Repeat step a and b until the LDS sensor data is overlayed on the saved
map.
8. Launch keyboard teleoperation node to precisely locate the robot on the map with
the command
os2 run turtlebot3_teleop teleop_keyboard
(Move the robot back and forth a bit to collect the su
ounding environment
information and na
ow down the estimated location of the Turtlebot3 on the map which
is displayed with tiny green a
ows)
9. Terminate the teleoperation node by entering Ctrl + C
10. Set Navigation Goal by
a) Click the Navigation2 Goal button in the RViz2 menu
b) Click on the map to set the destination of the robot and drag the green
a
ow toward the direction where the robot will be facing.
This green a
ow is a marker that can specify the destination of the
obot.
The root of the a
ow is x, y coordinate of the destination, and the
angle θ is determined by the orientation of the a
ow.
As soon as x, y, θ are set, TurtleBot3 will start moving to the
destination immediately.

PowerPoint-Präsentation
Gazebo (version 11)
3D simulation environment
Powered using rigid-body dynamics (all objects are incompressible)
Open Dynamic Engine (ODE) is used by default. Bullet, DART or Simbody can be compiled by choice
OpenGL rendering
Can provide real-time simulation with physically plausible behavio
Gazebo
Robot mobility can be handled in 2D or 3D because the environment is static. Indoor ground robots operate primarily in 2D, but aerial, underwater, space, and even outdoor ground robots need 3D simulation environments.
Robot manipulators in simulation require more complexity to handle the dynamics of the robot and other objects in the scene.
Gazebo plugins
ModelPlugins provides access to the physics model API
SensorPlugins provides access to the sensors API
VisualPlugins provides access to the visual rendering API
Gazebo
$ gazebo
Once gazebo is run the first time, the directory ~/.gazebo will be created
Differential Drive
Gazebo Demo
Open a terminal
$ source /opt
os/foxy/setup.bash
$ sudo apt install ros-foxy-gazebo-ros-pkgs
$ sudo apt install ros-foxy-ros-core ros-foxy-geometry2
$ gazebo --ve
ose ~/Downloads/gazebo_ddrobot_demo_1.world
Open another terminal
$ source /opt
os/foxy/setup.bash
$ ros2 topic list
$ ros2 topic pub /demo/cmd_demo geometry_msgs/Twist ‘{linear: {x: 0.2}}’ -1
$ ros2 topic pub /demo/cmd_demo geometry_msgs/Twist ‘{linear: {x: 0.0}}’ -1
$ ros2 topic pub /demo/cmd_demo geometry_msgs/Twist ‘{angular: {z: 0.2}}’ -1
gazebo_ddrobot_demo.world
XML declaration
Comments
gazebo_ddrobot_demo.world
egin of sdf
egin of world
world data
URI=Uniform Resource Identifie
~/.gazebo/models/construction_cone
Modeling SW: AutoCAD, Solidworks
sdf=Simulation Description Format
gazebo_ddrobot_demo.world
link chassis
chassis inertial data
chassis visual data
us
share/gazebo-11/media/materials/scripts/gazebo.material
ambient, diffuse, specular, emissive determine color & texture of a model
gazebo_ddrobot_demo.world
link chassis
chassis collision data
end of link chassis
gazebo_ddrobot_demo.world
link left wheel

left wheel inertial data
left wheel visual data
gazebo_ddrobot_demo.
world
link left wheel

left wheel collision data
end of link left wheel
cfm = constraint force mixing
erp = e
or reduction paramete
kp = spring constant
kd = damping coeff
ode = open dynamics engine
gazebo_ddrobot_demo.
world
joint ‘left wheel / chassis’

gazebo_ddrobot_demo.
world
link right wheel

ight wheel inertial data
ight wheel visual data
gazebo_ddrobot_demo.
world
link right wheel

ight wheel collision data
end of link right wheel
gazebo_ddrobot_demo.
world
joint ‘right wheel/chassis’

gazebo_ddrobot_demo.
world
differential drive plugin

gazebo_ddrobot_demo.
world
end of model
end of world
end of sdf


ROS2 Topics, Publishers and Subscribe
Homework 3
Homework 3
Homework 3
ROS2 Publishe
How to add a publisher for the topic /turtle1/cmd_vel
From Lesson_7 powerpoint
self.publisher_name = self.create_publisher(topic_type, “topic_name”, queue)
ROS2 Publishe
self.publisher_name = self.create_publisher(topic_type, “topic_name”, queue)
The publisher_name is already chosen on line 67 of the code
- Topic name is given “turtle1/cmd_vel”
- To find topic type, first activate turtlesim
$ ros2 topic list
$ ros2 topic type /turtle1/cmd_vel XXXXXXXXXXTwist)
ROS2 Subscribe
How to add a subscriber for the topic /turtle1/pose
From Lesson_7 powerpoint
self.subscriber_name = self.create_subscription(topic_type, “topic_name”, callback_function, queue)
ROS2 Subscribe
self.subscriber_name = self.create_publisher(topic_type, “topic_name”, callback_function, queue)
The subscriber_name is of your choice
- Topic name is given “turtle1/pose”
- Callback function name is given “callback_turtle_pose” (line 30)
$ ros2 topic list
$ ros2 topic type /turtle1/pose XXXXXXXXXXPose)
ROS2 Time
How to add a timer that calls the “control_loop” function every 0.1 sec
From Lesson_7 powerpoint
self.timer_name = self.create_timer(0.1, self.control_loop)
Add python code
Simple python code
Build the system
Add the “TurtleControllerNode” to file “setup.py”
$ colcon build --packages-select my_py_pkg
Run
$ source install/setup.bash
$ ros2 run my_py_pkg turtle_controller_node
Answered 2 days After Dec 06, 2022

Solution

Karthi answered on Dec 08 2022
34 Votes
SOLUTION.PDF

Answer To This Question Is Available To Download

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here