박홍준
박홍준

Reputation: 29

Turtlebot3 change Lidar sensor and rpicamera

I'm trying to change the camera and lidar sensor from the existing robot's parts, but I don't know which file to modify.

Upvotes: 1

Views: 951

Answers (1)

JWCS
JWCS

Reputation: 1211

A robot's design / parts / build, or description is usually made into it's own package; in this case turtlebot3_description. (This is in contrast to turtlebot3_gazebo, which has various simulation worlds, or the other utility or internal packages available via apt install).

A robot is usually defined with a URDF file, or a XACRO file (which is a URDF file with macro extensions). For example, in turtlebot3_waffle.urdf.xacro, there are "links" and "joints" that describe the frames the data will be transformed on, and the cosmetic meshes for the cameras that will appear in gazebo. The URDF tutorials & docs can help explain the syntax, as well as the xacro extensions.

They separate the declaring of frames from the gazebo-specific plugins that are the actual camera & lidar, in the turtlebot3_waffle.gazebo.xacro. There you'll see a lidar implemented as a sensor type=ray, name=lds_lfcd_sensor, and all the parameters, and calling of library, etc. If you want to replace it with, say, a velodyne, then that section just gets removed, and you include the velodyne urdf file, and you tell it which frameName (base_scan) you want it to attach to. Likewise, for the camera, see the instructions for using your own camera model (I recommend working with existing urdf/xacro files for lidars & cameras), and replace the existing code, in both urdf files, to mount the new camera on the camera_frame.

When you install turtlebot3_description, you can cd into that directory with roscd turtlebot3_description and explore it's contents. But to modify it, it's easier to just copy the xacro file you want to change to your local package, and modify the launch file that will call / make the robot description from your file. For example:

<!-- In your launch file -->
<param name="robot_description" 
command="xacro --inorder '$(find mycustom_turtlebot3_description)/urdf/turtlebot3_waffle.urdf.xacro'" />

Upvotes: 1

Related Questions