RobotnikAutomation / summit_xl_sim

Packages for the simulation of the Summit XL, Summit XL HL and Summit-X (including X-WAM) robots
BSD 2-Clause "Simplified" License
66 stars 39 forks source link

Output odom response does not match the step input #29

Open Eswar1991 opened 4 years ago

Eswar1991 commented 4 years ago

We are trying to move the SUMMIT XL in a straight line in gazebo. The differential drive plugin for wheel joints is enabled and we gave a step input velocity to robot and observed the output response from \odom topic. There are sudden dips/ falls in the output responses for a small period of time. The output response and step input are shown below: image Ideally, both the input and outputs must match, as we do the robot motion in a ideal simulation environment. Can anyone clarify why this discrepancy pops up?

sakthivelj commented 4 years ago

Yes, I am also facing this problem. Why the published velocity drops some time ?? below is my code

#!/usr/bin/env python
import rospy  
from geometry_msgs.msg import Twist, Point, Quaternion
from std_msgs.msg import Empty
from nav_msgs.msg import Odometry
from sensor_msgs.msg import JointState
import numpy as np
import tf
from math import radians, copysign, sqrt, pow, pi, atan2
from tf.transformations import euler_from_quaternion
import numpy as np
import math
import time

def move():

  cmd_pub=rospy.Publisher('/robot/robotnik_base_control/cmd_vel', Twist, queue_size=5)
  twist=Twist()

  #Receiving the user's input
  print("Lets move your summitxl\n")
  speed = input("Input your speed:")
  time=input("Input your duration of run:")

  r = rospy.Rate(10000)
  t0=rospy.get_time()
  t1=t0
  stline=True
  while (stline):
    if t1<t0+time:
        twist.linear.x=speed
        twist.linear.y=0
        twist.angular.z=0
    else:
        twist.linear.x=0
        twist.linear.y=0
        twist.angular.z=0
        stline = False
    t1=rospy.get_time()
    cmd_pub.publish(twist)
    r.sleep()

if __name__=='__main__':
  rospy.init_node('Robot_moving', anonymous=True)  
  try:
    move()
  except rospy.ROSInterruptException: pass
jgomezgadea commented 4 years ago

That error can be fixed using the ros_planar_move_plugin, enabled by default. That option disables the Gazebo physics and the movement of the robot is exactly the one set on the cmd_vel.

Eswar1991 commented 4 years ago

That error can be fixed using the ros_planar_move_plugin, enabled by default. That option disables the Gazebo physics and the movement of the robot is exactly the one set on the cmd_vel.

We tried with ros planar plugin as well, still it doesn't work.. Please clarify on this.

jgomezgadea commented 4 years ago

If you use the "ros_planar_move_plugin:=true" argument, the velocity on the cmd_vel is exactly the same velocity on the odometry, ignoring all physics.

Screenshot from 2020-06-29 10-28-22

Could you download the simulation again and check if you are still having this problem?