VScode配置ROS python编程环境
VScode官网:https://code.visualstudio.com/
必装插件:
Chinese (Simplified) Language Pack for Visual Studio Code
这里强调一下,不要用新版,新版的没成功。
测试程序talker.py
#!/usr/bin/env python
import rospy
from std_msgs.msg import String
def talker():
pub = rospy.Publisher('chatter', String, queue_size=10)
rospy.init_node('talker', anonymous=True)
rate = rospy.Rate(10) # 10hz
while not rospy.is_shutdown():
hello_str = "hello world %s" % rospy.get_time()
rospy.loginfo(hello_str)
pub.publish(hello_