2018-06-01から1ヶ月間の記事一覧

Google scholarにコマンドラインで問い合わせる

scholarly.pyを使う https://github.com/shohei/scholar.py/usr/local/bin/getpaper #!/usr/bin/env python import sys import os if(len(sys.argv)<2): print("usage: getpaper [phrase]") exit() phrase = "" for p in sys.argv[1:]: phrase = phrase +" "…

SphinxでMarkdownを使う

$ sudo pip install recommonmarkconf.py source_parsers = { '.md': 'recommonmark.parser.CommonMarkParser', } source_suffix = ['.rst', '.md']

sphinxプロジェクトの国際化

http://www.sphinx-doc.org/ja/stable/intl.html $ sudo pip install sphinx-intl conf.py locale_dirs = ['locale/'] # path is example but recommended. gettext_compact = False # optional. $ make gettext$ sphinx-intl update -p _build/locale -l ja…

overleafレポジトリからページを開く

/usr/local/bin/overleaf-open giturl=$(git config --get remote.origin.url) if [ "$giturl" == "" ] then echo "Not a git repository or no remote.origin.url set" exit 1; fi giturl=`echo $giturl | sed s/git/www/` open $giturl

PYNQでFTDIドライバを有効にする

FTDIデバイスがlsusbだと見えるんだけど、/dev/ttyUSB0にマウントされない カーネルモジュールを入れる必要がある(usbserial.koとftdi_sio.ko)クロスコンパイル環境のUbuntuでカーネルモジュールをビルドする この記事を参考:PYNQでデバイスドライバを開発…

カーネルモジュールのテスト(hello.ko)

https://www.tldp.org/LDP/lkmpg/2.6/html/x121.html hello.c /* * hello-1.c - The simplest kernel module. */ #include <linux/module.h> /* Needed by all modules */ #include <linux/kernel.h> /* Needed for KERN_INFO */ int init_module(void) { printk(KERN_INFO "Hello world 1.\n</linux/kernel.h></linux/module.h>…

PYNQでデバイスドライバを開発する

cdc-acm.koが必要になったので、そのビルド まずカーネルソース(linux-xlnx)を落とす git clone https://github.com/Xilinx/linux-xlnx.git該当のブランチをチェックアウト 今回はPYNQ v2.1を使う。https://github.com/Xilinx/PYNQ/releases によれば v2.1…

kobukiを動かす

Ubuntu で kobuki を動かすまでの手順 https://qiita.com/s_makinaga/items/0547ae13f8f4687538e4RaspberryPi2からTurtleBot2(kobuki)をROSで動かす https://qiita.com/sayonari/items/a9721afd92e2bfb34964

PYNQでUSB Wi-fiドングルでWifi通信する

いろんな記事でドライバのパッチ当てろとか見たけど、PYNQのnotebookから設定したら一瞬で接続できた notebooks/common/usb_wifi.ipynb を使う 結局は/etc/network/interfaces.d/ に無線LAN用の設定ファイルを作っているだけ $ lsusb Bus 001 Device 002: ID…

PYNQの時刻合わせ

https://askubuntu.com/questions/1009729/unable-to-start-ntpd-service sudo apt install ntp sudo systemctl restart ntp.service

PCとRPiのROSで通信する

RPi側でroscoreを動かす (本当はcoreはPC側がいいが、VMなので外からのアクセスを設定するのが面倒くさい)RPiの.bashrc export ROS_MASTER_URI=http://192.168.100.40:11311 export ROS_HOSTNAME=192.168.100.40PC(VMware fusion上のUbuntu)の.bashrc expo…

Kobukiのハードウェア

http://files.yujinrobot.com/kobuki/hardware/models/ https://github.com/shohei/kobuki-hardware

Kobuki ROSドライバのインストール

sudo apt install ros-kinetic-kobuki sudo apt install ros-kinetic-kobuki-gazeboインストール確認(Firmware Version Check) rosrun kobuki_driver version_info駆動テスト http://wiki.ros.org/kobuki/Tutorials/Make%20it%20move # First shell $ roslau…

UR5+ROSのテスト

https://github.com/ros-industrial/universal_robot/issues/243 In terminal 1: roslaunch ur_gazebo ur5.launch limited:=truein terminal 2: roslaunch ur5_moveit_config ur5_moveit_planning_execution.launch sim:=true limited:=truein terminal 3: r…

ROSのナビゲーションスタック

Navigation Stack を理解する - 2.1 move_base: ROSで遊んでみる https://qiita.com/MoriKen/items/8387b279e968368783f1Navigation Stack を理解する - 3.1 amcl: ROSで遊んでみる https://qiita.com/MoriKen/items/87be494f048ea03fdab8Navigation Stack …

VMware fusion上のUbuntuでGazeboが起動しない

http://answers.gazebosim.org/question/13214/virtual-machine-not-launching-gazebo/export SVGA_VGPU10=0 を.bashrcに追加する

PythonでASTを逆変換してソースコードにする その2

whileループを抜き出して別の関数に埋め込む例 import ast import codegen expr=""" def main(): i = 0 while(i<3): print(i) i += 1 print("done") if __name__=="__main__": main() """ p=ast.parse(expr) while_part = p.body[0].body.pop(1) p1 = ast.pa…

PythonでASTを逆変換してソースコードにする

https://stackoverflow.com/a/769202 import ast import codegen expr=""" def foo(): print("hello world") """ p=ast.parse(expr) p.body[0].body = [ ast.parse("return 42").body[0] ] # Replace function body with "return 42" print(codegen.to_sourc…