📔
Jetson Tx2
  • Jetson Tx2
  • 1장 일반 개요
  • 2장 예제
  • 3장 동작모드
  • 4장 확인
  • DataStream SDK 활용
  • YOLO
  • Tensorflow 설치 및 확인
  • openCV 설치 및 확인
  • AutoCar
  • How to write ROS py
  • 참고자료
  • SSD하드디스크 추가하기
Powered by GitBook
On this page

Was this helpful?

How to write ROS py

$ wget https://raw.github.com/ros/ros_tutorials/kinetic-devel/rospy_tutorials/001_talker_listener/talker.py
$ chmod +x talker.py

$ rosed beginner_tutorials talker.py

#!/usr/bin/env python
# license removed for brevity
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_str)
       rate.sleep()
   
if __name__ == '__main__':
    try:
       talker()
    except rospy.ROSInterruptException:
        pass


from ackermann_msgs.msg import AckermannDriveStamped

pub = rospy.Publisher('/????',AckermannDriveStamped, queue_size=1)
 

ack_msg = AckermannDriveStamped()
ack_msg.header.stamp = rospy.Time.now()
ack_msg.header.frame_id = ''
ack_msg.drive.steering_angle = 0
ack_msg.drive.speed = 1
pub.publish(ack_msg)
PreviousAutoCarNext참고자료

Last updated 5 years ago

Was this helpful?