gergondet / panda_cnoid

VRML and project files to run simulation with a panda robot in Choreonoid
1 stars 2 forks source link

panda_cnoid

This repository contains the necessary VRML and cnoid project file to run panda simulation with Choreonoid and mc_openrtm.

The project takes care of:

The URDF model for Panda was taken from franka_gazebo which is a dependency of this project. The VRML model was converted using simtrans and restoring joint axis to the URDF ones.

Dependencies

Install

mkdir build
cd build
cmake ../
make
sudo make install

Usage

Edit your mc_rtc configuration so that MainRobot is panda

Adding a new panda variant

  1. Create a new xacro file for your panda extension

An example is given in xacro/panda_arm_foot.urdf.xacro. In that particular case we are putting a specific end-effector on the panda arm so the xacro file itself includes the panda arm xacro file for franka_gazebo.

Things to note:

  1. Create an mc_rtc YAML RobotModule and aliase

Simply copy the existing models in the repository.

  1. Append the relevant data to CMakeLists.txt

This will ensure that the URDF model is generated from your xacro file and that the robot model and aliases are generated.

Here is the relevant snippet for panda_arm_foot

configure_file("xacro/foot.xacro" "${CMAKE_BINARY_DIR}/xacro/foot.xacro" @ONLY)
install(FILES xacro/meshes/foot.stl DESTINATION "${MESHES_DESTINATION}")
GENERATE_ROBOT("xacro/panda_arm_foot.urdf.xacro" "panda_foot" "${CMAKE_BINARY_DIR}/xacro/foot.xacro")

The first two lines take care of generating the intermediary xacro file we need and to install the extra mesh we have added.

The last line is generating the robot URDF and the relevant files for mc_rtc. The first two arguments are mandatory, they provide the main xacro file used to generate the urdf and the robot name. Extra arguments are provided to specify extra dependencies on the URDF generation.

  1. Generate a VRML model

This requires simtrans and a generated URDF file.

Go into the model/panda folder and run the following:

simtrans -i /path/to/your/panda.urdf -o panda_arm_myvariant.wrl

You then need to edit panda_arm_myvariant.wrl to:

You can check that your robot is displayed correctly by running choreonoid panda_arm_myvariant_project.cnoid. You can remove this file and panda_arm_myvariant_project.xml afterwards as those files are not required.

  1. Generate a cnoid project

First copy cnoid/panda_foot into cnoid/panda_myvariant. If you robot does not have extra joints that's probably enough.

If needed, here are the three files:

Once these files are correct, you can append the following to CMakeLists.txt:

GENERATE_CNOID_PROJECT(panda_myvariant panda_arm_myvariant)