I have a Gazebo simulation working for a robot through ROS. I am trying to add a custom plugin to create a fixed joint between two links when they come within a goal tolerance of each other. I have the plugin working through ROS up to the point where I would call the function
CreateJoint(const std::string &_name, const std::string &_type, physics::LinkPtr _parent, physics::LinkPtr _child) from here.
However, when the plugin gets to this line
joint = world_->GetPhysicsEngine()->CreateJoint(_type, parent_); in
CreateJoint() the Gazebo simulation crashes.
_type = "fixed" and
parent_ is a pointer to
physics::ModelPtr _model from the
Load() function in the plugin.
Here is the error report:
terminate called after throwing an instance of 'gazebo::common::Exception' /opt/ros/jade/lib/gazebo_ros/gzserver: line 34: 18759 Aborted (core dumped) GAZEBO_MASTER_URI="$desired_master_uri" gzserver $final [gazebo-2] process has died [pid 18723, exit code 134, cmd /opt/ros/jade/lib/gazebo_ros/gzserver -e ode worlds/empty.world __name:=gazebo __log:=/home/josh/.ros/log/ff87df12-a067-11e6-9510-0800273acdef/gazebo-2.log]. log file: /home/josh/.ros/log/ff87df12-a067-11e6-9510-0800273acdef/gazebo-2*.log
I am not sure what I am doing wrong here, because I have access to
world_->GetPhysicsEngine(). I tested this by displaying
world_->GetPhysicsEngine()->GetType() and it returned
Any help would be appreciated.