当前位置:网站首页>Exploration of webots and ROS joint simulation (II): model import

Exploration of webots and ROS joint simulation (II): model import

2022-06-26 08:38:00 Yu Getou

Model import method :urdf File import

About sw How the model is generated urdf file , You can refer to another article of mine sw Model generation urdf Detailed flow of documents

1. install urdf2webots Function pack

pip install urdf2webots

2. Model transformation

Open the terminal in any path

python
from urdf2webots.importer import convert2urdf
#path finger urdf Path to file 
convert2urdf('path')
#example
convert2urdf('/home/jozenlee/catkin_ws/src/xrobot_ros/xrobot/urdf/xrobot.urdf')
quit()

The corresponding file can be generated in the current terminal path
 Insert picture description here

3. Import simulation environment

 Insert picture description here (1)Ctrl+Shift+A Add a node
(2) Place the model file in the corresponding folder according to the instructions , Specific path and world Storage path .

4. Model confirmation

This step is for some models that are initially in the down state ( That is, the coordinate system and webots The initial coordinate system does not coincide ), You can use the rotation axis to justify the model .
operation : Select the robot -> Press and hold the rotation symbol of the rotation axis with the mouse -> Drag the mouse to complete the rotation
 Insert picture description here

5. Parameter setting

(1) take Robot Fixed nodes , In this way, the node will be included in each open environment , And node information can be set .

Robot Right click on the node ->Convert to Base Node(s)

(2) For robotic arms , Can be base_link Physical properties of (physics) delete . It can ensure that the base of the mechanical arm will not move , Prevent dumping .


If you want to From scratch at webots Build a model , You can refer to this article
webots Robot modeling

原网站

版权声明
本文为[Yu Getou]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/02/202202170556033236.html