Gazebo | Ignition | Community
Ask Your Question

jwatson_utah_edu's profile - activity

2018-10-20 21:28:50 -0500 received badge  Taxonomist
2017-10-23 11:05:54 -0500 received badge  Famous Question (source)
2017-07-28 06:31:55 -0500 received badge  Famous Question (source)
2017-02-13 13:37:41 -0500 received badge  Notable Question (source)
2017-01-23 10:30:40 -0500 received badge  Popular Question (source)
2016-09-07 19:51:59 -0500 received badge  Famous Question (source)
2016-08-25 11:11:26 -0500 received badge  Notable Question (source)
2016-08-24 18:59:24 -0500 commented answer gazebo::physics::get_world crashes node

I didn't realize that was available as part of a world plugin. I am writing a plugin now, and I am sorting out how to set up listeners and publishers.

2016-08-23 20:25:45 -0500 received badge  Popular Question (source)
2016-08-23 13:19:25 -0500 commented answer How to programmatically attach link to a model during simulation?

@PeterMitrano: I'd like to put one of those together once I figure that out. I have one very specific question about getting references to objects the the Gazebo world. See link: http://answers.gazebosim.org/question/14185/gazebophysicsget_world-crashes-node/ I'm not sure what you mean by PR.

2016-08-17 21:37:47 -0500 commented answer How to programmatically attach link to a model during simulation?

I'm flagging this as the answer, though I'm having some trouble implementing it. http://answers.gazebosim.org/question/14185/gazebophysicsget_world-crashes-node/

2016-08-17 21:34:11 -0500 asked a question gazebo::physics::get_world crashes node

ROS Indigo on Ubuntu 14.04 with Gazebo 7

I am trying to access the models in a Gazebo world via a node. In order to do this, I am just trying to get a reference to the world. Using the get_world function in the gazebo::physics namespace causes the node process to die. I try to catch the offending error below, but information from the error is not printed. The node just dies. The usage of this function in the docs seems straightforward. Why does this crash?

// ROS
#include <ros/ros.h>
#include <ros/package.h>
#include <std_msgs/Header.h>
#include <std_msgs/String.h>
#include <std_msgs/Char.h>
// Gazebo
#include <boost/bind.hpp>
#include <gazebo/gazebo.hh>
#include <gazebo/physics/physics.hh>
#include <gazebo/common/common.hh>
#include <stdio.h>
//#include "gazebo/GetWorldProperties.h" // DO I NEED THIS? , Error if included 

int main(int argc, char** argv){ // Accept args from the console

    ros::init(argc, argv, "attacher_node"); 

    ros::NodeHandle nh("attacher_handle"); // Start the node and give it a name

    ros::Publisher rNotifyPub = nh.advertise<std_msgs::String>( "/regrasp/notify" , 100 ); 

    std_msgs::String outMsg;

    try {
        // Get a reference to the world  
        gazebo::physics::WorldPtr worldRef = gazebo::physics::get_world("default"); 
    } catch (const std::exception& e) { // The error is never caught, process dies
        outMsg.data = e.what(); 
        rNotifyPub.publish(outMsg);
    }

    return 0; // Return OK
}

The following error information is printed when I run the launch file that calls the node:

[attacher_node-10] process has died [pid 28515, exit code -6, cmd /home/jwatson/regrasp_planning/devel/lib/grasp_anything/attacher_node __name:=attacher_node __log:=/home/jwatson/.ros/log/0e0eaf34-64e5-11e6-8d9b-0022191c2335/attacher_node-10.log].
log file: /home/jwatson/.ros/log/0e0eaf34-64e5-11e6-8d9b-0022191c2335/attacher_node-10*.log

The log file mentioned in the error message does not exist.

I also tried to move the initialization of this node to another launch file that I started after Gazebo had finished loading. This was to prevent the case in which Gazebo perhaps hadn't fully started when ROS was trying to start the above node. Starting the node separately did not resolve the issue.

2016-08-16 20:19:36 -0500 received badge  Famous Question (source)
2016-08-08 13:41:03 -0500 received badge  Notable Question (source)
2016-08-08 11:14:40 -0500 commented answer How to programmatically attach link to a model during simulation?

Thanks, I will take a look at these. ~ The traditional Gazebo / Rviz split seems a little strange to me. Gazebo has ample graphical capability, so my first instinct was to use the tool I was already using to give a very basic representation (less than 5 markers) of what is going on under the hood. Rviz is great for displaying point clouds and complex plans, but that's much more than I need at the moment.

2016-08-08 10:48:05 -0500 commented question How to programmatically attach link to a model during simulation?

Upgrading lab equipment isn't under my authority, but I have suggested it. Until then I'm making lemonade.

2016-08-08 10:43:48 -0500 received badge  Popular Question (source)
2016-08-07 13:53:20 -0500 commented answer Gazebo object spawned in robot link frame does not move with robot link

@Peter_Mitrano, Option 1 mostly works although the results are kind of jittery. Dart does not seem to want to let me turn off gravity while the node does its position update work. ~ Now I have a new context that would be served by using Option 2, but I have not found a way to do this. See question below: http://answers.gazebosim.org/question/14072/how-to-programmatically-attach-link-to-a-model-during-simulation/

2016-08-07 13:50:24 -0500 asked a question How to programmatically attach link to a model during simulation?

Indigo on Ubuntu 14.04 with Gazebo 7.3 and Python 2.7

I have non-colliding URDF models to be used as markers in Gazebo. The markers will be attached to objects to be grasped, and their positions relative to those objects will change as planning executes. I have not found a tutorial or example of programmatically attaching a URDF model to either a world object or robot link as a link that moves with the target object. Can this be done with rospy?

I'd like to implement this in Gazebo rather than RViz because the equipment I have been provided with struggles with Gazebo on its own.

2016-08-07 13:36:51 -0500 received badge  Supporter (source)
2016-08-07 13:36:43 -0500 received badge  Scholar (source)
2016-08-07 12:03:16 -0500 received badge  Enthusiast
2016-08-05 18:32:02 -0500 received badge  Editor (source)
2016-08-05 18:31:25 -0500 asked a question Deleting Gazebo model causes Python to freeze

Indigo on Ubuntu 14.04 with Gazebo 7.3 and Python 2.7

Whenever I call the Gazebo model deletion service, Python freezes. No errors or special messages appear when the deletion code runs. This happens whether I wait for the service to become available or not. I checked that the model name is correct.

from gazebo_msgs.srv import DeleteModel # For deleting models from the environment

def del_model( modelName ): # FIXME: Freezes Python, DO NOT USE!
    """ Remove the model with 'modelName' from the Gazebo scene """
    # delete_model : gazebo_msgs/DeleteModel
    del_model_prox = rospy.ServiceProxy('gazebo/delete_model', DeleteModel) # model spawner
    # rospy.wait_for_service('gazebo/delete_model') # Wait for the model loader to be ready 
    # FREEZES EITHER WAY
    del_model_prox(modelName) # Remove from Gazebo

There is no feedback from ROS / Gazebo as to what is happening. Why does this happen?

2016-08-05 18:28:54 -0500 received badge  Notable Question (source)
2016-08-02 16:36:21 -0500 commented answer Gazebo object spawned in robot link frame does not move with robot link

@Peter_Mitrano, I will try these and let you know which one works.

2016-08-01 11:15:32 -0500 received badge  Popular Question (source)
2016-07-31 18:40:27 -0500 asked a question Gazebo object spawned in robot link frame does not move with robot link

ROS Indigo on Ubuntu 14.04 with Gazebo 7.3 and Python 2.7

I use a Gazebo service to spawn a fixed object in a link reference frame, but the object remains fixed with respect to the world instead of with respect to the frame. Why is this so? Here is the rospy code:

def test_robot_attachment():
    """ Try attaching an axes model to a robot frame and see what happens """
    global attachCounter
    spawn_model_prox = rospy.ServiceProxy('gazebo/spawn_sdf_model', SpawnModel) # Get a handle to the Gazebo model spawner
    modelPath = rospack.get_path('grasp_anything') + '/urdf/block_axes.urdf' # Build a path to the model URDF
    f = open(modelPath,'r') # Open the URDF for reading
    sdff = f.read() # and read it
    rospy.wait_for_service('gazebo/spawn_sdf_model') # Wait for the model loader to be ready
    targetPose = ROS_geo_pose_from_lists( [ 0.5 , 0.5 , 0.5 ] , [0,0,0,1] )
    spawn_model_prox("axesAttached" + str(attachCounter), sdff, "robotos_name_space", targetPose, "lbr4_allegro::lbr4_7_link") # gen model name and place the axes at the specfied pose
    attachCounter += 1

Is there a way to attach a model to a moving frame such that it moves with the frame but is static within the frame itself? As you can see below, the URDF being inserted has no collision geometry, the model is set to static, and gravity is turned off for the model.

Here is "block_axes.urdf":

<?xml version="1.0"?>
<!-- URL, Spawning simple geometry in Gazebo: http://wiki.ros.org/simulator_gazebo/Tutorials/SpawningObjectInSimulation -->
<robot name="block_axes"> <!-- Every URDF model you add is a "robot" -->
    <link name="x_axis">
        <!-- URL, Inertia element must be present: http://gazebosim.org/tutorials?tut=ros_urdf#%3Cinertial%3EElement -->
        <inertial>
            <origin xyz="2 0 0" />
            <mass value="1.0" />
            <inertia  ixx="1.0" ixy="0.0"  ixz="0.0"  iyy="100.0"  iyz="0.0"  izz="1.0" />
        </inertial>
        <visual>
            <!--origin xyz="2 0 1"/-->  <!-- Is this absolute or relative? -->
            <origin xyz="0.05 0 0"/>
            <geometry>
                <box size="0.1 0.01 0.01" />
            </geometry>
        </visual>
    </link>
    <joint name="X-Y" type="continuous">
        <parent link="x_axis"/>
        <child  link="y_axis"/>
    </joint>
    <link name="y_axis">
        <!-- URL, Inertia element must be present: http://gazebosim.org/tutorials?tut=ros_urdf#%3Cinertial%3EElement -->
        <inertial>
            <origin xyz="2 0 0" />
            <mass value="1.0" />
            <inertia  ixx="1.0" ixy="0.0"  ixz="0.0"  iyy="100.0"  iyz="0.0"  izz="1.0" />
        </inertial>
        <visual>
            <!--origin xyz="2 0 1"/-->  <!-- Is this absolute or relative? -->
            <origin xyz="0 0.05 0"/>
            <geometry>
                <box size="0.01 0.1 0.01" />
            </geometry>
        </visual>
    </link>
    <joint name="X-Z" type="continuous">
        <parent link="x_axis"/>
        <child  link="z_axis"/>
    </joint>
    <link name="z_axis">
        <!-- URL, Inertia element must be present: http://gazebosim.org/tutorials?tut=ros_urdf#%3Cinertial%3EElement -->
        <inertial>
            <origin xyz="2 0 0" />
            <mass value="1.0" />
            <inertia  ixx="1.0" ixy="0.0"  ixz="0.0"  iyy="100.0"  iyz="0.0"  izz="1.0" />
        </inertial>
        <visual>
            <!--origin xyz="2 0 1"/-->  <!-- Is this absolute or relative? -->
            <origin xyz="0 0 0.05"/>
            <geometry>
                <box size="0.01 0.01 0.1" />
            </geometry>
        </visual>
    </link>
    <gazebo reference ...
(more)
2016-07-31 18:40:06 -0500 commented question Gazebo object spawned in robot link frame does not move with robot link

My present goal is to attach and detach a physics object to and from a particular robot link. I need something even "cheaper" than the `gazebo_grasp_plugin`, as I wish to avoid all contact modeling, and `gazebo_grasp_plugin`, does not allow joints in between palm and gripper tips.