Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
L
LaVizu
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Packages & Registries
Packages & Registries
Container Registry
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
behaviors-ai-public
LaVizu
Commits
60059b71
Commit
60059b71
authored
Aug 19, 2019
by
Dorian Goepp
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix a tiny bug in Video Stream
parent
2280357f
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
9 deletions
+8
-9
src/VideoStream/index.js
src/VideoStream/index.js
+8
-9
No files found.
src/VideoStream/index.js
View file @
60059b71
...
...
@@ -42,13 +42,13 @@ class VideoStream extends Component {
this
.
store
=
new
VideoStore
();
// Automatically detect if the configured topic name is valid
this
.
hasTopic
=
observable
.
box
(
false
);
this
.
searchForTopic
()
// Fill the undefined fields of the configuration object with their default values.
defaultConfig
(
this
.
store
);
this
.
props
.
store
.
components
[
'
video
'
]
=
this
.
store
;
// Automatically detect if the configured topic name is valid
this
.
hasTopic
=
observable
.
box
(
false
);
this
.
searchForTopic
();
}
defaultImage
=
'
images/default.svg
'
;
...
...
@@ -62,7 +62,7 @@ class VideoStream extends Component {
get
streamUrl
()
{
if
(
'
url
'
in
this
.
props
&&
this
.
props
.
url
)
{
return
this
.
props
.
url
;
}
else
if
(
this
.
hasTopic
.
get
())
{
}
else
if
(
this
.
hasTopic
.
get
())
{
// all requierd configuration fields are defined
return
'
http://
'
+
this
.
store
.
config
.
host
+
'
/stream?topic=
'
+
this
.
store
.
config
.
topic
;
...
...
@@ -74,7 +74,7 @@ class VideoStream extends Component {
/**
* Check that all the requirements are met for subscribing to the required
* topic
*
*
* Thanks to MobX magic, the result is computed again each time the topic
* configuration is changed.
*/
...
...
@@ -88,19 +88,18 @@ class VideoStream extends Component {
this
.
props
.
ros
.
getTopics
(
infos
=>
{
this
.
hasTopic
.
set
(
undefined
!==
infos
.
topics
.
find
(
elem
=>
elem
===
this
.
store
.
config
.
topic
));
if
(
!
this
.
hasTopic
.
get
())
{
console
.
warn
(
"
[VideoStream] The required topic
"
+
this
.
store
.
config
.
topic
+
"
is not published
"
);
}
console
.
debug
(
this
.
hasTopic
.
get
());
})
}
else
{
console
.
warn
(
"
[VideoStream] either no topic is configured
"
+
"
or no host is configured. This should never
"
+
"
happen at runtime. Contact the developpers.
"
);
}
})
}
,
{
fireImmediately
:
true
}
)
}
else
{
console
.
warn
(
"
[VideoStream] ROS property is provided. This should
"
+
"
never happen at runtime. Contact the developpers.
"
);
...
...
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