Robotics StackExchange | Archived questions

how to make velocity of turtlebot is smoother??

I installed this library: sudo apt install ros-indigo-yocs-velocity-smoother and I am following here link text , those topics that I use for velocity:

self.cmd_pub = rospy.Publisher("/mobile_base/commands/velocity", Twist, queue_size=10)
self.cmd_pub = rospy.Publisher('/cmd_vel_mux/input/navi',Twist, queue_size=1)
self.cmd_pub = rospy.Publisher('/cmd_vel_mux/input/safety_controller',Twist, queue_size=1)
self.cmd_pub = rospy.Publisher('/cmd_vel_mux/input/teleop',Twist, queue_size=1)

Note: I just use one of them in my codes, not together.

I am working in people detection, but the robot sometimes loses the target, thus it stops suddenly. I need that the robot stops smoothly

how to use this library correctly???

I tried using this topic but it not move, I think that something is wrong.

 self.cmd_pub = rospy.Publisher('/smooth_cmd_vel',Twist, queue_size=1)

Please help me or any suggestion

Thank you in advance

Asked by Redhwan on 2019-03-20 02:45:24 UTC

Comments

Why are you using the same variable name for all the publishers?

Asked by vik748 on 2019-03-20 06:19:11 UTC

I don't use them together, sorry about this, I just use one of them, the robot move

I edited my question

Asked by Redhwan on 2019-03-20 07:17:21 UTC

Answers

Here is how I was launching velocity smoother from my minimal.launch for the Teleop velocity smoother:

  <include file="$(find yocs_velocity_smoother)/launch/velocity_smoother.launch">
    <arg name="node_name"             value="teleop_velocity_smoother"/>
    <arg name="nodelet_manager_name"  value="mobile_base_nodelet_manager"/>
    <arg name="config_file"           value="$(find yocs_velocity_smoother)/param/standalone.yaml"/>
    <arg name="raw_cmd_vel_topic"     value="velocity_smoother/raw_cmd_vel_teleop"/>
    <arg name="smooth_cmd_vel_topic"  value="cmd_vel_mux/input/teleop"/>
    <arg name="robot_cmd_vel_topic"   value="robot_cmd_vel"/>
    <arg name="odom_topic"            value="odom"/>
  </include>

Similarly here is an example for nav_velocity_smoother:

<include file="$(find yocs_velocity_smoother)/launch/velocity_smoother.launch">
    <arg name="node_name"             value="nav_velocity_smoother"/>
    <arg name="nodelet_manager_name"  value="mobile_base_nodelet_manager"/>
    <arg name="config_file"           value="$(find yocs_velocity_smoother)/param/standalone.yaml"/>
    <arg name="raw_cmd_vel_topic"     value="velocity_smoother/raw_cmd_vel_nav"/>
    <arg name="smooth_cmd_vel_topic"  value="cmd_vel_mux/input/nav"/>
    <arg name="robot_cmd_vel_topic"   value="robot_cmd_vel"/>
    <arg name="odom_topic"            value="odom"/>
  </include>

Asked by vik748 on 2019-03-20 08:34:48 UTC

Comments

first of all, thank you so much

I will use them

Asked by Redhwan on 2019-03-20 08:44:43 UTC