Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
C
Caral_forfar
Project overview
Project overview
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
김하경
Caral_forfar
Commits
ea1d1489
Commit
ea1d1489
authored
Mar 10, 2021
by
김하경
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[#1]Success/전후진 미세하게 조정
parent
2fd472a5
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
17 additions
and
6 deletions
+17
-6
test.py
test.py
+17
-6
No files found.
test.py
View file @
ea1d1489
...
...
@@ -13,34 +13,45 @@ pub_msg = CarlaEgoVehicleControl()
def
talker
():
rate
=
rospy
.
Rate
(
1
)
sub
=
rospy
.
Subscriber
(
'/carla/ego_vehicle/collision'
,
CarlaCollisionEvent
,
verify
,
queue_size
=
10
)
while
not
rospy
.
is_shutdown
():
ride
()
rate
.
sleep
()
def
ride
():
rate
=
rospy
.
Rate
(
4
)
print
(
"riding"
)
pub_msg
.
reverse
=
False
pub_msg
.
throttle
=
1.0
pub_msg
.
steer
=
0.0
pub_msg
.
gear
=
1
pub
.
publish
(
pub_msg
)
rate
.
sleep
()
def
littleride
():
rate
=
rospy
.
Rate
(
4
)
print
(
"little riding"
)
pub_msg
.
reverse
=
False
pub_msg
.
throttle
=
1.0
pub_msg
.
steer
=
0.3
pub_msg
.
gear
=
1
pub
.
publish
(
pub_msg
)
def
verify
(
msg
):
print
(
"collide"
)
back
()
def
back
():
rate
=
rospy
.
Rate
(
1
0
)
rate
=
rospy
.
Rate
(
2
0
)
pub_msg
=
CarlaEgoVehicleControl
()
print
(
"execute go back"
)
#pub_msg.brake = 1.0
pub_msg
.
reverse
=
True
pub_msg
.
throttle
=
1
.0
pub_msg
.
steer
=
-
0.6
pub_msg
.
throttle
=
3
.0
pub_msg
.
steer
=
-
0.2
pub_msg
.
gear
=
-
1
pub
.
publish
(
pub_msg
)
rate
.
sleep
()
littleride
()
if
__name__
==
'__main__'
:
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment