Open Eswar1991 opened 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
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.
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.
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.
Could you download the simulation again and check if you are still having this problem?
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:
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?