red-itmo / robotino

ROS packages for Robotino. NO LONGER SUPPORTED
5 stars 3 forks source link

robotino_node process has died #2

Closed DrUlysses closed 6 years ago

DrUlysses commented 6 years ago

Hi, I'm trying to launch the only_robotino_node to use it for the gazebo simulation, but I become the following error:

process[robotino_node-2]: started with pid [5878]
terminate called after throwing an instance of 'rec::robotino::api2::RobotinoException'
  what():  The connection has been refused.
[robotino_node-2] process has died [pid 5878, exit code -6, cmd /home/ulysses/itmo/devel/lib/robotino_node/robotino_node robotino_joint_states:=joint_states __name:=robotino_node __log:=/home/ulysses/.ros/log/b54a4234-6a49-11e8-80b8-080027863e17/robotino_node-2.log].
log file: /home/ulysses/.ros/log/b54a4234-6a49-11e8-80b8-080027863e17/robotino_node-2*.log

Have I forgot to set some variable or not installed something? If it is necessary, I can send the log files as well.

mrclient commented 6 years ago

Hi.

The error you have mentioned about arises due to one (or both) of the following reasons:

  1. RobotinoAPI2 library hasn't been properly installed.
  2. You don't use a real robot or don't have proper connection to it.

robotino_node node which is started by only_robotino_node.launch and other nodes from robotino_node package are used to provide read/write access for sensors and actuator of real robot only.

If you want to model Robotino with Gazebo simulator, you should use only its URDF model. The algorithm below gives you a minimal workable example for it.

To model Robotino using Gazebo simulator do for example this steps:

  1. Create within your home folder test.launch file with the following content:

    
    <launch>
    
    <include file="$(find gazebo_ros)/launch/empty_world.launch">
        <arg name="world_name" value="/home/YOUR_USER_NAME/Robotino.world"/>
    </include>
    
    <param name="robot_description" textfile="$(find robotino_description)/urdf/robotino.urdf" />
    
    <node name="spawn_urdf" pkg="gazebo_ros" type="spawn_model" args="-param robot_description -urdf -model robotino" />

2. Create within your home folder *Robotino.world* file with the following content:
```xml
<?xml version="1.0" ?>
<sdf version="1.4">
  <world name="default">
    <include>
      <uri>model://ground_plane</uri>
    </include>
    <include>
      <uri>model://sun</uri>
    </include>
    <include>
      <uri>model://gas_station</uri>
      <name>gas_station</name>
      <pose>-2.0 7.0 0 0 0 0</pose>
    </include>
  </world>
</sdf>
  1. Launch test.launch file by the commands:
    $ cd
    $ roslaunch test.launch

More information about needed actions is available on appropriate page of Gazebo wiki.

Before trying to launch the test.launch file make sure that gazebo_ros_pkgs and gazebo_ros_control packages were installed on your machine.

DrUlysses commented 6 years ago

Thanks for the advice, but I wanted to control the simulation with ROS as well, urdf model is just a model, to control it is needed some plugin or node/interface