Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
M
mqtt_bridge
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD 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
mobile_robotics
GAUSS_project
mqtt_bridge
Commits
7a7d0641
Commit
7a7d0641
authored
7 years ago
by
Tomas Cernik
Browse files
Options
Downloads
Patches
Plain Diff
bridge fixed not to fall when ros msg cannot be created
parent
5bc2e87a
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/mqtt_bridge/bridge.py
+6
-3
6 additions, 3 deletions
src/mqtt_bridge/bridge.py
with
6 additions
and
3 deletions
src/mqtt_bridge/bridge.py
+
6
−
3
View file @
7a7d0641
...
@@ -112,9 +112,12 @@ class MqttToRosBridge(Bridge):
...
@@ -112,9 +112,12 @@ class MqttToRosBridge(Bridge):
now
=
rospy
.
get_time
()
now
=
rospy
.
get_time
()
if
self
.
_interval
is
None
or
now
-
self
.
_last_published
>=
self
.
_interval
:
if
self
.
_interval
is
None
or
now
-
self
.
_last_published
>=
self
.
_interval
:
ros_msg
=
self
.
_create_ros_message
(
mqtt_msg
)
try
:
self
.
_publisher
.
publish
(
ros_msg
)
ros_msg
=
self
.
_create_ros_message
(
mqtt_msg
)
self
.
_last_published
=
now
self
.
_publisher
.
publish
(
ros_msg
)
self
.
_last_published
=
now
except
Exception
as
e
:
rospy
.
logerr
(
e
)
def
_create_ros_message
(
self
,
mqtt_msg
):
def
_create_ros_message
(
self
,
mqtt_msg
):
u
"""
create ROS message from MQTT payload
u
"""
create ROS message from MQTT payload
...
...
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