空飛ぶロボットのつくりかた

ロボットをつくるために必要な技術をまとめます。ロボットの未来についても考えたりします。

2017-03-05から1日間の記事一覧

rosテストのお勉強(python)

unittest CMakeLists.txt catkin_python_setup() if(CATKIN_ENABLE_TESTING) find_package(rostest REQUIRED) add_rostest(test/mytest.test) endif() package.xml <test_depend>rostest</test_depend> <test_depend>python-nose</test_depend> ↑テストにnoseをつかう場合 mytest.test <launch> </launch>

pythonのテストを書いてみる

unittest Robot and Animal roboani.py class Robot: def get_name(self): return "robot" def get_legs(self): return 2 class Animal: def get_name(self): return "animal" def get_legs(self): return 4 def calc_roboani_legs(robot,animal,heads,legs)…

BeautifulSoupの使い方

BeautifulSoupを使ったスクレイピング from BeautifulSoup import BeautifulSoup import re doc = ['<html><head><title>Page title</title></head>', '<body><p id="firstpara" align="center">This is paragraph <b>one</b>.', '<p id="secondpara" align="blah">This is paragraph <b>two</b>.', '</html>'] soup = BeautifulSoup('…

Emacsの使い方

設定読み込み順 一括コメントアウト 一括インデント 対話置換 位置画面上・下 init.el設定 pyflakesの設定 flymakeでファイルが開けない時 行数設定 対応する括弧を光らせる 自動補完 ロードパスの設定 python設定 lintの設定 el-getのインストール fly-chec…