Ask Your Question

Pioneer_p3dx simulation on Gazebo, not stopping on key release

asked 2018-07-09 17:27:19 -0500

manuelmelvin gravatar image

updated 2018-07-09 17:38:10 -0500

I am working on Pioneer P3dx simulation on Gazebo.Using the package "ua_ros_p3dx". When I am using keyboard to control the robot, the robot is moving, but once release the key from the keyboard, still the robot moves. Its not getting stopped. Till I press any other key the robot continues on the previous command. Please help me to resolve the issue.

The link for the package I am using is

Thanks Melvin

edit retag flag offensive close merge delete


Can you please update your question with a link to the package that you're using

jayess gravatar imagejayess ( 2018-07-09 17:31:32 -0500 )edit

I have updated with the package link. Thank you

manuelmelvin gravatar imagemanuelmelvin ( 2018-07-09 17:39:03 -0500 )edit

1 Answer

Sort by ยป oldest newest most voted

answered 2018-07-12 16:58:42 -0500

updated 2018-07-15 22:24:10 -0500

Hello @manuelmelvin,

Unfortunately, using the differential driver gazebo plugin like this will not work. But the good news is that you can use in a different way, like they do for Husky or Jackal robots ( ).

Basically, it's about using the diff_drive_controller (

By doing this, you can set the variable cmd_vel_timeout as your needs.

I've cloned your repo and worked on one of my own, see below the main modifications I've done or if you prefer, check in my public repository the merge I've done to master branch (

Yet, you can run my ROSJect using this ROSDS link (

Or watch this video to follow the instructions:

Here it goes the modifications:

p3dx_description/urdf/pioneer3dx.gazebo (just comment the plugin code)

        <plugin name="differential_drive_controller" filename="">

p3dx_description/urdf/pioneer3dx_wheel.xacro (change hardwareInterface value to VelocityJointInterface)

    <transmission name="${parent}_${suffix}_wheel_trans">
      <joint name="base_${suffix}_wheel_joint">
      <actuator name="base_${suffix}_wheel_motor">
        <mechanicalReduction>${reflect * 624/35 * 80/19}</mechanicalReduction>

p3dx_gazebo/launch/gazebo.launch (Spawn the differential drive controller)


    <!-- these are the arguments you can pass this launch file, for example 
        paused:=true -->
    <arg name="paused" default="false" />
    <arg name="use_sim_time" default="true" />
    <arg name="gui" default="true" />
    <arg name="headless" default="false" />
    <arg name="debug" default="false" />

    <!-- We resume the logic in empty_world.launch, changing only the name of 
        the world to be launched -->
    <include file="$(find gazebo_ros)/launch/empty_world.launch">
        <!--<arg name="world_name" value="$(find p3dx_gazebo)/worlds/" />-->
        <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)" />

    <group ns="/p3dx">

        <!-- Load the URDF into the ROS Parameter Server -->

        <param name="robot_description"
            command="$(find xacro)/ --inorder '$(find p3dx_description)/urdf/pioneer3dx.xacro'" />

        <!-- Run a python script to the send a service call to gazebo_ros to spawn 
            a URDF robot -->
        <node name="urdf_spawner" pkg="gazebo_ros" type="spawn_model"
            respawn="false" output="screen" args="-urdf -param robot_description -model p3dx" />

        <rosparam command="load" file="$(find p3dx_control)/config/control.yaml" />

        <node name="base_controller_spawner" pkg="controller_manager" type="spawner"
            --shutdown-timeout 3"

        <!-- ros_control p3rd launch file -->
        <!-- <include file="$(find p3dx_control)/launch/control.launch" /> -->


p3dx_control/config/control.yaml (create a new file to configure the controller)

  type: "joint_state_controller/JointStateController"
  publish_rate: 50

  type: "diff_drive_controller/DiffDriveController"
  left_wheel: 'base_right_wheel_joint'
  right_wheel: 'base_left_wheel_joint'
  publish_rate: 50
  pose_covariance_diagonal: [0.001, 0.001, 0.001, 0.001, 0.001, 0.03]
  twist_covariance_diagonal: [0.001, 0.001, 0.001 ...
edit flag offensive delete link more


Thank you very much for your effort. It worked for me. great job marcoarruda

manuelmelvin gravatar imagemanuelmelvin ( 2018-07-14 08:05:19 -0500 )edit

Great to know it helped you! Do you mind to check my answer as correct? Thanks!

marcoarruda gravatar imagemarcoarruda ( 2018-07-20 13:19:04 -0500 )edit

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools


Asked: 2018-07-09 17:27:19 -0500

Seen: 220 times

Last updated: Jul 15 '18