Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
cs129-21sp
cs129-class-shared
Commits
d20d26b9
Commit
d20d26b9
authored
4 years ago
by
nardavin
Browse files
Options
Download
Email Patches
Plain Diff
Fixed line endings... Whoops!
parent
6e430d59
master
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
shared_demo/launch/test_ros.launch
+2
-2
shared_demo/launch/test_ros.launch
shared_demo/scripts/test_ros.py
+23
-23
shared_demo/scripts/test_ros.py
with
25 additions
and
25 deletions
+25
-25
shared_demo/launch/test_ros.launch
View file @
d20d26b9
<launch>
<node name="test_node" pkg="shared_demo" type="test_ros.py" output="screen" />
<launch>
<node name="test_node" pkg="shared_demo" type="test_ros.py" output="screen" />
</launch>
\ No newline at end of file
This diff is collapsed.
Click to expand it.
shared_demo/scripts/test_ros.py
View file @
d20d26b9
#!/usr/bin/env python
import
rospy
from
std_msgs.msg
import
Time
pub
=
None
def
pub_time
(
timer
):
msg
=
rospy
.
get_rostime
()
pub
.
publish
(
msg
)
if
__name__
==
"__main__"
:
# Intialize node
rospy
.
init_node
(
'test_ros'
)
# Create publisher and set up for timer
pub
=
rospy
.
Publisher
(
'/current_time'
,
Time
,
queue_size
=
10
)
rospy
.
Timer
(
rospy
.
Duration
(
1
),
pub_time
)
rospy
.
loginfo
(
'I can talk to roscore!'
)
rospy
.
loginfo
(
'Publishing current time to /current_time'
)
# Infinite loop to execute all ros operations
# in this case, it just handles the timer
#!/usr/bin/env python
import
rospy
from
std_msgs.msg
import
Time
pub
=
None
def
pub_time
(
timer
):
msg
=
rospy
.
get_rostime
()
pub
.
publish
(
msg
)
if
__name__
==
"__main__"
:
# Intialize node
rospy
.
init_node
(
'test_ros'
)
# Create publisher and set up for timer
pub
=
rospy
.
Publisher
(
'/current_time'
,
Time
,
queue_size
=
10
)
rospy
.
Timer
(
rospy
.
Duration
(
1
),
pub_time
)
rospy
.
loginfo
(
'I can talk to roscore!'
)
rospy
.
loginfo
(
'Publishing current time to /current_time'
)
# Infinite loop to execute all ros operations
# in this case, it just handles the timer
rospy
.
spin
()
\ No newline at end of file
This diff is collapsed.
Click to expand it.
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
Menu
Projects
Groups
Snippets
Help