Mentions légales du service
Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
C
catkin_crowdbotsim
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Deploy
Releases
Model registry
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
CrowdBot
catkin_crowdbotsim
Commits
0be932c1
Commit
0be932c1
authored
5 years ago
by
Fabien Grzeskowiak
Browse files
Options
Downloads
Patches
Plain Diff
add clock controller
parent
ac6f1813
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
crowdbotsim/scripts/clock_publisher.py
+41
-0
41 additions, 0 deletions
crowdbotsim/scripts/clock_publisher.py
crowdbotsim/scripts/joy_to_twist.py
+1
-1
1 addition, 1 deletion
crowdbotsim/scripts/joy_to_twist.py
with
42 additions
and
1 deletion
crowdbotsim/scripts/clock_publisher.py
0 → 100755
+
41
−
0
View file @
0be932c1
#!/usr/bin/env python
import
rospy
import
sys
import
math
from
time
import
sleep
from
rosgraph_msgs.msg
import
Clock
myargv
=
rospy
.
myargv
(
argv
=
sys
.
argv
)
script
,
sleep_time
,
delta_time
=
myargv
sleep_time
=
float
(
sleep_time
)
delta_time
=
float
(
delta_time
)
def
publish_clock
():
# initialize node
rospy
.
init_node
(
'
clock_controller
'
,
anonymous
=
False
)
### Set up clock publisher
clock_pub
=
rospy
.
Publisher
(
'
clock
'
,
Clock
,
queue_size
=
1
)
clock_pub2
=
rospy
.
Publisher
(
'
myclock
'
,
Clock
,
queue_size
=
1
)
msg
=
Clock
()
msg
.
clock
=
rospy
.
Time
()
current_time
=
0
while
not
rospy
.
is_shutdown
():
### Publish clock
secs
=
int
(
current_time
)
nsecs
=
1e9
*
(
current_time
-
secs
)
msg
.
clock
=
rospy
.
Time
(
secs
,
nsecs
)
clock_pub
.
publish
(
msg
)
clock_pub2
.
publish
(
msg
)
current_time
+=
delta_time
sleep
(
sleep_time
)
if
__name__
==
'
__main__
'
:
publish_clock
()
This diff is collapsed.
Click to expand it.
crowdbotsim/scripts/joy_to_twist.py
+
1
−
1
View file @
0be932c1
...
...
@@ -12,7 +12,7 @@ rospy.init_node('joy_to_twist', anonymous = True)
#### Setup joy_to_twist Publisher
joy_to_twist_pub
=
rospy
.
Publisher
(
topic
,
Twist
,
queue_size
=
5
)
joy_to_twist_pub
=
rospy
.
Publisher
(
topic
,
Twist
,
queue_size
=
1
)
msg
=
Twist
()
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment