Main Page
Namespaces
Classes
Files
File List
File Members
scripts
test_publisher_twist.py
Go to the documentation of this file.
1
#!/usr/bin/env python
2
#
3
# Copyright 2017 Fraunhofer Institute for Manufacturing Engineering and Automation (IPA)
4
#
5
# Licensed under the Apache License, Version 2.0 (the "License");
6
# you may not use this file except in compliance with the License.
7
# You may obtain a copy of the License at
8
#
9
# http://www.apache.org/licenses/LICENSE-2.0
10
#
11
# Unless required by applicable law or agreed to in writing, software
12
# distributed under the License is distributed on an "AS IS" BASIS,
13
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
# See the License for the specific language governing permissions and
15
# limitations under the License.
16
17
18
import
rospy
19
import
math
20
from
geometry_msgs.msg
import
Twist
21
22
def
twistPub
():
23
rospy.init_node(
"test_publisher_twist"
, anonymous=
True
)
24
25
pub = rospy.Publisher(
"twist_controller/command_twist"
, Twist, queue_size=1)
26
twist_msg = Twist()
27
28
twist_msg.linear.x = 0
29
twist_msg.linear.y = -0.05
30
twist_msg.linear.z = 0
31
twist_msg.angular.x = 0
32
twist_msg.angular.y = 0
33
twist_msg.angular.z = 0
34
35
r = rospy.Rate(50)
36
37
while
not
rospy.is_shutdown():
38
pub.publish(twist_msg)
39
r.sleep()
40
41
if
__name__ ==
'__main__'
:
42
try
:
43
twistPub
()
44
except
rospy.ROSInterruptException:
pass
test_publisher_twist.twistPub
def twistPub()
Definition:
test_publisher_twist.py:22
cob_twist_controller
Author(s): Felix Messmer
, Marco Bezzon
, Christoph Mark
, Francisco Moreno
autogenerated on Thu Apr 8 2021 02:40:01