Gazebo | Ignition | Community
Ask Your Question
0

Can´t launch two plugins in gazebo ros-kinetic

asked 2020-04-29 10:32:44 -0600

this post is marked as community wiki

This post is a wiki. Anyone with karma >75 is welcome to improve it.

Hello there i´m new to ros and gazebo and have some question to my "project" I want my custom robto to drive and scan the location. I managed to integrate the driving part. But when i want to integrate the Laserscans i can´t drive my robot anymore but i see the laserscans. When i check rostopic there is no cmd_vel anymore and also no odom. What´s the mistake in the code ?

This is my model.gazebo file: The part for the diff_drive

<gazebo>
    <plugin filename="libgazebo_ros_diff_drive.so" name="differential_drive_controller">
      <alwaysOn>true</alwaysOn>
      <legacyMode>false</legacyMode>
      <updateRate>40</updateRate>
      <leftJoint>base_to_left_front_wheel</leftJoint>
      <rightJoint>base_to_right_front_wheel</rightJoint>
      <wheelSeparation>0.4</wheelSeparation>
      <wheelDiameter>0.2</wheelDiameter>
      <torque>0.1</torque>
      <commandTopic>cmd_vel</commandTopic>
      <odometryTopic>odom</odometryTopic>
      <odometryFrame>odom</odometryFrame>
      <robotBaseFrame>base_link</robotBaseFrame>
      <rosDebugLevel>na</rosDebugLevel>
      <publishWheelTF>true</publishWheelTF>
      <publishOdomTF>true</publishOdomTF> 
      <publishWheelJointState>true</publishWheelJointState>  
      <wheelAcceleration>0</wheelAcceleration>  
      <wheelTorque>5</wheelTorque>
      <odometrySource>world</odometrySource> 
      <publishTf>1</publishTf>
    </plugin>
</gazebo>

And the Part for the Laserscan:

<gazebo reference="lidar_link">
    <sensor type="ray" name="head_hokuyo_sensor">
      <pose>0 0 0 0 0 0</pose>
      <visualize>false</visualize>
      <update_rate>20</update_rate>
      <ray>
        <scan>
          <horizontal>
            <samples>720</samples>
            <resolution>1</resolution>
            <min_angle>-1.570796</min_angle>
            <max_angle>1.570796</max_angle>
          </horizontal>
        </scan>
        <range>
          <min>0.10</min>
          <max>10.0</max>
          <resolution>0.01</resolution>
        </range>
        <noise>
          <type>gaussian</type>
          <mean>0.0</mean>
          <stddev>0.01</stddev>
        </noise>
      </ray>
      <plugin name="gazebo_ros_head_hokuyo_controller" filename="libgazebo_ros_laser.so">
        <topicName>/indusbot/laser/scan</topicName>
        <frameName>lidar_link</frameName>
        <robotSimType>gazebo_ros_control/DefaultRobotHWSim</robotSimType>
        <legacyMode>true</legacyMode>
      </plugin>
    </sensor>
</gazebo>

I launch it with launch file

<?xml version="1.0" encoding="UTF-8"?>
<launch>
  <arg name="model" default="$(find test_description)/urdf/model_file.urdf.xacro" />
  <arg name="rvizconfig" default="$(find test_description)/rviz/urdf.rviz" />
  <arg name="paused" default="false"/>
  <arg name="use_sim_time" default="true"/>
  <arg name="gui" default="true"/>
  <arg name="gui_state_publisher" default="false"/>
  <arg name="headless" default="false"/>
  <arg name="debug" default="false"/>

  <include file="$(find gazebo_ros)/launch/empty_world.launch">
    <arg name="debug" value="$(arg debug)" />
    <arg name="gui" value="$(arg gui)" />
    <arg name="paused" value="$(arg paused)"/>
    <arg name="use_sim_time" value="$(arg use_sim_time)"/>
    <arg name="headless" value="$(arg headless)"/>
  </include>

  <node name="urdf_spawner" pkg="gazebo_ros" type="spawn_model"
        args="-z 1.0 -unpause -urdf -model robot -param robot_description" respawn="false" output="screen" />
  <include file="$(find test_description)/launch/test_rviz.launch"></include>
  <include file="$(find test_description)/launch/test_gazebo.launch"></include>
  <param name="robot_description" command="$(find xacro)/xacro --inorder $(arg model)"/>
  <node pkg="robot_state_publisher" type="robot_state_publisher"  name="robot_state_publisher">
    <param name="publish_frequency" type="double" value="30.0" />
  </node>
  <node name="joint_state_publisher" pkg="joint_state_publisher" type="joint_state_publisher">
    <param name="use_gui" value="False"/>
  </node>
  <node name="rviz" pkg="rviz" type="rviz" args="-d $(arg rvizconfig)"/>

</launch>
edit retag flag offensive close merge delete

1 Answer

Sort by » oldest newest most voted
0

answered 2020-05-05 09:01:38 -0600

ahcorde gravatar image

Hello,

can you provide more details? Do you see any errors in the terminal? Can you include in your launch file <arg name="verbose" value="true" /> bellow <arg name="headless" value="$(arg headless)"/> ? Please check the output and provide more details about the links and the robot model.

Regards

edit flag offensive delete link more

Question Tools

1 follower

Stats

Asked: 2020-04-29 10:32:44 -0600

Seen: 148 times

Last updated: Apr 29 '20