Rviz simulation in ros2 environment

Rviz simulation in ros2 environment

Strictly speaking, rviz is not a simulation software, but it can visually display the state of the robot and pass the relevant joint_ states_ Pubilsher controls the displayed joint posture of the robot.Please see section 9.0 first. Some instructions will not be explained in detail.

Quickly use

This section describes how to use

The display is as follows:

image-20220823163407037

The posture of each joint can be adjusted through the slider in the small window. The figure shows the initial position (the initial position is determined by STL and URDF files exported by SOLIDWORK. The initial position is as shown above, which can facilitate the kinematic calculation of subsequent simulation)

The corresponding relationship of each joint is as follows:

The corresponding relationship of each joint is as follows:

 

After adjust, as shown in the following figure.

image-20220823163407037

 

Configure rviz2 from the model

Advanced part

Model modification

Change the suffix name of the URDF file exported by SolidWorks to xacro, as shown in the following figure (add a sentence after the robot name)

Check whether the joint setting is correct

<joint

name="lf_hip_joint"

type="revolute">

<origin

xyz="0.09332 0.022407 0.01454"

rpy="0 0 0" />

<parent

link="base_link" />

<child

link="lf_hip_link" />

<axis

xyz="-1 0 0" />

Create launch file