osrf / drcsim

Repository for the DRC project.
18 stars 7 forks source link

Provide detailed release notes #373

Closed osrf-migration closed 11 years ago

osrf-migration commented 11 years ago

Original report (archived issue) by Jesper Smith (Bitbucket: jespersmith).


After upgrading to drcsim 3.1 I've to hunt down what changed and were all the files moved. It would be nice if detailed release notes are provided giving a description of the changes.

osrf-migration commented 11 years ago

Original comment by Jesper Smith (Bitbucket: jespersmith).


This update broke most of our model file importers, leaving us dead in the water as far Gazebo integration with our controller and updating to the latest model is concerned.

It seems that the atlas robot is not included in the world files any more, but dynamically loaded by the Atlas plugin?

osrf-migration commented 11 years ago

Original comment by Jesper Smith (Bitbucket: jespersmith).


A little bit more information:

I've a world file with

#!xml
<include>
<uri>model://atlas_v3_sandia_hands</uri>
<plugin [myplugin] />
</include>

I cannot get this to work any more.

osrf-migration commented 11 years ago

Original comment by John Hsu (Bitbucket: hsu, GitHub: hsu).


Atlas is now spawned by VRCPlugin.cc from ROS parameter named robot_description. VRCPlugin is included in world files, for example see atlas.world.

One way to add custom plugin to a robot is to modify installed atlas_description/robots/atlas_v3_sandia_hands.urdf.xacro, and modify its content to include your plugin:

<robot xmlns:xacro="http://www.ros.org/wiki/xacro" name="atlas" >

  <xacro:include filename="$(find atlas_description)/urdf/atlas_v3.urdf" />
  <xacro:include filename="$(find sandia_hand_description)/urdf/sandia_hand_simple_shapes.urdf.xacro" />

  <xacro:sandia_hand side="right" parent="r_hand" reflect="1" joint_type="revolute" thumb_angle="0">
    <origin xyz="-0.00179 -0.13516 0.01176" rpy="0 0 -1.57079"/>
  </xacro:sandia_hand>
  <xacro:sandia_hand side="left" parent="l_hand" reflect="-1" joint_type="revolute" thumb_angle="0">
    <origin xyz="0.00179  0.13516 0.01176" rpy="0 0  1.57079"/>
  </xacro:sandia_hand>

  <xacro:include filename="$(find atlas_description)/urdf/atlas_v3.gazebo" />
  <xacro:include filename="$(find atlas_description)/urdf/atlas_v3.transmission" />
  <xacro:include filename="$(find multisense_sl_description)/urdf/multisense_sl_v3.urdf" />

  <gazebo>
    <!-- include plugin for sandia hands -->
    <plugin name="sandia_hand_plugin" filename="libSandiaHandPlugin.so"/>

    <!-- custom plugin -->
    <plugin name="[my plugin]" filename="lib[My Plugin].so"/>
  </gazebo>
</robot>

Of course, this is not as clean if you have installed from deb, requiring root access to modify things in /opt/ros/groovy[hydro]/share/atlas_description/robots/*.xacro.

Another way is to create your own ROS package:

mkdir ~/drcsim_ws
cd ~/drcsim_ws
roscreate-pkg atlas_ihmc_gazebo atlas_description drcsim_gazebo

Prepend your new package path to ROS_PACKAGE_PATH

export ROS_PACKAGE_PATH=~/drcsim_ws:${ROS_PACKAGE_PATH}

Copy launch files from drcsim_gazebo/launch/atlas_v3_sandia_hands.launch and rename reference to atlas_description to atlas_ihmc_description/robots as such:

<launch>

  <arg name="gzname" default="gazebo"/>
  <arg name="gzworld" default="atlas_sandia_hands.world"/>
  <arg name="hand_suffix" default=""/>
  <arg name="extra_gazebo_args" default="-q" />

  <param name="/atlas/time_to_unpin" type="double" value="1.0"/>
  <param name="/atlas/startup_mode" type="string" value="bdi_stand"/>
  <!-- <param name="/atlas/startup_mode" type="string" value="pinned"/> -->

  <!-- start gazebo with the Atlas -->
  <include file="$(find drcsim_gazebo)/launch/atlas_no_controllers.launch">
    <arg name="gzname" value="$(arg gzname)"/>
    <arg name="gzworld" value="$(arg gzworld)"/>
    <arg name="extra_gazebo_args" value="$(arg extra_gazebo_args)"/>
  </include>

  <!-- to trigger synchronization delay, set
       atlas_msgs::AtlasCommand::desired_controller_period_ms to non-zero -->
  <param name="/atlas/delay_window_size" type="double" value="5.0"/>
  <param name="/atlas/delay_max_per_window" type="double" value="0.25"/>
  <param name="/atlas/delay_max_per_step" type="double" value="0.025"/>

  <!-- Robot Description -->
  <param name="robot_description" command="$(find xacro)/xacro.py '$(find atlas_ihmc_description)/robots/atlas_v3_sandia_hands.urdf.xacro'" />
  <param name="robot_initial_pose/x"     value="0" type="double"/>
  <param name="robot_initial_pose/y"     value="0" type="double"/>
  <param name="robot_initial_pose/z"     value="0.95" type="double"/>
  <param name="robot_initial_pose/roll"  value="0" type="double"/>
  <param name="robot_initial_pose/pitch" value="0" type="double"/>
  <param name="robot_initial_pose/yaw"   value="0" type="double"/>

  <include file="$(find drcsim_gazebo)/launch/atlas_v3_sandia_hands_bringup.launch"/>
</launch>

Also copy robot xacro file from atlas_description/robots/atlas_v3_sandia_hands.launch into your new package and add a line to include the custom plugin as such:

<robot xmlns:xacro="http://www.ros.org/wiki/xacro" name="atlas" >

  <xacro:include filename="$(find atlas_description)/urdf/atlas_v3.urdf" />
  <xacro:include filename="$(find sandia_hand_description)/urdf/sandia_hand_simple_shapes.urdf.xacro" />

  <xacro:sandia_hand side="right" parent="r_hand" reflect="1" joint_type="revolute" thumb_angle="0">
    <origin xyz="-0.00179 -0.13516 0.01176" rpy="0 0 -1.57079"/>
  </xacro:sandia_hand>
  <xacro:sandia_hand side="left" parent="l_hand" reflect="-1" joint_type="revolute" thumb_angle="0">
    <origin xyz="0.00179  0.13516 0.01176" rpy="0 0  1.57079"/>
  </xacro:sandia_hand>

  <xacro:include filename="$(find atlas_description)/urdf/atlas_v3.gazebo" />
  <xacro:include filename="$(find atlas_description)/urdf/atlas_v3.transmission" />
  <xacro:include filename="$(find multisense_sl_description)/urdf/multisense_sl_v3.urdf" />

  <gazebo>
    <!-- include plugin for sandia hands -->
    <plugin name="sandia_hand_plugin" filename="libSandiaHandPlugin.so"/>

    <!-- custom plugin -->
    <plugin name="[my plugin]" filename="lib[My Plugin].so"/>
  </gazebo>
</robot>

One of the two above options should work (note: untested), while we try to come up with a cleaner solution.

osrf-migration commented 11 years ago

Original comment by Jesper Smith (Bitbucket: jespersmith).


As I understand from this, there is no easy way any more to generate a SDF file based on the .world files. Our control software imports SDF files directly to parse the robot parameters. Our own simulation software is able to read SDF world files to simulate the environment. With these changes there is no easy way to import the robot model in our controller or simulation any more. The recent changes require us to spend significant time to figure how and where all the models are stored, hence the request for an extensive changelog. As DRCsim is the source for the atlas data and the worlds, itheyshould be available in an easily accasible format/location. The world files are probably also going to be used by track A teams without Atlas.

Although the Gazebo physics blow up on us now, we like to test our controller on Gazebo as well, mostly for multi-contact behaviour, hence the custom plugin. Because this plugin sets joint forces and torques directly as well as controlling the sim world it probably interferes with the VRCPlugin. Hence our desire to have a clean world file with just the plugins we want (for 3.0 we use a xslt file to add our custom plugin).

We were hoping that, like Gazebo, DRCsim would have an optional dependency on ROS. We write our software in Java, which does not have a high performance ROS binding. Furthermore, we like to run our controller and sim on multiple platforms, making the use of ROS hard. Therefore, we try to avoid any dependency on ROS.

osrf-migration commented 11 years ago

Original comment by Jesper Smith (Bitbucket: jespersmith).


Further research showed that I can use xacro to create the model files in the following way

#!bash
robotdir="/opt/ros/groovy/share/atlas_description/robots/"
export GAZEBO_MODEL_PATH=`pwd`/models:$GAZEBO_MODEL_PATH
for f in "$robotdir"/*.xacro
do
        bzname=`basename "$f" .urdf.xacro`
        mkdir -p models/"$bzname"
        rosrun xacro xacro.py $f > models/"$bzname"/model.sdf
        cp model.config.template models/"$bzname"/model.config
done

Then using an xslt file on the world file, we can reinsert the robot and create a complete file using gzsdf print for our simulator.

osrf-migration commented 11 years ago

Original comment by Brian Gerkey (Bitbucket: Brian Gerkey, GitHub: gerkey).


@jespersmith, can you have a look at the issue_373 branch?

I added back in the compile-time xacro run that we used to do and, inspired by your comment, did a bit of cleanup via xslt. With this change, you should be able to add <install_prefix>/share/atlas_description/static_models to your GAZEBO_MODEL_PATH and then instantiate the models (I'm not somewhere that I can test that right now).

Is this useful? If so, I'll generalize it and apply it to the other components of drcsim that contain .urdf.xacro files.

It also sounds like you want to use the .world files outside of Gazebo; I'll have a look at processing those, hopefully pulling the robot and vehicles poses out of the accompanying .launch files (the pose data is given as ROS params in the .launch files).

With enough tweaks, we ought to be able to produce standalone, plugin-free world and model files that can be loaded by anybody who can parse SDF.

osrf-migration commented 11 years ago

Original comment by Jesper Smith (Bitbucket: jespersmith).


That sounds vey useful, thanks

osrf-migration commented 11 years ago

Original comment by Brian Gerkey (Bitbucket: Brian Gerkey, GitHub: gerkey).


pull request #408 does most of what's asked here

osrf-migration commented 11 years ago

Original comment by Brian Gerkey (Bitbucket: Brian Gerkey, GitHub: gerkey).


Related: issue #384