Skip to content

Instantly share code, notes, and snippets.

View syanyong's full-sized avatar
🏠
Working from home

Sarucha Yanyong syanyong

🏠
Working from home
View GitHub Profile
testing_data = [[26, 2.89], [22, 2.76], [18, 2.79], [22, 3.57], [26, 2.83], [11, 3.46], [12, 3.69], [28, 3.49], [20, 3.41], [5, 2.85], [17, 3.31], [16, 3.86], [14, 2.72], [7, 3.0], [17, 3.67], [8, 2.96], [14, 3.9], [10, 3.24], [9, 3.29], [6, 3.29], [22, 2.82], [20, 3.93], [29, 3.14], [9, 2.78], [17, 2.68], [26, 3.96], [16, 2.63], [20, 3.45], [23, 3.2], [29, 2.58], [18, 2.83], [13, 3.6], [21, 3.79], [26, 3.81], [26, 3.44], [10, 3.1], [18, 2.64], [8, 3.37], [9, 2.58], [6, 3.15], [9, 3.2], [10, 2.93], [17, 3.58], [28, 2.83], [21, 2.89], [8, 2.88], [12, 3.39], [12, 3.76], [26, 3.37], [25, 2.86], [9, 3.94], [21, 3.71], [19, 2.82], [18, 3.7], [6, 2.87], [14, 3.36], [24, 3.79], [5, 3.45], [19, 3.03], [7, 3.67], [11, 2.88], [23, 2.85], [29, 3.74], [6, 3.27], [22, 2.91], [29, 3.68], [16, 3.22], [15, 3.18], [16, 2.67], [19, 3.48], [20, 3.28], [14, 2.7], [24, 3.87], [20, 3.89], [5, 2.57], [22, 2.84], [13, 3.77], [13, 2.76], [20, 3.08], [29, 2.62], [5, 2.58], [6, 3.41], [6, 2.9], [8, 3.15], [19, 3.67], [12, 3.25], [7, 2.
react: BROWSER=none npm start
electron: node src/electron-wait-react
@syanyong
syanyong / Change permission of pub.py
Last active August 1, 2020 07:45
ROS Training Day 2 (Starter script of publisher)
chmod +x catkin_ws/src/my_turtlesim/script/pub.py
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import rospy # เรียก external library ชื่อ rospy
from geometry_msgs.msg import Twist # เรีียก lib Twist จาก package geometry_msgs.msg
import time # เรียก lib ชื่อ time
vel = Twist() # สร้าง object ชื่อ vel จาก Class Twist
# def คือการประกาศฟัังก์ชั่นใน Python
def main ():
@syanyong
syanyong / pub.py
Last active December 27, 2020 15:03
Non-Degree Day2 Group 2B for practice
#!/usr/bin/env python
"""
รันด้วยคำสั่ง rosrun my_turtlesim pub.py
"""
import rospy
from geometry_msgs.msg import Twist
import time
vel = Twist() # Variable Twist
@syanyong
syanyong / pub.py
Last active January 30, 2021 08:50
Move as triangle (Not completed)
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import rospy # เรียก Libray จากภายนอก
from geometry_msgs.msg import Twist
import time
vel = Twist() # สร้าง Object สำหรับเปลี่ยนความเร็วหุ่นยนต์
def main (): # ฟังก์ชั่นหลัก
rospy.init_node('turtle_commander', anonymous=True) # Regis Node บน Master
#!/usr/bin/env python
import rospy
def main ():
rospy.init_node('turtle_commander', anonymous=True)
rate = rospy.Rate(10) # 10 Hz
while not rospy.is_shutdown():
# TODO
# END
@syanyong
syanyong / pub.py
Last active January 31, 2021 07:16
Jan 31, 2021 ROS Day 2
#!/usr/bin/env python
import rospy
from geometry_msgs.msg import Twist
import time
# Noted
# Topic: /turtle1/cmd_vel
# Type: geometry_msgs/Twist
def main ():
@syanyong
syanyong / pub.py
Last active March 21, 2021 04:29
Getting start ROS Python pub.py (Created on Feb 21, 2021)
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import rospy # เรียก Libray จากภายนอก
from geometry_msgs.msg import Twist
import time
vel = Twist() # สร้าง Object สำหรับเปลี่ยนความเร็วหุ่นยนต์
def main (): # ฟังก์ชั่นหลัก
rospy.init_node('turtle_commander', anonymous=False) # Regis Node บน Master
@syanyong
syanyong / pub.py
Created March 21, 2021 07:00
Demo code for exercise
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import rospy # เรียก Libray จากภายนอก
from geometry_msgs.msg import Twist
import time
vel = Twist() # สร้าง Object สำหรับเปลี่ยนความเร็วหุ่นยนต์
def main (): # ฟังก์ชั่นหลัก
rospy.init_node('turtle_commander', anonymous=False) # Regis Node บน Master