You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

如何在Webots中编辑PUMA560 Proto文件及解决夹具更换问题

Fixing PUMA560 Fixture Issues in Webots

Hey there! Let's work through your PUMA560 fixture problems—these are super common when tweaking Webots PROTO files, so you're not alone here.


1. Fixing Disappearing Objects After Fixture Replacement

When your entire robot vanishes after swapping the fixture, it's almost always a coordinate/transform issue or invalid PROTO syntax. Here's how to edit the PUMA560 PROTO correctly:

  • Locate the PROTO file: Navigate to your Webots installation's projects/robots/unimation/puma560/protos folder and open PUMA560.proto in a text editor (VS Code works great for this).
  • Find the end effector block: Scroll to the children section of the final wrist link (usually link[6]). You'll see the original fixture—this might be a Mesh or custom Shape node.
  • Replace with your Box fixture: Swap the old geometry with a Box node, but keep the original transform values (translation/rotation) to ensure it stays attached to the wrist. Example:
    # Original fixture (example)
    Shape {
      appearance PBRAppearance {
        baseColor 0.7 0.7 0.7
      }
      geometry Mesh { url "webots://projects/robots/unimation/puma560/meshes/puma560_fixture.obj" }
    }
    
    # Replace with this Box fixture (adjust size to your needs)
    Shape {
      appearance PBRAppearance {
        baseColor 0.8 0.2 0.2
        roughness 0.6
      }
      geometry Box { size 0.06 0.06 0.12 }
    }
    
  • Verify transforms: Make sure the parent Transform node (if any) has the same translation and rotation as the original fixture. If you set these incorrectly, the Box might be placed inside the robot or far outside the camera view.
  • Save and reload: Save the PROTO file, then either restart Webots or right-click the PUMA560 node in your scene and select "Reload PROTO".

If it's still missing, check the size of your Box—if it's tiny (e.g., 0.001 0.001 0.001), it'll be practically invisible. Also, ensure you didn't accidentally delete any critical robot nodes while editing the PROTO.


2. Removing the Old Fixture and Binding the Controller

If the old fixture lingers even after adding a new one, you need to clean up both the PROTO and your scene, then link the controller properly:

Step 1: Delete the old fixture entirely

  • From the PROTO: In PUMA560.proto, find every trace of the original fixture (including any Collision nodes tied to it) and delete those lines. Don't leave partial nodes—this can cause unexpected behavior.
  • From the scene: If you manually added a new fixture to your scene (instead of editing the PROTO), open the Scene Tree, expand the PUMA560 node, find the old fixture child node, right-click it, and select "Delete".

Step 2: Bind the controller to the new fixture

  • Fixed fixture: If your new fixture is just a static shape attached to the wrist, you don't need extra setup—since it's a child of the final wrist link, the controller's existing code for moving the PUMA560 will automatically move the fixture too.
  • Motorized/gripping fixture: If your fixture needs movement (e.g., a gripper), add a RotationalMotor or LinearMotor node as a child of the wrist link, then assign it a unique DEF name (e.g., DEF GripperMotor RotationalMotor { ... }). Update your controller code to reference this DEF name when controlling the motor:
    // Example C++ controller code
    WbDeviceTag gripper_motor = wb_robot_get_device("GripperMotor");
    wb_motor_set_position(gripper_motor, 0.5);
    
  • Sensor integration: If you need touch/force feedback for gripping, add a TouchSensor to the fixture and enable it in your controller with wb_touch_sensor_enable(sensor, TIME_STEP);.

Quick Tips

  • Always back up the original PUMA560.proto file before editing—this lets you revert if something breaks.
  • Use the Webots Scene Editor to test fixture positions first: drag a Box into the scene, adjust its translation/rotation until it's correctly attached to the wrist, then copy those values into the PROTO.
  • Double-check controller code for any hardcoded references to the old fixture's DEF name—if you renamed things, those references need to match.

内容的提问来源于stack exchange,提问作者Shanaka Ramesh

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.05.14 08:57:57