Main Page
Namespaces
Classes
Files
File List
File Members
scripts
forward.py
Go to the documentation of this file.
1
#!/usr/bin/env python
2
# coding=utf-8
3
######################################################################################
4
#> File Name: auto_rotate.py
5
#> Author:Rocwang
6
#> Mail: wangpeng@droid.ac.cn;
7
#> Github:https://github.com/yowlings
8
#> Created Time: 2018年06月14日 星期四 16时14分27秒
9
######################################################################################
10
11
import
rospy, sys, termios, tty
12
import
time
13
from
geometry_msgs.msg
import
Twist
14
15
16
class
multi_keybroad_handle
():
17
def
__init__
(self):
18
self.
pub
= rospy.Publisher(
'/cmd_vel_mux/input/teleop'
, Twist, queue_size = 1)
19
self.
old_settings
= termios.tcgetattr(sys.stdin)
20
r=rospy.Rate(20)
21
try
:
22
while
not
rospy.is_shutdown():
23
self.
cmd
= Twist()
24
self.cmd.linear.x = 0.5
25
# self.cmd.angular.z = 3.1415926*30/180
26
self.pub.publish(self.
cmd
)
27
r.sleep()
28
29
except
:
30
print
'error'
31
finally
:
32
self.pub.publish(self.
cmd
)
33
34
35
36
37
38
if
__name__==
'__main__'
:
39
rospy.init_node(
'xbot_auto_control'
)
40
try
:
41
rospy.loginfo(
"initialization system"
)
42
multi_keybroad_handle
()
43
print
"process done and quit"
44
except
rospy.ROSInterruptException:
45
rospy.loginfo(
"node terminated."
)
46
kkk
47
forward.multi_keybroad_handle.__init__
def __init__(self)
Definition:
forward.py:17
forward.multi_keybroad_handle.pub
pub
Definition:
forward.py:18
forward.multi_keybroad_handle.cmd
cmd
Definition:
forward.py:23
forward.multi_keybroad_handle
Definition:
forward.py:16
forward.multi_keybroad_handle.old_settings
old_settings
Definition:
forward.py:19
xbot_tools
Author(s):
autogenerated on Sat Oct 10 2020 03:28:22