$\color{white}\colorbox{FE9227}{Reaching a significant milestone and deepening expertise!}$
▓▓▓▓▓▓▓▓▓▓▓▓▓▓░░░░░░░░░░░░░░ 50%
The next step in simulating our robot is to create our robot tf2
tree. Having a tight and accurate tf2
tree is essential for a working robot simulation.
The first thing to note when starting to build your robot tf2
tree is aligning your simulation frame with your robot frame. Within rviz
, the x-axis is shown in red, the y-axis is green, and the z-axis is blue. Your robot should be aligned such that the x-axis points to the front of the robot, the y-axis spans the width of the robot, and the z-axis aligns with the height of the robot.
<aside>
⚠️ These conventions are very important! These will align your odometry
properly to the map
frame, which will be important when doing navigation and SLAM
.
</aside>
To launch an RVIZ window for visualizing, you must first lauch the GUI and then add the appropriate visualization tab and chose your robot xacro
.
Launch an RVIZ window using the following command:
rviz2
Once your RVIZ GUI is opened, it should look like this
INSERT PICTUER
An especially useful tool when creating robots is using xacro:macros
. This will create a cleaner and shorter file to describe your robot because you can use the same macro, but mirrored, for wheels on opposite sides of the robot. See the XACRO ****for more information.
Let’s start by creating the “master” XACRO
, this will be the file that will include all the external XACRO
files used to describe the joints
, sensors
, and ros2_control
.