View Code? Open in Web Editor
NEW
Resource: https://www.youtube.com/@aleksandarhaber
CMake 20.77%
C 2.37%
C++ 4.93%
Makefile 56.05%
Python 10.38%
Shell 1.97%
Common Lisp 2.52%
JavaScript 1.00%
robot-modelling's Introduction
Explanation of URDF Files and Launch ROS Files
Install and use RVIZ and Other Packages
"sudo apt-get install ros-melodic-rviz"
"roscore"
Go to new terminal "rosrun rviz rviz"
Install for URDF modeling
"sudo apt-get install ros-melodic-urdf"
"sudo apt-get install liburdfdom-tools"
Create the Workspace and Catkin Package
"mkdir -p ~/robot_ws/src"
"cd ~/robot_ws"
"catkin_make"
"source ~/robot_ws/devel/setup.bash"
"echo $ROS_PACKAGE_PATH"
"cd ~/robot_ws/src"
"catkin_create_pkg robot_model_pkg roscpp tf2 geometry_msgs urdf rviz joint_state_publisher_gui"
roscpp: cpp and ROS.
tf2: Lets the user keep track of multiple coordinate frames over time.
geometry_msgs: Messages for common geometric primitives such as points, vectors, and poses.
urdf: C++ parser for URDF package
rviz: RVIZ
joint_state_publisher_gui: Contains a GUI tool for setting and publishing joint state values for a given URDE
Create the URDF file and launch file.
"cd ~/robot_ws/src/robot_model_pkg"
"mkdir urdf"
"mkdir launch"
"cd urdf"
"gedit robot.urdf" You can find it in README.md file.
"cd .."
"cd launch"
"gedit robot.launch" You can find it in README.md file.
"cd ~/robot_ws/"
"catkin_make"
If your "joint-state-publisher-gui" couldn't found, you can solve this problem with "sudo apt install ros-melodic-joint-state-publisher-gui"
Test.
Go to new terminal and write "roscore"
Then return the terminal you changed adn write "roslaunch robot_model_pkg robot.launch".
Now you will see RViz screen. Click "add" and select "robot model".
Change the fixed frames name from "map" to "base_link"
Then click "Save Configg as", go to "robot_model_pkg" and name it "robot.rviz"
"cd robot_model_pkg/"
"cd urdf/"
"gedit robot.urdf" You can find this file inside of the README.md
"roslaunch robot_model_pkg robot.launch"
Now you are able to control the green box from small GUI.
Xacro and URDF to Parametrize and Model Robots in RViz
Go to a clean termianl and write "sudo apt-get install ros-melodic-rviz"
Go to new terminal and start ros by "roscore"
Go back to first terminal and run "rosrun rviz rviz"
Installations.
"sudo apt-get install ros-melodic-urdf"
"sudo apt-get install ros-melodic-xacro"
"sudo apt-get install liburdfdom-tools"
Create a workspace and catkin package
"mkdir -p ~/robot2_ws/src"
"cd ~/robot2_ws"
"catkin_make"
"source ~/robot2_ws/devel/setup.bash"
"echo $ROS_PACKAGE_PATH"
"cd ~/robot2_ws/src"
"catkin_create_pkg robot2_model_pkg roscpp tf2 geometry_msgs urdf rviz joint_state_publisher_gui xacro"
roscpp: Cpp and ROS
tf2: Lets the user keep track of multiple coordinate frames over time
geometry_msgs: Messages for common geometric primitives such as points, vectors, and poses.
urdf: C++ parser for URDF package
rviz: RVIZ
joint_state_publisher_gui:
xacro: XACRO
Create the XACRO and Launch files.
"cd ~/robot2_ws/src/robot2_model_pkg/"
"mkdir urdf"
"mkdir launch"
"cd urdf"
"gedit material_color.xacro". You can find the content in related README.md
"gedit robot.xacro". You can find the content in related README.md
"cd ~/robot2_ws/src/robot2_model_pkg/launch"
"gedit robot_xacro.launch" You can find the content in README.md
Return the original workspace "cd ~/robot2_ws"
"catkin_make"
"roslaunch robot2_model_pkg robot_xacro.launch" (If you close the roscore we ran in step 2, go a new terminal an start before this line)
Add->Robot Model
Change the fixed frame name from "map" to "base_link"
Add "TF", now you can see objects names.
Model Robots in Gazebo From Scratch by Using URDF and Xacro
Go to a terminal and write "gazebo". If not, you have to install Gazebo by properly installing ROS.
Necessary Packages
"sudo apt-get install ros-melodic-gazebo-ros-pkgs"
"sudo apt-get install ros-melodic-gazebo-msgs"
"sudo apt-get install ros-melodic-gazebo-plugins"
"sudo apt-get install ros-melodic-gazebo-ros-control"
Create a workspace and catkin package
"mkdir -p ~/robot3_ws/src"
"cd ~/robot3_ws"
"catkin_make"
"source ~/robot3_ws/devel/setup.bash"
"echo $ROS_PACKAGE_PATH"
"cd ~/robot3_ws/src"
"catkin_create_pkg robot_model3_pkg gazebo_msgs gazebo_plugins gazebo_ros gazebo_ros_control mastering_ros_robot_description_pkg"
Dependencies:
gazebo_msgs
gazebo_plugins
gazebo_ros
gazebo_ros_control
mastering_ros_robot_description_pkg
Create the source files defining the robot geometry
"cd ~/robot3_ws/src/robot_model3_pkg"
"mkdir urdf"
"cd ~/robot3_ws/src/robot_model3_pkg/urdf"
"gedit robot.xacro" You can file the content in README.md
"gedit robot.gazebo" You can file the content in README.md
"cd .."
"mkdir launch"
"cd ~/robot3_ws/src/robot_model3_pkg/launch"
"gedit robot_xacro.launch" You can file the content in README.md
Launch the model in Gazebo
"roslaunch robot_model_pkg robot_xacro.launch"
TurtleBot3 Robot in ROS and Simulate Movement in Gazebo
Create the folder and clone the necessary TurtleBot3 files
Create the workspace and specif the source
"catkin_make"
"source ~/test_turtlebot/devel/setup.bash"
Simulate the robot motion in Gazebo
We have three robot opitons. Burger, Waffle, and Waffle Pi. Now we will select the "burger"
"export TURTLEBOT3_MODEL=burger"
Launch the world
Empty World: "roslaunch turtlebot3_gazebo turtlebot3_empty_world.launch"
Another World: "roslaunch turtlebot3_gazebo turtlebot3_world.launch"
Teleoperation Node:
Go to the new terminal
Specify the source "source ~/test_turtlebot/devel/setup.bash"
Specify the model "export TURTLEBOT3_MODEL=burger"
Launch the teleoperation node "roslaunch turtlebot3_teleop turtlebot3_teleop_key.launch". Now w are able to control the robot.
Final test
Go to new terminal "cd ~/test_turtlebot"
Specify the source "source ~/test_turtlebot/devel/setup.bash"
Specify the model "export TURTLEBOT3_MODEL=burger"
Launch the house "roslaunch turtlebot3_gazebo turtlebot3_house.launch"
Go to new terminal "cd ~/test_turtlebot"
Specify the source "source ~/test_turtlebot/devel/setup.bash"
Specify the model "export TURTLEBOT3_MODEL=burger"
Launch the teleoperation node "roslaunch turtlebot3_teleop turtlebot3_teleop_key.launch". Now we are able to control the robot again.
Create URDF File and Model of Four Wheeled Mobile Robot in ROS
Install RVIZ nececities
"sudo apt-get install ros-melodic-rviz"
"roscore"
"rosrun rviz rviz", if works continue.
Install for URDF Modeling
"sudo apt-get install ros-melodic-urdf"
"sudo apt-get install liburdfdom-tools"
"sudo apt-get install ros-melodic-xacro"
Create the workspace and catkin package
"mkdir -p ~/robot_dd/src"
"cd ~/robot_dd"
"catkin make"
"source ~/robot_dd/devel/setup.bash"
"echo $ROS_PACKAGE_PATH"
"cd ~/robot_dd/src"
Create the packages "catkin_create_pkg robot_dd_model_pkg roscpp tf2 geometry_msgs urdf rviz joint_state_publisher_gui"
Dependencies:
roscpp: CPP and ROS
tf2: Lets the user keep track of multiple frames over time
geometry_msgs: Messages for common geometric primitives such as points, vectors, and poses
urdf: C++ parser for UDF package
rviz: RVIZ
joint_state_publisher_gui: Contains a GUI tool for setting and publishing joint state values for a given URDF
Create the URDF file and Launch file
"cd ~/robot_dd/src/robot_dd_model_pkg"
"mkdir urdf"
"mkdir launch"
"cd urdf"
"gedit robot.urdf" You can reach the code on README
"cd ~/robot_dd/src/robot_dd_model_pkg/launch"
"gedit robot.launch" You can reach the code on README
"cd ~/robot_dd"
"catkin_make" again
Test
Open a new terminal
"roscore"
In original terminal, write "roslaunch robot_dd_model_pkg robot.launch"
Change the fixed frame name from "map" to "body_link" then add "RobotModel".
Too see the move you give from joint_state_publisher_gui, click add, then select the Axes make Axes' reference wheel any of them and try to change wheel1_joint value. You will see the difference in simulation.
Modelling, Simulation and Control of 4 Wheeled Robot in ROS and Gazebo
Install necessary packages
Open a terminal and write "gazebo". If Gazebo don't open, install it properly by installing ROS.
Download these:
"sudo apt-get install ros-melodic-gazebo-ros-pkgs"
Provide the necessary interfaces to simulate a robot in Gazebo 3D rigid body simulator for robots. It integrates with ROS using ROS messages, services and dynamic reconfigure.
"sudo apt-get install ros-melodic-gazebo-msgs"
Messages and service data structures for interfacing ROS and Gazebo.
"sudo apt-get install ros-melodic-gazebo-plugins"
Robot independent Gazebo plugins for sensors, motor and dynamic reconfigurable components.
"sudo apt-get install ros-melodic-gazebo-ros-control"
Controllers to communicate between ROS and Gazebo.
"sudo apt-get install ros-melodic-teleop-twist-keyboard"
Package for controlling the robot by using keyboard keys.
Create the Workspace and Catkin package.
"mkdir -p ~/robot_four/src"
"cd robot_four"
"catkin_make"
"source ~/robot_four/devel/setup.bash"
"echo $ROS_PACKAGE_PATH"
"cd ~/robot_four/src"
"catkin_create_pkg robot_model_pkg gazebo_msgs gazebo_plugins gazebo_ros gazebo_ros_control"
Dependencies:
"gazebo_msgs"
"gazebo_plugins"
"gazebo_ros"
"gazebo_ros_control"
Create the source files defining robot geometry
"cd ~/robot_four/src/robot_model_pkg"
"mkdir urdf"
"cd ~/robot_four/src/robot_model_pkg/urdf"
"gedit robot.xacro" You can find content in the related README file.
"gedit robot.gazebo" You can find content in the related README file.
Create the launch file.
"cd ~/robot_four/src/robot_model_pkg"
"mkdir launch"
"cd ~/robot_four/src/robot_model_pkg/launch"
"gedit robot_xacro.launch" You can find content in the related README file.
"cd ~/robot_four"
"catkin_make"
Launch the file.
Go to a new terminal, "roscore"
Return the terminal we working and "roslaunch robot_model_pkg robot_xacro.launch". Now we should see the model in the Gazebo.
Go to a new terminal, "rosrun teleop_twist_keyboard teleop_twist_keyboard.py"
Controls
To investigate that are being used and published to. Go to new terminal and type:
"rostopic echo /odom"
"rostopic info /cmd_vel"
Modelling, Simulation and Control of 2 Wheeled Robot in ROS and Gazebo
Install necessary packages
"sudo apt-get install ros-melodic-gazebo-ros-pkgs"
"sudo apt-get install ros-melodic-gazebo-msgs"
"sudo apt-get install ros-melodic-gazebo-plugins"
"sudo apt-get install ros-melodic-gazebo-ros-control"
"sudo apt-get install ros-melodic-teleop-twist-keyboard"
Create the Workspace and Catkin package.
"mkdir -p ~/robot_two_wheeled/src"
"cd robot_two_wheeled"
"catkin_make"
"source ~/robot_two_wheeled/devel/setup.bash"
"echo $ROS_PACKAGE_PATH"
"cd ~/robot_two_wheeled/src"
"catkin_create_pkg robot_model_pkg gazebo_msgs gazebo_plugins gazebo_ros gazebo_ros_control"
Dependencies:
"gazebo_msgs"
"gazebo_plugins"
"gazebo_ros"
"gazebo_ros_control"
Create the source files defining robot geometry
"cd ~/robot_two_wheeled/src/robot_model_pkg"
"mkdir urdf"
"cd ~/robot_two_wheeled/src/robot_model_pkg/urdf"
"gedit robot.xacro" You can find content in the related README file.
"gedit robot.gazebo" You can find content in the related README file.
Create the launch file.
"cd ~/robot_two_wheeled/src/robot_model_pkg"
"mkdir launch"
"cd ~/robot_two_wheeled/src/robot_model_pkg/launch"
"gedit robot_xacro.launch" You can find content in the related README file.
"cd ~/robot_two_wheeled"
"catkin_make"
Launch the file.
Go to a new terminal, "roscore"
Return the terminal we working and "roslaunch robot_model_pkg robot_xacro.launch". Now we should see the model in the Gazebo.
Go to a new terminal, "rosrun teleop_twist_keyboard teleop_twist_keyboard.py"
Controls
To investigate that are being used and published to. Go to new terminal and type:
"rostopic echo /odom"
"rostopic info /cmd_vel"