Giter Site home page Giter Site logo

pal-robotics-forks / gazebo_ros_link_attacher Goto Github PK

View Code? Open in Web Editor NEW

This project forked from pal-robotics/gazebo_ros_link_attacher

0.0 5.0 0.0 416 KB

Attach two Gazebo models with a virtual joint in a generalized grasp hack

CMake 7.86% C++ 35.34% Python 56.80%

gazebo_ros_link_attacher's Introduction

Attach two Gazebo models with a virtual joint in a generalized grasp hack

Build

mkdir -p gazebo_link_attacher_ws/src
cd gazebo_link_attacher_ws/src
catkin_init_workspace
git clone https://github.com/pal-robotics/gazebo_ros_link_attacher.git
cd ..
catkin_make
source devel/setup.bash

Launch

roslaunch gazebo_ros_link_attacher test_attacher.launch

Empty world with the plugin libgazebo_ros_link_attacher.so loaded (in the worlds folder).

Which provides the /link_attacher_node/attach service to specify two models and their links to be attached.

And /link_attacher_node/detach service to specify two models and their links to be detached.

gazebo screenshot

Run demo

In another shell, be sure to do source devel/setup.bash of your workspace.

rosrun gazebo_ros_link_attacher spawn.py

Three cubes will be spawned.

rosrun gazebo_ros_link_attacher attach.py

The cubes will be attached all between themselves as (1,2), (2,3), (3,1). You can move them with the GUI and you'll see they will move together.

rosrun gazebo_ros_link_attacher detach.py

The cubes will be detached and you can move them separately again.

You can also spawn items with the GUI and run a rosservice call:

rosservice call /link_attacher_node/attach "model_name_1: 'unit_box_1'
link_name_1: 'link'
model_name_2: 'unit_sphere_1'
link_name_2: 'link'"

And same thing to detach:

rosservice call /link_attacher_node/detach "model_name_1: 'unit_box_1'
link_name_1: 'link'
model_name_2: 'unit_sphere_1'
link_name_2: 'link'"

Current status

It works!

Currently it crashes with:

***** Internal Program Error - assertion (self->inertial != __null) failed in static void gazebo::physics::ODELink::MoveCallback(dBodyID):
/tmp/buildd/gazebo4-4.1.3/gazebo/physics/ode/ODELink.cc(178): Inertial pointer is NULL
Aborted (core dumped)

Which I've only seen this other useful information: Bitbucket gazebo removing moving model with ode friction fails. But it didn't help me solve my crash. I guess when attaching one model to the other it removes the second one to re-create it attached to the first or something like that.

And also this other issue: Visualizing dynamically created joints made me add a couple of lines more.

The method to attach the links is based on the grasp hack of the Gripper in gazebo/physics: Gripper.hh Gripper.cc

Which is to create a revolute joint on the first model (with range of motion 0) linking a link on the first model and a link on the second model.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.