Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
E
ExDBackend
Manage
Activity
Members
Labels
Plan
Issues
0
Issue boards
Milestones
Wiki
Code
Merge requests
0
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Neurorobotics Platform
ExDBackend
Commits
d5ea5d5d
Commit
d5ea5d5d
authored
3 years ago
by
Ugo Albanese
Browse files
Options
Downloads
Patches
Plain Diff
[NRRPLT-0000][HOTFIX] Fix error message on model.config validation error.
parent
b19366f2
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
hbp_nrp_cleserver/hbp_nrp_cleserver/server/_RobotCallHandler.py
+8
-4
8 additions, 4 deletions
...p_cleserver/hbp_nrp_cleserver/server/_RobotCallHandler.py
with
8 additions
and
4 deletions
hbp_nrp_cleserver/hbp_nrp_cleserver/server/_RobotCallHandler.py
+
8
−
4
View file @
d5ea5d5d
...
@@ -258,6 +258,7 @@ class RobotCallHandler(object):
...
@@ -258,6 +258,7 @@ class RobotCallHandler(object):
:return: Tuple (True, extracted SDF absolute path) or (False, error message)
:return: Tuple (True, extracted SDF absolute path) or (False, error message)
"""
"""
try
:
try
:
robot
=
Model
(
robot_model
,
ResourceType
.
ROBOT
)
robot
=
Model
(
robot_model
,
ResourceType
.
ROBOT
)
data
=
self
.
_client
.
get_model
(
data
=
self
.
_client
.
get_model
(
self
.
_cle_assembly
.
sim_config
.
token
,
self
.
_cle_assembly
.
sim_config
.
token
,
...
@@ -286,7 +287,6 @@ class RobotCallHandler(object):
...
@@ -286,7 +287,6 @@ class RobotCallHandler(object):
return
False
,
"'
model.config
'
has no
'
sdf
'
tag
"
return
False
,
"'
model.config
'
has no
'
sdf
'
tag
"
sdf_filename
=
os
.
path
.
basename
(
sdf_abs_path
)
sdf_filename
=
os
.
path
.
basename
(
sdf_abs_path
)
if
not
os
.
path
.
isfile
(
sdf_abs_path
):
if
not
os
.
path
.
isfile
(
sdf_abs_path
):
return
False
,
"
No SDF named {name} found at {loc} specified
"
\
return
False
,
"
No SDF named {name} found at {loc} specified
"
\
"
in model.config in the uploaded zip
"
\
"
in model.config in the uploaded zip
"
\
...
@@ -309,16 +309,20 @@ class RobotCallHandler(object):
...
@@ -309,16 +309,20 @@ class RobotCallHandler(object):
# pylint: disable=no-self-use
# pylint: disable=no-self-use
# Get robot sdf name from model.config
# Get robot sdf name from model.config
with
open
(
model_config_abs_path
)
as
conf
:
with
open
(
model_config_abs_path
)
as
conf
:
model_config_abs_path_dir
=
os
.
path
.
dirname
(
model_config_abs_path
)
try
:
try
:
confDOM
=
robotXmlParser
.
CreateFromDocument
(
conf
.
read
())
confDOM
=
robotXmlParser
.
CreateFromDocument
(
conf
.
read
())
except
ValidationError
as
ve
:
except
ValidationError
as
ve
:
raise
Exception
(
"
Could not parse experiment configuration {0:s} due
"
raise
Exception
(
"
Could not parse {model_name:s} .config file due
"
"
to validation error: {1:s}
"
.
format
(
conf
,
str
(
ve
)))
"
to validation error: {error:s}
"
.
format
(
error
=
str
(
ve
),
model_name
=
os
.
path
.
basename
(
model_config_abs_path_dir
)))
if
confDOM
.
sdf
is
None
:
if
confDOM
.
sdf
is
None
:
return
None
return
None
return
os
.
path
.
join
(
os
.
path
.
dirname
(
model_config_abs_path
)
,
confDOM
.
sdf
.
value
())
return
os
.
path
.
join
(
model_config_abs_path
_dir
,
confDOM
.
sdf
.
value
())
def
_customize_sdf
(
self
,
sdf_abs_path
,
robot_id
):
# pragma: no cover
def
_customize_sdf
(
self
,
sdf_abs_path
,
robot_id
):
# pragma: no cover
"""
"""
...
...
This diff is collapsed.
Click to expand it.
Preview
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