When I am trying to paste my code from clipboard into vi editor, random symbols are getting generated as shown in the callback function below:
PS: I used Ctrl+V to paste
import rospy
from nav_msgs.msg import Odometry
def callback(msg):
print (�~@~\x_coord: �~@~]+str(msg.pose.pose.position.x))
print (�~@~\y_coord: �~@~]+str(msg.pose.pose.position.y))
Print (�~@~\z_coord: �~@~]+str(msg.pose.pose.position.z))
rospy.init_node(‘odom_subscriber’)
sub = rospy.Subscriber(’/odom’, Odometry, callback)
rospy.spin()
Please help me fix this so that I can paste my code without having to edit it after pasting.