Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Output odom response does not match the step input #29

Open
Eswar1991 opened this issue Jun 10, 2020 · 4 comments
Open

Output odom response does not match the step input #29

Eswar1991 opened this issue Jun 10, 2020 · 4 comments

Comments

@Eswar1991
Copy link

Eswar1991 commented Jun 10, 2020

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
Copy link

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
Copy link
Contributor

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
Copy link
Author

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
Copy link
Contributor

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?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants