Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in / Register
Toggle navigation
J
jfx_kalman_filter_src
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Packages
Packages
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
oscar
jfx_kalman_filter_src
Commits
ae6ba1e1
Commit
ae6ba1e1
authored
Jun 27, 2022
by
oscar
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
update
parent
3e3215bb
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
13 additions
and
53 deletions
+13
-53
TrackingRos2.cpp
ros2/TrackingRos2.cpp
+13
-53
No files found.
ros2/TrackingRos2.cpp
View file @
ae6ba1e1
...
...
@@ -179,6 +179,7 @@ void TrackingRos2::TrackingPorcess(objTrackListPtr objsPtr) {
// jsk_recognition_msgs::BoundingBoxArray sendBoxes = {};
// visualization_msgs::MarkerArray markerArray = {};
// sendBoxes.header.frame_id = "/rslidar";
std
::
map
<
int
,
int
>
sameObj
;
for
(
auto
&
iter
:
trackers
)
{
autoware_auto_perception_msgs
::
msg
::
TrackedObject
obj
=
{};
wit_perception_msgs
::
msg
::
DetectedObjectWithFeatureEx
input_obj
=
{};
...
...
@@ -339,16 +340,14 @@ void TrackingRos2::TrackingPorcess(objTrackListPtr objsPtr) {
markerText
.
id
=
iter
.
first
;
markerText
.
pose
.
position
.
x
=
poss
.
x
;
markerText
.
pose
.
position
.
y
=
poss
.
y
;
markerText
.
pose
.
position
.
z
=
poss
.
z
+
dimensionss
.
z
/
2
+
0.3
m
;
Eigen
::
AngleAxisd
V3
(
rot_y_angle
,
Eigen
::
Vector3d
(
0
,
0
,
1
));
Eigen
::
Quaterniond
R_quat
(
V3
);
markerText
.
pose
.
position
.
z
=
poss
.
z
+
dimensionss
.
z
/
2
+
0.5
;
markerText
.
pose
.
orientation
.
x
=
0.0
f
;
markerText
.
pose
.
orientation
.
y
=
0.0
f
;
markerText
.
pose
.
orientation
.
z
=
0.0
f
;
markerText
.
pose
.
orientation
.
w
=
1.0
f
;
markerText
.
scale
.
x
=
1.5
;
markerText
.
scale
.
y
=
1.5
;
markerText
.
scale
.
z
=
1
,
5
;
markerText
.
scale
.
x
=
3
;
markerText
.
scale
.
y
=
3
;
markerText
.
scale
.
z
=
3
;
markerText
.
color
.
r
=
0.0
f
;
markerText
.
color
.
g
=
1.0
f
;
markerText
.
color
.
b
=
0.0
f
;
...
...
@@ -358,52 +357,15 @@ void TrackingRos2::TrackingPorcess(objTrackListPtr objsPtr) {
markerText
.
text
=
str
;
makerTextArray
.
markers
.
emplace_back
(
markerText
);
sendObjs
.
objects
.
emplace_back
(
obj
);
if
(
iter
.
second
->
m_obj
->
cameraId
>
0
&&
iter
.
second
->
m_obj
->
trackingId
>
0
)
{
if
(
sameObj
.
find
(
iter
.
second
->
m_obj
->
trackingId
)
==
sameObj
.
end
())
{
sameObj
[
iter
.
second
->
m_obj
->
trackingId
]
=
0
;
}
sameObj
[
iter
.
second
->
m_obj
->
trackingId
]
++
;
}
}
// jsk_recognition_msgs::BoundingBox box = {};
// box.label = obj.type;
// box.value = obj.obj_id;
// box.header.frame_id = "/rslidar";
// box.dimensions.x = obj.l;
// box.dimensions.y = obj.w;
// box.dimensions.z = obj.h;
// box.pose.position.x = obj.x;
// box.pose.position.y = obj.y;
// box.pose.position.z = obj.z;
// Eigen::AngleAxisd V3(rot_y_angle, Eigen::Vector3d(0, 0, 1));
// Eigen::Quaterniond R_quat(V3);
// box.pose.orientation.x = R_quat.x();
// box.pose.orientation.y = R_quat.y();
// box.pose.orientation.z = R_quat.z();
// //SDK_LOG(SDK_INFO, "rot_y_angle = %f", rot_y_angle);
// box.pose.orientation.w = R_quat.w();
// visualization_msgs::Marker t_marker = {};
// t_marker.id = obj.obj_id;
// t_marker.header.frame_id = "/rslidar";
// t_marker.action = visualization_msgs::Marker::ADD;
// t_marker.type = visualization_msgs::Marker::TEXT_VIEW_FACING;
// t_marker.pose.position.x = obj.x;
// t_marker.pose.position.y = obj.y;
// t_marker.pose.position.z = obj.z + obj.h / 2 + 0.3;
// t_marker.pose.orientation.x = 0.0;
// t_marker.pose.orientation.y = 0.0;
// t_marker.pose.orientation.z = 0.0;
// t_marker.pose.orientation.w = 1.0;
// t_marker.scale.x = 1.2;
// t_marker.scale.y = 1.2;
// t_marker.scale.z = 1.2;
// t_marker.color.a = 1.0;
// t_marker.color.r = 0;
// t_marker.color.g = 1.0;
// t_marker.color.b = 0;
// t_marker.lifetime = ros::Duration(0.5);
// char str[256] = {};
// int angle_i = int(rot_y_angle / _PI_ * 180);
// sprintf(str, "id:%llu,t:%d,yaw:%d", obj.obj_id, obj.type, angle_i);
// t_marker.text = str;
// markerArray.markers.emplace_back(t_marker);
// sendBoxes.boxes.emplace_back(box);
}
}
for
(
int
i
=
0
;
i
<
lostId
.
size
();
i
++
)
{
...
...
@@ -450,8 +412,6 @@ void TrackingRos2::TrackingPorcess(objTrackListPtr objsPtr) {
markerText
.
color
.
a
=
0.5
;
makerTextArray
.
markers
.
emplace_back
(
marker
);
}
// sendObjs.cloud = objsPtr->cloud;
// SDK_LOG(SDK_INFO, "calculate objs size = %d", sendObjs.array.size());
m_tracking_res
->
publish
(
sendObjs
);
m_pubMarker
->
publish
(
makerArray
);
...
...
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