Skip to content

[HardwareSim] More documentation / examples, please? #20052

Open
@RussTedrake

Description

@RussTedrake

The functionality is complex and the code is difficult to read with all of the templated callbacks, etc, and the split between python and c++. Here are a few things that I believe can be made to work now, but I would appreciate an example and/or documentation:

  • adding a new driver config from pydrake. @jwnimmer-tri told me that "ApplyDriverConfigs does apply_function = getattr(module, "ApplyDriverConfig"). So they can add new configs, [pydrake users] just need to make a function in the same module to apply it / them."
  • lcm channel suffix. My first quick attempt to add multiple iiwas to the simulation resulted in them both publishing/listening on the same channels:
# This file is licensed under the MIT-0 License.
# See LICENSE-MIT-0.txt in the current directory.

# This demo simulation shows an IIWA arm with an attached WSG gripper.
Demo:
  directives:
  - add_model:
      name: amazon_table
      file: package://drake/examples/manipulation_station/models/amazon_table_simplified.sdf
  - add_weld:
      parent: world
      child: amazon_table::amazon_table
  - add_model:
      name: iiwa
      file: package://drake/manipulation/models/iiwa_description/urdf/iiwa14_primitive_collision.urdf
      default_joint_positions:
        iiwa_joint_1: [-0.2]
        iiwa_joint_2: [0.79]
        iiwa_joint_3: [0.32]
        iiwa_joint_4: [-1.76]
        iiwa_joint_5: [-0.36]
        iiwa_joint_6: [0.64]
        iiwa_joint_7: [-0.73]
  - add_frame:
      name: iiwa_on_world
      X_PF:
        base_frame: world
        translation: [0, -0.7, 0]
        rotation: !Rpy { deg: [0, 0, 90] }
  - add_weld:
      parent: iiwa_on_world
      child: iiwa::base
  - add_model:
      name: wsg
      file: package://drake/manipulation/models/wsg_50_description/sdf/schunk_wsg_50_with_tip.sdf
      default_joint_positions:
        left_finger_sliding_joint: [-0.02]
        right_finger_sliding_joint: [0.02]
  - add_frame:
      name: wsg_on_iiwa
      X_PF:
        base_frame: iiwa::iiwa_link_7
        translation: [0, 0, 0.114]
        rotation: !Rpy { deg: [90, 0, 90] }
  - add_weld:
      parent: wsg_on_iiwa
      child: wsg::body
  - add_model:
      name: iiwa2
      file: package://drake/manipulation/models/iiwa_description/urdf/iiwa14_primitive_collision.urdf
      default_joint_positions:
        iiwa_joint_1: [-0.2]
        iiwa_joint_2: [0.79]
        iiwa_joint_3: [0.32]
        iiwa_joint_4: [-1.76]
        iiwa_joint_5: [-0.36]
        iiwa_joint_6: [0.64]
        iiwa_joint_7: [-0.73]
  - add_frame:
      name: iiwa2_on_world
      X_PF:
        base_frame: world
        translation: [0, 0.7, 0]
        rotation: !Rpy { deg: [0, 0, 90] }
  - add_weld:
      parent: iiwa2_on_world
      child: iiwa2::base
  - add_model:
      name: wsg2
      file: package://drake/manipulation/models/wsg_50_description/sdf/schunk_wsg_50_with_tip.sdf
      default_joint_positions:
        left_finger_sliding_joint: [-0.02]
        right_finger_sliding_joint: [0.02]
  - add_frame:
      name: wsg2_on_iiwa
      X_PF:
        base_frame: iiwa2::iiwa_link_7
        translation: [0, 0, 0.114]
        rotation: !Rpy { deg: [90, 0, 90] }
  - add_weld:
      parent: wsg2_on_iiwa
      child: wsg2::body
  cameras:
    oracular_view:
      name: camera_0
      X_PB:
        translation: [1.5, 0.8, 1.25]
        rotation: !Rpy { deg: [-120, 5, 125] }
  model_drivers:
    iiwa: !IiwaDriver
      hand_model_name: wsg
    wsg: !SchunkWsgDriver {}
    iiwa2: !IiwaDriver
      hand_model_name: wsg2
    wsg2: !SchunkWsgDriver {}

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions