add encoding=utf-8

This commit is contained in:
wangWking 2022-04-21 18:03:24 +08:00
parent 6684ad6844
commit e434301c17
9 changed files with 8 additions and 6 deletions

View file

@ -1,4 +1,5 @@
#!/usr/bin/env python #!/usr/bin/env python
# -*- coding:utf-8 -*-
import rospy import rospy
import cv2 as cv import cv2 as cv
import numpy as np import numpy as np

View file

@ -1,5 +1,5 @@
#!/usr/bin/env python2 #!/usr/bin/env python2
# coding:utf-8 # -*- coding:utf-8 -*-
import rospy import rospy
from visualization_msgs.msg import Marker from visualization_msgs.msg import Marker
import time import time

View file

@ -1,4 +1,5 @@
#!/usr/bin/env python2 #!/usr/bin/env python2
# -*- coding:utf-8 -*-
import time import time
import rospy import rospy
@ -70,7 +71,6 @@ def talker():
pub.publish(joint_state_send) pub.publish(joint_state_send)
coords = mycobot.get_coords() coords = mycobot.get_coords()
# marker # marker
marker_.header.stamp = rospy.Time.now() marker_.header.stamp = rospy.Time.now()
marker_.type = marker_.SPHERE marker_.type = marker_.SPHERE
@ -80,7 +80,6 @@ def talker():
marker_.scale.z = 0.04 marker_.scale.z = 0.04
# marker position initial # marker position initial
# print(coords)
if not coords: if not coords:
coords = [0, 0, 0, 0, 0, 0] coords = [0, 0, 0, 0, 0, 0]
rospy.loginfo("error [101]: can not get coord values") rospy.loginfo("error [101]: can not get coord values")
@ -92,10 +91,8 @@ def talker():
marker_.color.a = 1.0 marker_.color.a = 1.0
marker_.color.g = 1.0 marker_.color.g = 1.0
pub_marker.publish(marker_) pub_marker.publish(marker_)
rate.sleep() rate.sleep()
if __name__ == "__main__": if __name__ == "__main__":
try: try:
talker() talker()

View file

@ -1,4 +1,5 @@
#!/usr/bin/env python2 #!/usr/bin/env python2
# -*- coding:utf-8 -*-
import time import time
import rospy import rospy

View file

@ -1,4 +1,5 @@
#!/usr/bin/env python2 #!/usr/bin/env python2
# -*- coding:utf-8 -*-
# license removed for brevity # license removed for brevity
import time import time
import math import math

View file

@ -1,4 +1,5 @@
#!/usr/bin/env python2 #!/usr/bin/env python2
# -*- coding:utf-8 -*-
import math import math
import rospy import rospy

View file

2
mycobot_320/mycobot_320/scripts/mycobot_320_slider.py Normal file → Executable file
View file

@ -1,5 +1,5 @@
#!/usr/bin/env python2 #!/usr/bin/env python2
# -*- coding:utf-8 -*-
"""[summary] """[summary]
This file obtains the joint angle of the manipulator in ROS, This file obtains the joint angle of the manipulator in ROS,
and then sends it directly to the real manipulator using `pymycobot` API. and then sends it directly to the real manipulator using `pymycobot` API.

View file

@ -1,4 +1,5 @@
#!/usr/bin/env python #!/usr/bin/env python
# -*- coding:utf-8 -*-
from __future__ import print_function from __future__ import print_function
from mycobot_communication.srv import GetCoords, SetCoords, GetAngles, SetAngles, GripperStatus from mycobot_communication.srv import GetCoords, SetCoords, GetAngles, SetAngles, GripperStatus
import rospy import rospy