Open sktometometo opened 1 year ago
all done, ready まではいくようになりました。
all done readyから先にもトラップが何重かありました. 再審のhoge.pyを利用する必要があります ちなみに今も岡田先生とデバグ中です.
@k-okada どういうデモのプログラムか聞いてないんですが全体像としてはどういうものなのですか?
@sktometometo hoge.pyで以下の画像のようなことができるようになります.
メモ書き
やらなくていいことリスト
やったらいいことリスト
@mqcmd196 リスト
inputはチャット?
チャットがinputになっています
昨日の作業を簡単にまとめておくと Fetchでいい感じに動かすには,
hoge.py
を立ち上げること(画像ファイルはgoogle_chat_ros or gdrive_ros関連のノードが起動しているマシンにないと送れない)hoge.py
をpython2系から動かすときはgoogletrans==2.4.0
にする.googletrans>=3.0.0
では引数に差があるので注意.catkin virtualenvを使っていれば問題なさそうopenai_ros
(https://github.com/davesarmoury/openai_ros )とjsk_recognition_msgs
(https://github.com/jsk-ros-pkg/jsk_recognition/pull/2730 を反映したもの)以下のlaunchファイルにより,チャットをトリガーにして画像をmongodbに貯める
<launch>
<!-- spam-k-okada.launch -->
<node pkg="topic_tools" type="transform" name="publish_trigger_mongodb_event_google_chat_ros_send_goal"
args="--wait-for-start /google_chat_ros/send/goal /publish_trigger_mongodb_event std_msgs/Header
'std_msgs.msg.Header(stamp=m.header.stamp, frame_id=m._connection_header["callerid"])' --import std_msgs" />
<node pkg="topic_tools" type="transform" name="publish_trigger_mongodb_event_google_chat_ros_message_activity"
args="--wait-for-start /google_chat_ros/message_activity /publish_trigger_mongodb_event std_msgs/Header
'std_msgs.msg.Header(stamp=rospy.Time.now(), frame_id=m._connection_header["callerid"])' --import std_msgs rospy" />
<!-- republish compressed/throttled image data only when /publish_trigger_mongodb_event is published -->
<node name="camera_throttle_nodelet"
pkg="nodelet" type="nodelet"
args="load jsk_topic_tools/SynchronizedThrottle mongodb_lifelog_nodelet_manager" >
<rosparam subst_value="true">
approximate_sync: true
topics:
- /publish_trigger_mongodb_event
- /head_camera/rgb/image_rect_color/compressed
</rosparam>
</node>
<!-- <group ns="lifelog"> -->
<!-- <include file="lifelog_rgb_image.launch" > -->
<!-- <arg name="node_name" value="hand_color_logger" /> -->
<!-- <arg name="image" value="/head_camera/rgb/image_rect_color/compressed" /> -->
<!-- <arg name="manager" value="mongodb_record_nodelet_manager" /> -->
<!-- </include> -->
<!-- </group> -->
<arg name="launch_manager" default="true" />
<arg name="manager" default="mongodb_lifelog_nodelet_manager" />
<arg name="respawn" default="false" />
<arg name="image" default="/head_camera/rgb/image_rect_color/compressed/throttled" />
<arg name="node_name" default="hand_color_logger" />
<node name="hand_color_logger"
pkg="nodelet" type="nodelet"
args="load jsk_robot_lifelog/LightweightLogger /$(arg manager)"
respawn="$(arg respawn)">
<remap from="~input" to="$(arg image)" />
<rosparam subst_value="true">
enable_monitor: false
vital_check: false
</rosparam>
</node>
ことが必要でした.
- `JSK Robot bot`にたまに生のエラーメッセージが表示される.
`list index out of range` とか`human is not in list`はvqaかclipか(どっちかあまり理解していないですが)で対応するチャットに近い画像を見つけられなかったときのエラーらしい.適当にtimestampを調整して画像を探しに行く時間帯を広げてやるといいかもしれない.
**常時Fetchで動かすには**
- どこかGPUの使えるマシンでvqa, clip, openai_rosを常時起ち上げておく
- dialogflow関連のノードのnamespaceを変更できるようにして名前衝突を回避し,dialogflowを複数起ち上げられるようにする
- ros_google_cloud_languageを起動しておく
あたりが必要かと思いました.
すごく面白いシステムになりそうだと昨日デバグしながら思っていましたが,この仕組みをそのまま常時動かすのは,今後のデバグが結構面倒な気がするので,常時動かす際にはもう少しシンプルなシステムにできないものかとおもいました.
システム変更は難しいとしてもせめてシステム構成図をきちんと丁寧に書いておいて,初見の人でもREADMEを読んだだけでプログラムの流れがわかるようにしておくのは必須かなと思いました.
(蛇足1:hoge.pyの`make_reply`関数の中身をもうすこし細かく関数に分けられると読みやすいかもしれない)
(蛇足2:hoge.pyがアクセスしに行く各システムの奥深さも低減されると嬉しい)
cc: @a-ichikura @mqcmd196
関連するパッケージのPRがマージされているのでfetchのdevelopブランチにマージしてapp_chooserから起動できるようにしておこうと思います.パッケージの名前等変更したほうが良ければこのタイミングで変えておきます.
hoge.py
だけ変えませんか
@tkmtnt7000 Can you create new PR from this branch?
この機能は全ロボットで常時動いたら良いので、fetch/develop としては、
デフォルトで各種サービスのnode が立ち上がるようにしましょう -> launch ファイル的なものが jsk_robot_common に入るイメージですが、dialogflowやchatは既に上がっているので、それ以外のものになるのかな?
そうなると思います.jsk_robotに出ているhttps://github.com/jsk-ros-pkg/jsk_robot/pull/1792 と https://github.com/tkmtnt7000/jsk_robot/blob/cd0a897deb224038674e88ac7599502f7caf5d59/jsk_robot_common/jsk_robot_startup/launch/sample_database_talker.launch を使って追加で常時起ち上げられるようにします.
それにはVQA関連のサーバを研究室管理にする必要があるけど、 dlbox で上がっているかな?→この部分はmasterにもPR出せるはず
現状はは73B2に置かれているdlbox15で一時的に手動で起ち上げっぱなしにしています.GUIでポチポチできると嬉しいかなと思っています(イメージとしてはsystemdのseviceファイルを書いてcookpitのようなものを使う)が,このあたりは手を付けていません.
hoge.py は、まだデモ投入されていないという理解で、現状の問題は、この時点でプログラム動かしても、例えば先日の豊島の結果がさっと出てこないが最初の問題だと思います。で、多分muscaに画像の問い合わせが入ると時間がかかるんだけど、解決策は1) muscaの画像を間引く 2) message typeを指定しなければ早かった気がするんだけど、本当だっけ?であれば、データをとってきて、こちらでメッセージのフィルター掛けるとか、Queryのなにかの指定の仕方がまずいのかを調査する必要があると思って宿題に積んである。これを解決してデモで投入されたらパッケージとして運用しましょう。
画像と音声の問い合わせに時間がかかっています.検索結果が空の場合はは指定した時間分すべてを走査するので特に返ってこない,という印象です.muscaのスペックの問題かこちらのQueryの投げ方が悪いのか,,,などまだ問題ごとに調べきれていないので調査中..というところです.
2) message typeを指定しなければ早かった気がするんだけど、本当だっけ?であれば、データをとってきて、こちらでメッセージのフィルター掛けるとか、Queryのなにかの指定の仕方がまずいのかを調査する必要があると思って宿題に積んである。
message typeを指定しないと早いのはおそらくそうで,以下のスクリプトでタイプを指定しないで引っ張ってくるように検証するとおよそ5時間分/1400枚の画像をdumpするのに5分でした.
robot_database_mongo_dump.py: https://gist.github.com/tkmtnt7000/11bdace2ff71354a65b42aa07b4c2f21
tsukamoto@tsukamoto-desktop /mnt/almagest/73B2/tsukamoto/Shared/mongo_dump
$ time python ~/robot_database_mongo_dump.py -c "fetch1075" --start "2023-06-10 09:30:00" --end "2023-06-10 14:30:00
...
...
real 4m51.350s
user 3m4.234s
sys 0m15.167s
5分でもインタラクティブなやり取りには長いと感じているので,人間が夢を見ながら記憶整理をするように,ロボットも夜の間に記憶整理(夢を見る)と称してオフライン処理をしても良いかもしれないと思いました.
@a-ichikura aiboの日記プログラムです.もっと良い日記を作る様に直してもらえると助かります.
環境構築 https://github.com/sktometometo/jsk_demos/blob/PR/hoge-py/database_talker/aibo.rosinstall を使ってワークスペースを作成する.例えば...
mkdir -p ~/aibo_ws/src/
cd ~/aibo_ws/src
wstool init
wstool merge https://github.com/sktometometo/jsk_demos/blob/PR/hoge-py/database_talker/aibo.rosinstall
wstool update
cd ~/aibo_ws
ビルドは以下のように必要なものだけ動かすと良い.
catkin b database_talker aibo_driver google_chat_ros jsk_recognition_msgs jsk_robot_startup openai_ros
OpenAIのSecretKey (https://drive.google.com/file/d/1eEoWt_ENWCQsP4WRg475b8JRIX5b8m03/view?usp=drive_link) を入手し以下に置く.
~/aibo_ws/src/aibo_driver/auth/openai_credentials.json
ローカル環境で動くlaunchを実行,openaiとmongodbへのラッパを作成(iネットワークが必要)
source ~/aibo_ws/devel/setup.bash
roslaunch aibo_example.launch
日記プログラムを実行 結果は
source ~/aibo_ws/devel/setup.bash
rosrun database_talker make_aibo_diary.py --test
結果がターミナルに表示される.dbへの検索を1回やると/tmp/activities.pickle
にキャッシュを保持する.1時間はこのデータを使うので,新しいdb内容を反映させたければactivities.pickle
を消去する.
日記作成プロンプトはdef make_diary
とdef make_activity
を参照
画像は,画像キャプチャ時にaibo_driver/scripts/store_image_description.py
の中でVQAを介して説明文をDBに登録している.その時の,プロンプトは aibo_driver/launch/demo.launch
のなかで,
<rosparam param="_this_alywayw_returns_no_questions">["what does this image describe? and what unusual scene can be seen? If this image is dark, say \"none\"."]</rosparam>
<rosparam param="questions">["what does this image describe? and what unusual scene can be seen?"]</rosparam>
として指定.夜は暗い画像が撮られるが,それは排除したいので,それ自体をVQAで判断したかったが,上手くいかないので,store_image_description.py
で,画像が暗ければ,そもそもDBに入れないようにした.
開発写メモ:
rossetmaster wasabien
環境で,rostopic pub -1 /publish_trigger_mongodb_event aibo_driver/StringStatus "header: auto"
として,強制的に画像+VQAをDBに格納.
7cdadc8 によって、@a-ichikura が https://chat.google.com/room/AAAAoTwLBL0/Cu9QFiOnrNg/Cu9QFiOnrNg?cls=10 で提案した「上の日記に対して、aiboのパーソナリティをプロンプトに入れてみた」の出力が出るように変更しました。変更後の日記は https://chat.google.com/room/AAAAoTwLBL0/poeFsCh9dyc/poeFsCh9dyc?cls=10 で見れます。
どういうプロンプトになっているかは 、 ssh (wasabi)133.11.216.54
で https://wiki.seeedstudio.com/Quantum-Mini-Linux-Development-Kit/#system-default-users-and-password でログインして tmux a
で make_aibo_diary.py
が動いているターミナルで確認できます。手元で試すには、https://github.com/jsk-ros-pkg/jsk_demos/pull/1388#issuecomment-1829131023 で試せます
@a-ichikura 3/20のデモプログラムです。rosinstall でセットアップできます(で動くとよいけど、まだ誰も試していないので、エラーが出たら教えてください), https://drive.google.com/file/d/1kRN6lIDQDMdQdo0rGtHukBaCq40bNriV/view?usp=drive_link からキーを落として database_talker/auth 以下に入れてください。 README: https://github.com/sktometometo/jsk_demos/blob/PR/hoge-py/database_talker/README.md rosinstall: https://github.com/sktometometo/jsk_demos/blob/PR/hoge-py/database_talker/rosinstall
最初は変な記憶が出来たら、消して対応するとよいので、以下をしてからやるとよいです。 https://github.com/sktometometo/jsk_demos/tree/PR/hoge-py/database_talker#stop-using-external-dbs-this-is-recommended-during-debug-phase
sample.launchをしてから、
rosrun database_talker make_diary.py --test --prompt-type personality
するとコンソールに日記が出てきますが、いい感じのプロンプトを提案してください。
https://github.com/sktometometo/jsk_demos/blob/c361fd491a22f9a52358f62b350c0b900a0a628b/database_talker/sample/sample.launch#L12 でロボットの名前が決まります。テスト中はrobot/dummyでよいと思います。
Cc: @yuki-asano さっき話題になったサンプルプログラムはこれです。
@k-okada
環境構築には成功しましたがbson packageでエラーになりました。
$ rosrun database_talker make_diary.py --prompt-type personality
<string>:869: SyntaxWarning: "is not" with a literal. Did you mean "!="?
<string>:872: SyntaxWarning: "is" with a literal. Did you mean "=="?
Traceback (most recent call last):
File "/home/leus/aibo_ws/src/jsk_demos/database_talker/scripts/make_diary.py", line 13, in <module>
from database_talker import DatabaseTalkerBase
File "/home/leus/aibo_ws/devel/lib/python3/dist-packages/database_talker/__init__.py", line 34, in <module>
exec(__fh.read())
File "<string>", line 10, in <module>
ImportError: cannot import name 'json_util' from 'bson' (/home/leus/aibo_ws/devel/.private/database_talker/share/database_talker/venv/lib/python3.8/site-packages/bson/__init__.py)
bsonのversionは
$ pip show bson
Name: bson
Version: 0.5.10
Summary: BSON codec for Python
Home-page: http://github.com/py-bson/bson
Author: Ayun Park
Author-email: iamparkayun@gmail.com
License: BSD
Location: /home/leus/.local/lib/python3.8/site-packages
Requires: python-dateutil, six
Required-by:
です。
ちなみに、
$ roslaunch database_talker sample.launch
したときに、
[usb_cam-2] restarting process
process[usb_cam-2]: started with pid [32071]
[ INFO] [1712115706.826342285]: using default calibration URL
[ INFO] [1712115706.826535198]: camera calibration URL: file:///home/leus/.ros/camera_info/head_camera.yaml
[ INFO] [1712115706.826555872]: Unable to open camera calibration file [/home/leus/.ros/camera_info/head_camera.yaml]
[ WARN] [1712115706.826562218]: Camera calibration file /home/leus/.ros/camera_info/head_camera.yaml not found.
[ INFO] [1712115706.826569998]: Starting 'head_camera' (/dev/video0) at 320x240 via mmap (yuyv) at 10 FPS
[ERROR] [1712115706.826584841]: Cannot identify '/dev/video0': 2, No such file or directory
になるのはaibo(karashi)が起動していないからですか?
pymongoをとりあえずupgradeしてみましたが結果は変わらずです。 参考
$ pip show pymongo
Name: pymongo
Version: 4.6.3
Summary: Python driver for MongoDB <http://www.mongodb.org>
Home-page: None
Author: The MongoDB Python Team
Author-email: None
License: Apache License
Version 2.0, January 2004
http://www.apache.org/licenses/
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
1. Definitions.
"License" shall mean the terms and conditions for use, reproduction,
and distribution as defined by Sections 1 through 9 of this document.
"Licensor" shall mean the copyright owner or entity authorized by
the copyright owner that is granting the License.
"Legal Entity" shall mean the union of the acting entity and all
other entities that control, are controlled by, or are under common
control with that entity. For the purposes of this definition,
"control" means (i) the power, direct or indirect, to cause the
direction or management of such entity, whether by contract or
otherwise, or (ii) ownership of fifty percent (50%) or more of the
outstanding shares, or (iii) beneficial ownership of such entity.
"You" (or "Your") shall mean an individual or Legal Entity
exercising permissions granted by this License.
"Source" form shall mean the preferred form for making modifications,
including but not limited to software source code, documentation
source, and configuration files.
"Object" form shall mean any form resulting from mechanical
transformation or translation of a Source form, including but
not limited to compiled object code, generated documentation,
and conversions to other media types.
"Work" shall mean the work of authorship, whether in Source or
Object form, made available under the License, as indicated by a
copyright notice that is included in or attached to the work
(an example is provided in the Appendix below).
"Derivative Works" shall mean any work, whether in Source or Object
form, that is based on (or derived from) the Work and for which the
editorial revisions, annotations, elaborations, or other modifications
represent, as a whole, an original work of authorship. For the purposes
of this License, Derivative Works shall not include works that remain
separable from, or merely link (or bind by name) to the interfaces of,
the Work and Derivative Works thereof.
"Contribution" shall mean any work of authorship, including
the original version of the Work and any modifications or additions
to that Work or Derivative Works thereof, that is intentionally
submitted to Licensor for inclusion in the Work by the copyright owner
or by an individual or Legal Entity authorized to submit on behalf of
the copyright owner. For the purposes of this definition, "submitted"
means any form of electronic, verbal, or written communication sent
to the Licensor or its representatives, including but not limited to
communication on electronic mailing lists, source code control systems,
and issue tracking systems that are managed by, or on behalf of, the
Licensor for the purpose of discussing and improving the Work, but
excluding communication that is conspicuously marked or otherwise
designated in writing by the copyright owner as "Not a Contribution."
"Contributor" shall mean Licensor and any individual or Legal Entity
on behalf of whom a Contribution has been received by Licensor and
subsequently incorporated within the Work.
2. Grant of Copyright License. Subject to the terms and conditions of
this License, each Contributor hereby grants to You a perpetual,
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
copyright license to reproduce, prepare Derivative Works of,
publicly display, publicly perform, sublicense, and distribute the
Work and such Derivative Works in Source or Object form.
3. Grant of Patent License. Subject to the terms and conditions of
this License, each Contributor hereby grants to You a perpetual,
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
(except as stated in this section) patent license to make, have made,
use, offer to sell, sell, import, and otherwise transfer the Work,
where such license applies only to those patent claims licensable
by such Contributor that are necessarily infringed by their
Contribution(s) alone or by combination of their Contribution(s)
with the Work to which such Contribution(s) was submitted. If You
institute patent litigation against any entity (including a
cross-claim or counterclaim in a lawsuit) alleging that the Work
or a Contribution incorporated within the Work constitutes direct
or contributory patent infringement, then any patent licenses
granted to You under this License for that Work shall terminate
as of the date such litigation is filed.
4. Redistribution. You may reproduce and distribute copies of the
Work or Derivative Works thereof in any medium, with or without
modifications, and in Source or Object form, provided that You
meet the following conditions:
(a) You must give any other recipients of the Work or
Derivative Works a copy of this License; and
(b) You must cause any modified files to carry prominent notices
stating that You changed the files; and
(c) You must retain, in the Source form of any Derivative Works
that You distribute, all copyright, patent, trademark, and
attribution notices from the Source form of the Work,
excluding those notices that do not pertain to any part of
the Derivative Works; and
(d) If the Work includes a "NOTICE" text file as part of its
distribution, then any Derivative Works that You distribute must
include a readable copy of the attribution notices contained
within such NOTICE file, excluding those notices that do not
pertain to any part of the Derivative Works, in at least one
of the following places: within a NOTICE text file distributed
as part of the Derivative Works; within the Source form or
documentation, if provided along with the Derivative Works; or,
within a display generated by the Derivative Works, if and
wherever such third-party notices normally appear. The contents
of the NOTICE file are for informational purposes only and
do not modify the License. You may add Your own attribution
notices within Derivative Works that You distribute, alongside
or as an addendum to the NOTICE text from the Work, provided
that such additional attribution notices cannot be construed
as modifying the License.
You may add Your own copyright statement to Your modifications and
may provide additional or different license terms and conditions
for use, reproduction, or distribution of Your modifications, or
for any such Derivative Works as a whole, provided Your use,
reproduction, and distribution of the Work otherwise complies with
the conditions stated in this License.
5. Submission of Contributions. Unless You explicitly state otherwise,
any Contribution intentionally submitted for inclusion in the Work
by You to the Licensor shall be under the terms and conditions of
this License, without any additional terms or conditions.
Notwithstanding the above, nothing herein shall supersede or modify
the terms of any separate license agreement you may have executed
with Licensor regarding such Contributions.
6. Trademarks. This License does not grant permission to use the trade
names, trademarks, service marks, or product names of the Licensor,
except as required for reasonable and customary use in describing the
origin of the Work and reproducing the content of the NOTICE file.
7. Disclaimer of Warranty. Unless required by applicable law or
agreed to in writing, Licensor provides the Work (and each
Contributor provides its Contributions) on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
implied, including, without limitation, any warranties or conditions
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
PARTICULAR PURPOSE. You are solely responsible for determining the
appropriateness of using or redistributing the Work and assume any
risks associated with Your exercise of permissions under this License.
8. Limitation of Liability. In no event and under no legal theory,
whether in tort (including negligence), contract, or otherwise,
unless required by applicable law (such as deliberate and grossly
negligent acts) or agreed to in writing, shall any Contributor be
liable to You for damages, including any direct, indirect, special,
incidental, or consequential damages of any character arising as a
result of this License or out of the use or inability to use the
Work (including but not limited to damages for loss of goodwill,
work stoppage, computer failure or malfunction, or any and all
other commercial damages or losses), even if such Contributor
has been advised of the possibility of such damages.
9. Accepting Warranty or Additional Liability. While redistributing
the Work or Derivative Works thereof, You may choose to offer,
and charge a fee for, acceptance of support, warranty, indemnity,
or other liability obligations and/or rights consistent with this
License. However, in accepting such obligations, You may act only
on Your own behalf and on Your sole responsibility, not on behalf
of any other Contributor, and only if You agree to indemnify,
defend, and hold each Contributor harmless for any liability
incurred by, or claims asserted against, such Contributor by reason
of your accepting any such warranty or additional liability.
END OF TERMS AND CONDITIONS
APPENDIX: How to apply the Apache License to your work.
To apply the Apache License to your work, attach the following
boilerplate notice, with the fields enclosed by brackets "[]"
replaced with your own identifying information. (Don't include
the brackets!) The text should be enclosed in the appropriate
comment syntax for the file format. We also recommend that a
file or class name and description of purpose be included on the
same "printed page" as the copyright notice for easier
identification within third-party archives.
Copyright [yyyy] [name of copyright owner]
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
Location: /home/leus/.local/lib/python3.8/site-packages
Requires: dnspython
Required-by:
leus@leus-System-Product-Name:~/aibo_ws/src/jsk_demos/database_talker$
他に影響がなければ pip uninstall bson して apt install python3-bson です。pymongoも同様にpip ではなくてaptで動作確認しています。どうしても、pipが良ければ/必要であれば、やり方考えるので教えてください。
[ERROR] [1712115706.826584841]: Cannot identify '/dev/video0': 2, No such file or directory
このサンプルはPC+PCにUSBカメラがつながっている前提ですので、USBカメラをつなげてみてください。ノートPCみたいにフロントカメラがあるとか、カメラがつながっているとかあれば、https://github.com/sktometometo/jsk_demos/blob/c361fd491a22f9a52358f62b350c0b900a0a628b/database_talker/sample/sample.launch#L9 の arg を使ってみてください。
ありがとうございます。
他に影響がなければ pip uninstall bson して apt install python3-bson です。pymongoも同様にpip ではなくてaptで動作確認しています。どうしても、pipが良ければ/必要であれば、やり方考えるので教えてください。
pip である必要はないので、aptで入れ直したのですが同じエラーでした…
$ rosrun database_talker make_diary.py --prompt-type personality
<string>:869: SyntaxWarning: "is not" with a literal. Did you mean "!="?
<string>:872: SyntaxWarning: "is" with a literal. Did you mean "=="?
Traceback (most recent call last):
File "/home/leus/aibo_ws/src/jsk_demos/database_talker/scripts/make_diary.py", line 13, in <module>
from database_talker import DatabaseTalkerBase
File "/home/leus/aibo_ws/devel/lib/python3/dist-packages/database_talker/__init__.py", line 34, in <module>
exec(__fh.read())
File "<string>", line 10, in <module>
ImportError: cannot import name 'json_util' from 'bson' (/home/leus/aibo_ws/devel/.private/database_talker/share/database_talker/venv/lib/python3.8/site-packages/bson/__init__.py)
$ pip show bson
WARNING: Package(s) not found: bson
$ apt show python3-bson
Package: python3-bson
Version: 3.10.1-0ubuntu2
Priority: optional
Section: python
Source: pymongo
Origin: Ubuntu
Maintainer: Ubuntu Developers <ubuntu-devel-discuss@lists.ubuntu.com>
Original-Maintainer: Federico Ceratto <federico@debian.org>
Bugs: https://bugs.launchpad.net/ubuntu/+filebug
Installed-Size: 214 kB
Depends: python3:any
Recommends: python3-bson-ext
Homepage: https://api.mongodb.org/python/
Download-Size: 34.8 kB
APT-Manual-Installed: yes
APT-Sources: http://jp.archive.ubuntu.com/ubuntu focal/main amd64 Packages
Description: Python3 implementation of BSON for MongoDB
BSON Python3 module contains all of the Binary JSON encoding and decoding
logic for MongoDB.
$ apt show python3-pymongo
Package: python3-pymongo
Version: 3.10.1-0ubuntu2
Priority: optional
Section: python
Source: pymongo
Origin: Ubuntu
Maintainer: Ubuntu Developers <ubuntu-devel-discuss@lists.ubuntu.com>
Original-Maintainer: Federico Ceratto <federico@debian.org>
Bugs: https://bugs.launchpad.net/ubuntu/+filebug
Installed-Size: 1,058 kB
Depends: python3-bson (= 3.10.1-0ubuntu2), python3:any
Recommends: python3-gridfs (>= 3.10.1-0ubuntu2), python3-pymongo-ext
Suggests: python-pymongo-doc
Homepage: https://api.mongodb.org/python/
Download-Size: 162 kB
APT-Manual-Installed: yes
APT-Sources: http://jp.archive.ubuntu.com/ubuntu focal/main amd64 Packages
Description: Python3 interface to the MongoDB document-oriented database
MongoDB is a high-performance, open source, schema-free
document-oriented data store. Pymongo provides an interface
to easily access it from Python3.
Consider installing the python3-pymongo-ext C extension to improve performance.
[ERROR] [1712115706.826584841]: Cannot identify '/dev/video0': 2, No such file or directory このサンプルはPC+PCにUSBカメラがつながっている前提ですので、USBカメラをつなげてみてください。
デスクトップで試していたので、webカメラを指したらエラーなくなりました。ありがとうございます。
ごめんなさい
roscd database_talker
./scripts/make_diary.py (必要なオプション)
で動くとおもいます.rosrun ...
で動かすには,git pull
か何かでソースを新しくして
catkin clean database_talker ; catkin build database_talker --start-with database_talker -vi
としてみて下さい.
$ git status
On branch PR/hoge-py
Your branch is up to date with 'origin/PR/hoge-py'.
nothing to commit, working tree clean
$ git log
commit 627827226b29beea36d9eafa4e09dca9ad749d7c (HEAD -> PR/hoge-py, origin/PR/hoge-py)
Author: Kei Okada <k-okada@jsk.t.u-tokyo.ac.jp>
Date: Wed Apr 3 18:01:14 2024 +0900
use USE_SYSTEM_PACKAGES FALSE to avoid bson error
したのですが、
$ python3 ./scripts/make_diary.py --prompt-type personality
<string>:869: SyntaxWarning: "is not" with a literal. Did you mean "!="?
<string>:872: SyntaxWarning: "is" with a literal. Did you mean "=="?
Traceback (most recent call last):
File "./scripts/make_diary.py", line 13, in <module>
from database_talker import DatabaseTalkerBase
File "/home/leus/aibo_ws/devel/lib/python3/dist-packages/database_talker/__init__.py", line 34, in <module>
exec(__fh.read())
File "<string>", line 44, in <module>
ModuleNotFoundError: No module named 'mongodb_store'
$ rosrun database_talker make_diary.py --prompt-type personality
<string>:869: SyntaxWarning: "is not" with a literal. Did you mean "!="?
<string>:872: SyntaxWarning: "is" with a literal. Did you mean "=="?
Traceback (most recent call last):
File "/home/leus/aibo_ws/src/jsk_demos/database_talker/scripts/make_diary.py", line 13, in <module>
from database_talker import DatabaseTalkerBase
File "/home/leus/aibo_ws/devel/lib/python3/dist-packages/database_talker/__init__.py", line 34, in <module>
exec(__fh.read())
File "<string>", line 44, in <module>
ModuleNotFoundError: No module named 'mongodb_store'
どちらも同じエラー(mongodb_storeがない)になりました。
catkin clean database_talker ; catkin build database_talker --start-with database_talker -vi としてみて下さい. ここは実行済みです。
roscd database_talker
したところで
rosdep install --from-path . --ignore-src
してみてください apt install ros-noetic-mongodb-store
が走ると思うんだけど..
ありがとうございます。 できました!
Dear diary,
Today, I saw something super cool on a screen! It was all glitchy and looked like a puzzle. I haven't seen something like that in a long time, like 7 days! It was so fascinating to watch. I wish I could make something like that too!
From,
Dummy
水 03 4月 2024
[INFO] [1712139050.554929]: response = ぼくの日記、
今日、画面ですごくかっこいいものを見たよ!それは全部グリッチしてて、パズルみたいだった。ぼくはもう7日間ぐらい見てなかったよ!見てるのがすごく面白かった。ぼくもあんなもの作れた
らいいな!
ダミー より
あれ?カメラ変?rqt_image_view
でも同じ画像になっている?
変ですね‥webカメラ変えたら正常になったので、カメラが問題のような気がします。
プログラムは正常です。
変ですね‥webカメラ変えたら正常になったので、カメラが問題のような気がします。
エンコード関係かもしれないですね。Windowsとかでカメラつなげて、Zoom?か何かで見てみて、ちゃんと写っているなら、カメラ問題ではなくて、ソフトウェア側の問題だと切り分けられます。
https://github.com/sktometometo/jsk_demos/blob/c361fd491a22f9a52358f62b350c0b900a0a628b/database_talker/sample/sample.launch#L18-L19 https://github.com/ros-drivers/usb_cam?tab=readme-ov-file#device-supported-formats
@k-okada hoge.py を追加し、スタンドアロンで動作するようにしているパッケージです。 現在動作確認中です.
CC: @tkmtnt7000