Skip to content
GitLab
Explore
Projects
Groups
Topics
Snippets
Projects
Groups
Topics
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Register
Sign in
Toggle navigation
Menu
Shuhang Huang
turtlebot3
Commits
33b59cda
Commit
33b59cda
authored
5 years ago
by
Ryan Shim
Browse files
Options
Download
Patches
Plain Diff
cmd_vel_raw name changed
parent
d64a04dd
ros2-devel
dashing-devel
eloquent-devel
feature-burger-camera
feature-camera
feature-humble
feature-nav2-update
feature-raspicam
foxy-devel
galactic-devel
galactic-devel-hotfix
hotfix-humble
hotfix-humble-example
humble-devel
ros2
2.1.5
2.1.3
2.1.2
2.1.1
2.1.0
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
turtlebot3_example/turtlebot3_example/turtlebot3_obstacle_detection/turtlebot3_obstacle_detection.py
+5
-5
...ebot3_obstacle_detection/turtlebot3_obstacle_detection.py
with
5 additions
and
5 deletions
+5
-5
turtlebot3_example/turtlebot3_example/turtlebot3_obstacle_detection/turtlebot3_obstacle_detection.py
+
5
−
5
View file @
33b59cda
...
...
@@ -34,7 +34,7 @@ class Turtlebot3ObstacleDetection(Node):
************************************************************"""
self
.
linear_velocity
=
0.0
# unit: m/s
self
.
angular_velocity
=
0.0
# unit: m/s
self
.
scan_ranges
=
numpy
.
ones
(
360
)
*
numpy
.
Infinity
# Scan resolution is
360
self
.
scan_ranges
=
numpy
.
ones
(
360
)
*
numpy
.
Infinity
# Scan resolution is
1[deg]
"""************************************************************
** Initialise ROS publishers and subscribers
...
...
@@ -50,10 +50,10 @@ class Turtlebot3ObstacleDetection(Node):
'scan'
,
self
.
scan_callback
,
qos_profile
=
qos_profile_sensor_data
)
self
.
raw_
cmd_vel_sub
=
self
.
create_subscription
(
self
.
cmd_vel_
raw_
sub
=
self
.
create_subscription
(
Twist
,
'
raw_
cmd_vel'
,
self
.
cmd_vel_callback
,
'cmd_vel
_raw
'
,
self
.
cmd_vel_
raw_
callback
,
qos
)
"""************************************************************
...
...
@@ -71,7 +71,7 @@ class Turtlebot3ObstacleDetection(Node):
def
scan_callback
(
self
,
msg
):
self
.
scan_ranges
=
msg
.
ranges
def
cmd_vel_callback
(
self
,
msg
):
def
cmd_vel_
raw_
callback
(
self
,
msg
):
self
.
linear_velocity
=
msg
.
linear
.
x
self
.
angular_velocity
=
msg
.
angular
.
z
...
...
This diff is collapsed.
Click to expand it.
Write
Preview
Supports
Markdown
0%
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
Menu
Explore
Projects
Groups
Topics
Snippets