Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
O
opendrive_to_gazebo
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
ADC
libraries
opendrive_to_gazebo
Commits
f558c31f
Commit
f558c31f
authored
3 years ago
by
Sergi Hernandez
Browse files
Options
Downloads
Patches
Plain Diff
Added support for the global localization sign.
parent
372518e4
No related branches found
No related tags found
No related merge requests found
Pipeline
#6820
canceled
3 years ago
Stage: build
Stage: deploy
Changes
2
Pipelines
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
include/generate_launch.h
+7
-6
7 additions, 6 deletions
include/generate_launch.h
src/generate_launch.cpp
+19
-12
19 additions, 12 deletions
src/generate_launch.cpp
with
26 additions
and
18 deletions
include/generate_launch.h
+
7
−
6
View file @
f558c31f
...
@@ -58,16 +58,17 @@ void generate_parkings_yaml(std::string &path,std::string &parkings_file,COpendr
...
@@ -58,16 +58,17 @@ void generate_parkings_yaml(std::string &path,std::string &parkings_file,COpendr
#define SEMAPHORE_TYPE "1000001"
#define SEMAPHORE_TYPE "1000001"
#define SEMAPHORE_MARKER "alvar1"
#define SEMAPHORE_MARKER "alvar1"
// #define SEMAPHORE_MARKER "alvar15"
// #define SEMAPHORE_MARKER "alvar15"
#define LOC_SIGN_TRIANGLE_TYPE ""
#define GENERIC_LOC_SIGN_TRIANGLE_TYPE "1000"
#define LOC_SIGN_TRIANGLE_MARKER "alvar2_neg_1"
#define GENERIC_LOC_SIGN_TRIANGLE_MARKER "alvar2_neg_1"
#define GLOBAL_LOC_TYPE "1001"
#define GLOBAL_LOC_MARKER "alvar3_neg_1"
#define LOC_SIGN_TRIANGLE_WIDTH 0.074
#define
GENERIC_
LOC_SIGN_TRIANGLE_WIDTH 0.074
#define LOC_SIGN_TRIANGLE_ANGLE M_PI/2
#define
GENERIC_
LOC_SIGN_TRIANGLE_ANGLE M_PI/2
#define LOC_SIGN_ID_OFFSET 100
#define
GENERIC_
LOC_SIGN_ID_OFFSET 100
#define PARKED_CAR_LENGTH "0.6"
#define PARKED_CAR_LENGTH "0.6"
#define PARKED_CAR_WIDTH "0.25"
#define PARKED_CAR_WIDTH "0.25"
#define PARKED_CAR_HEIGHT "0.15"
#define PARKED_CAR_HEIGHT "0.15"
#endif
#endif
This diff is collapsed.
Click to expand it.
src/generate_launch.cpp
+
19
−
12
View file @
f558c31f
...
@@ -107,10 +107,15 @@ void get_signal_type_info(std::string &type,std::string &subtype,int value,std::
...
@@ -107,10 +107,15 @@ void get_signal_type_info(std::string &type,std::string &subtype,int value,std::
name
=
"semaphore"
;
name
=
"semaphore"
;
marker
=
SEMAPHORE_MARKER
;
marker
=
SEMAPHORE_MARKER
;
}
}
else
if
(
type
==
LOC_SIGN_TRIANGLE_TYPE
)
else
if
(
type
==
GENERIC_
LOC_SIGN_TRIANGLE_TYPE
)
{
{
name
=
"locsign"
;
name
=
"generic_loc"
;
marker
=
LOC_SIGN_TRIANGLE_MARKER
;
marker
=
GENERIC_LOC_SIGN_TRIANGLE_MARKER
;
}
else
if
(
type
==
GLOBAL_LOC_TYPE
)
{
name
=
"global_loc"
;
marker
=
GLOBAL_LOC_MARKER
;
}
}
else
else
throw
CException
(
_HERE_
,
"Unsupported signal "
+
type
);
throw
CException
(
_HERE_
,
"Unsupported signal "
+
type
);
...
@@ -152,17 +157,17 @@ void generate_signals_launch(std::string &path,std::string &signals_file,COpendr
...
@@ -152,17 +157,17 @@ void generate_signals_launch(std::string &path,std::string &signals_file,COpendr
signal
.
get_type
(
type
,
subtype
);
signal
.
get_type
(
type
,
subtype
);
get_signal_type_info
(
type
,
subtype
,
signal
.
get_value
(),
name
,
marker
);
get_signal_type_info
(
type
,
subtype
,
signal
.
get_value
(),
name
,
marker
);
out_file
<<
std
::
endl
;
out_file
<<
std
::
endl
;
if
(
type
==
LOC_SIGN_TRIANGLE_TYPE
)
if
(
type
==
GENERIC_
LOC_SIGN_TRIANGLE_TYPE
)
{
{
double
loc_x
,
loc_y
,
loc_yaw
,
world_x
,
world_y
,
world_yaw
;
double
loc_x
,
loc_y
,
loc_yaw
,
world_x
,
world_y
,
world_yaw
;
out_file
<<
" <include file=
\"
$(find iri_sign_description)/launch/spawn_localization_sign.launch
\"
>"
<<
std
::
endl
;
out_file
<<
" <include file=
\"
$(find iri_sign_description)/launch/spawn_localization_sign.launch
\"
>"
<<
std
::
endl
;
out_file
<<
" <arg name=
\"
name
\"
value=
\"
"
<<
name
<<
"_"
<<
(
signal
.
get_id
()
%
LOC_SIGN_ID_OFFSET
)
*
2
-
1
<<
"
\"
/>"
<<
std
::
endl
;
out_file
<<
" <arg name=
\"
name
\"
value=
\"
"
<<
name
<<
"_"
<<
(
signal
.
get_id
()
%
GENERIC_
LOC_SIGN_ID_OFFSET
)
*
2
-
1
<<
"
\"
/>"
<<
std
::
endl
;
out_file
<<
" <arg name=
\"
tag
\"
value=
\"
"
<<
marker
<<
"
\"
/>"
<<
std
::
endl
;
out_file
<<
" <arg name=
\"
tag
\"
value=
\"
"
<<
marker
<<
"
\"
/>"
<<
std
::
endl
;
world
=
signal
.
get_world_pose
();
world
=
signal
.
get_world_pose
();
loc_x
=
-
LOC_SIGN_TRIANGLE_WIDTH
*
std
::
sin
(
LOC_SIGN_TRIANGLE_ANGLE
/
2
)
/
2
;
loc_x
=
-
GENERIC_
LOC_SIGN_TRIANGLE_WIDTH
*
std
::
sin
(
GENERIC_
LOC_SIGN_TRIANGLE_ANGLE
/
2
)
/
2
;
loc_y
=
-
LOC_SIGN_TRIANGLE_WIDTH
*
std
::
cos
(
LOC_SIGN_TRIANGLE_ANGLE
/
2
)
/
2
;
loc_y
=
-
GENERIC_
LOC_SIGN_TRIANGLE_WIDTH
*
std
::
cos
(
GENERIC_
LOC_SIGN_TRIANGLE_ANGLE
/
2
)
/
2
;
loc_yaw
=
M_PI
+
LOC_SIGN_TRIANGLE_ANGLE
/
2
;
loc_yaw
=
M_PI
+
GENERIC_
LOC_SIGN_TRIANGLE_ANGLE
/
2
;
world_x
=
world
.
x
+
loc_x
*
std
::
cos
(
world
.
heading
)
-
loc_y
*
std
::
sin
(
world
.
heading
);
world_x
=
world
.
x
+
loc_x
*
std
::
cos
(
world
.
heading
)
-
loc_y
*
std
::
sin
(
world
.
heading
);
world_y
=
world
.
y
+
loc_x
*
std
::
sin
(
world
.
heading
)
+
loc_y
*
std
::
cos
(
world
.
heading
);
world_y
=
world
.
y
+
loc_x
*
std
::
sin
(
world
.
heading
)
+
loc_y
*
std
::
cos
(
world
.
heading
);
world_yaw
=
loc_yaw
+
world
.
heading
;
world_yaw
=
loc_yaw
+
world
.
heading
;
...
@@ -178,12 +183,12 @@ void generate_signals_launch(std::string &path,std::string &signals_file,COpendr
...
@@ -178,12 +183,12 @@ void generate_signals_launch(std::string &path,std::string &signals_file,COpendr
out_file
<<
" </include>"
<<
std
::
endl
;
out_file
<<
" </include>"
<<
std
::
endl
;
out_file
<<
" <include file=
\"
$(find iri_sign_description)/launch/spawn_localization_sign.launch
\"
>"
<<
std
::
endl
;
out_file
<<
" <include file=
\"
$(find iri_sign_description)/launch/spawn_localization_sign.launch
\"
>"
<<
std
::
endl
;
out_file
<<
" <arg name=
\"
name
\"
value=
\"
"
<<
name
<<
"_"
<<
(
signal
.
get_id
()
%
LOC_SIGN_ID_OFFSET
)
*
2
<<
"
\"
/>"
<<
std
::
endl
;
out_file
<<
" <arg name=
\"
name
\"
value=
\"
"
<<
name
<<
"_"
<<
(
signal
.
get_id
()
%
GENERIC_
LOC_SIGN_ID_OFFSET
)
*
2
<<
"
\"
/>"
<<
std
::
endl
;
out_file
<<
" <arg name=
\"
tag
\"
value=
\"
"
<<
marker
<<
"
\"
/>"
<<
std
::
endl
;
out_file
<<
" <arg name=
\"
tag
\"
value=
\"
"
<<
marker
<<
"
\"
/>"
<<
std
::
endl
;
loc_x
=
LOC_SIGN_TRIANGLE_WIDTH
*
std
::
sin
(
LOC_SIGN_TRIANGLE_ANGLE
/
2
)
/
2
;
loc_x
=
GENERIC_
LOC_SIGN_TRIANGLE_WIDTH
*
std
::
sin
(
GENERIC_
LOC_SIGN_TRIANGLE_ANGLE
/
2
)
/
2
;
loc_y
=
-
LOC_SIGN_TRIANGLE_WIDTH
*
std
::
cos
(
LOC_SIGN_TRIANGLE_ANGLE
/
2
)
/
2
;
loc_y
=
-
GENERIC_
LOC_SIGN_TRIANGLE_WIDTH
*
std
::
cos
(
GENERIC_
LOC_SIGN_TRIANGLE_ANGLE
/
2
)
/
2
;
loc_yaw
=
-
LOC_SIGN_TRIANGLE_ANGLE
/
2
;
loc_yaw
=
-
GENERIC_
LOC_SIGN_TRIANGLE_ANGLE
/
2
;
world_x
=
world
.
x
+
loc_x
*
std
::
cos
(
world
.
heading
)
-
loc_y
*
std
::
sin
(
world
.
heading
);
world_x
=
world
.
x
+
loc_x
*
std
::
cos
(
world
.
heading
)
-
loc_y
*
std
::
sin
(
world
.
heading
);
world_y
=
world
.
y
+
loc_x
*
std
::
sin
(
world
.
heading
)
+
loc_y
*
std
::
cos
(
world
.
heading
);
world_y
=
world
.
y
+
loc_x
*
std
::
sin
(
world
.
heading
)
+
loc_y
*
std
::
cos
(
world
.
heading
);
world_yaw
=
loc_yaw
+
world
.
heading
;
world_yaw
=
loc_yaw
+
world
.
heading
;
...
@@ -215,6 +220,8 @@ void generate_signals_launch(std::string &path,std::string &signals_file,COpendr
...
@@ -215,6 +220,8 @@ void generate_signals_launch(std::string &path,std::string &signals_file,COpendr
out_file
<<
" <arg name=
\"
model
\"
value=
\"
sign
\"
/>"
<<
std
::
endl
;
out_file
<<
" <arg name=
\"
model
\"
value=
\"
sign
\"
/>"
<<
std
::
endl
;
out_file
<<
" <arg name=
\"
type
\"
value=
\"
"
<<
name
<<
"
\"
/>"
<<
std
::
endl
;
out_file
<<
" <arg name=
\"
type
\"
value=
\"
"
<<
name
<<
"
\"
/>"
<<
std
::
endl
;
}
}
if
(
type
==
GLOBAL_LOC_TYPE
)
out_file
<<
" <arg name=
\"
tag
\"
value=
\"
"
<<
"alvar3_neg_1"
<<
"
\"
/>"
<<
std
::
endl
;
world
=
signal
.
get_world_pose
();
world
=
signal
.
get_world_pose
();
out_file
<<
" <arg name=
\"
x
\"
value=
\"
"
<<
world
.
x
<<
"
\"
/>"
<<
std
::
endl
;
out_file
<<
" <arg name=
\"
x
\"
value=
\"
"
<<
world
.
x
<<
"
\"
/>"
<<
std
::
endl
;
out_file
<<
" <arg name=
\"
y
\"
value=
\"
"
<<
world
.
y
<<
"
\"
/>"
<<
std
::
endl
;
out_file
<<
" <arg name=
\"
y
\"
value=
\"
"
<<
world
.
y
<<
"
\"
/>"
<<
std
::
endl
;
...
...
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