Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
Pinoxchio
apollo
提交
306900b3
A
apollo
项目概览
Pinoxchio
/
apollo
与 Fork 源项目一致
从无法访问的项目Fork
通知
2
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
A
apollo
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
306900b3
编写于
9月 20, 2018
作者:
D
Dong Li
提交者:
Calvin Miao
9月 20, 2018
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
usb_cam: use cybertron task in usb_cam (#371)
上级
2cfe009e
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
5 addition
and
8 deletion
+5
-8
modules/drivers/usb_cam/usb_cam_component.cc
modules/drivers/usb_cam/usb_cam_component.cc
+4
-7
modules/drivers/usb_cam/usb_cam_component.h
modules/drivers/usb_cam/usb_cam_component.h
+1
-1
未找到文件。
modules/drivers/usb_cam/usb_cam_component.cc
浏览文件 @
306900b3
...
...
@@ -41,13 +41,11 @@ bool UsbCamComponent::Init() {
spin_rate_
=
camera_config_
->
spin_rate
();
if
(
camera_config_
->
output_type
()
==
YUYV
)
{
raw_image_
->
image_size
=
raw_image_
->
width
*
raw_image_
->
height
*
2
;
raw_image_
->
image_size
=
raw_image_
->
width
*
raw_image_
->
height
*
2
;
pb_image_
->
set_encoding
(
"yuyv"
);
pb_image_
->
set_step
(
2
*
raw_image_
->
width
);
}
else
if
(
camera_config_
->
output_type
()
==
RGB
)
{
raw_image_
->
image_size
=
raw_image_
->
width
*
raw_image_
->
height
*
3
;
raw_image_
->
image_size
=
raw_image_
->
width
*
raw_image_
->
height
*
3
;
pb_image_
->
set_encoding
(
"rgb8"
);
pb_image_
->
set_step
(
3
*
raw_image_
->
width
);
}
...
...
@@ -63,9 +61,8 @@ bool UsbCamComponent::Init() {
writer_
=
node_
->
CreateWriter
<
Image
>
(
camera_config_
->
channel_name
());
device_thread_
=
std
::
shared_ptr
<
std
::
thread
>
(
new
std
::
thread
(
std
::
bind
(
&
UsbCamComponent
::
run
,
this
)));
device_thread_
->
detach
();
task_
.
reset
(
new
apollo
::
cybertron
::
Task
<>
(
"usb_cam_task"
,
std
::
bind
(
&
UsbCamComponent
::
run
,
this
),
1
));
return
true
;
}
...
...
modules/drivers/usb_cam/usb_cam_component.h
浏览文件 @
306900b3
...
...
@@ -47,7 +47,7 @@ class UsbCamComponent : public Component<> {
std
::
shared_ptr
<
Config
>
camera_config_
;
CameraImagePtr
raw_image_
=
nullptr
;
std
::
shared_ptr
<
Image
>
pb_image_
=
nullptr
;
std
::
shared_ptr
<
std
::
thread
>
device_thread
_
;
std
::
unique_ptr
<
apollo
::
cybertron
::
Task
<>>
task
_
;
float
spin_rate_
=
0.005
;
float
device_wait_
=
2.0
;
};
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录