{"id":344729,"date":"2023-07-04T13:30:27","date_gmt":"2023-07-04T04:30:27","guid":{"rendered":"https:\/\/techshare.co.jp\/faq\/?p=344729"},"modified":"2023-08-01T11:48:31","modified_gmt":"2023-08-01T02:48:31","slug":"go1_ros_lowlevel","status":"publish","type":"post","link":"https:\/\/techshare.co.jp\/faq\/unitree\/go1_ros_lowlevel.html","title":{"rendered":"\u3010Unitree Go1\u3011\u5916\u90e8PC\u4e0a\u304b\u3089\u7121\u7dda\u3067 unitree_ros_to_real \u3092\u5b9f\u884c\u3059\u308b\uff1a\u30ed\u30fc\u30ec\u30d9\u30eb\u5236\u5fa1"},"content":{"rendered":"<h4><span style=\"color: #333333;\">1. \u306f\u3058\u3081\u306b<\/span><\/h4>\n<p>Go1\u3092ROS\u3092\u7528\u3044\u3066\u904b\u52d5\u5236\u5fa1\u3059\u308b\u305f\u3081\u306b\u3001Unitree\u793e\u306funitree_ros_to_real \u30d1\u30c3\u30b1\u30fc\u30b8\u3092\u516c\u958b\u3057\u3066\u3044\u307e\u3059\u3002<\/p>\n<p>\u672c\u7a3f\u306f\u3001<a href=\"https:\/\/techshare.co.jp\/faq\/unitree\/go1_ros_highlevel.html\" target=\"_blank\" rel=\"noopener\">\u524d\u56de\u306e\u8a18\u4e8b<\/a>\u306b\u5f15\u304d\u7d9a\u304d\u3001Go1\u306b\u7121\u7dda\u63a5\u7d9a\u3092\u3057\u3001\u5916\u90e8PC\u4e0a\u304b\u3089 unitree_ros_to_real \u306e\u30ed\u30fc\u30ec\u30d9\u30eb\u5236\u5fa1\u3092\u5b9f\u884c\u3059\u308b\u65b9\u6cd5\u3092\u3054\u6848\u5185\u3057\u307e\u3059\u3002<\/p>\n<p>Github unitree_ros_to_real: <a href=\"https:\/\/github.com\/unitreerobotics\/unitree_ros_to_real\" target=\"_blank\" rel=\"noopener\">https:\/\/github.com\/unitreerobotics\/unitree_ros_to_real<\/a><\/p>\n<p>&nbsp;<\/p>\n<h4><span style=\"color: #333333;\">2. \u74b0\u5883<\/span><\/h4>\n<p>\u4ee5\u4e0b\u306e\u74b0\u5883\u306b\u3066\u3001\u3053\u306e\u624b\u9806\u304c\u6709\u52b9\u3067\u3042\u308b\u3053\u3068\u3092\u78ba\u8a8d\u3057\u3066\u3044\u307e\u3059\u3002<\/p>\n<ul>\n<li>\u6a5f\u7a2e: R&amp;D(Edu), R&amp;D+(Edu+)<\/li>\n<li>\u5916\u90e8PC: Linux Ubuntu 20.04 (amd64)<\/li>\n<li>ROS: Noetic<\/li>\n<li>unitree_legged_sdk: v3.8.6<\/li>\n<\/ul>\n<p>&nbsp;<\/p>\n<h4><span style=\"color: #333333;\">3. \u624b\u6bb5<\/span><\/h4>\n<p>\u307e\u305a<a href=\"https:\/\/techshare.co.jp\/faq\/unitree\/go1_ros_highlevel.html\" target=\"_blank\" rel=\"noopener\">\u524d\u56de\u306e\u8a18\u4e8b<\/a>\u306b\u6cbf\u3063\u3066\u3001\u5fc5\u8981\u306b\u5fdc\u3058\u3066Go1\u306eWi-Fi\u306b\u63a5\u7d9a\u3057\u3001unitree_ros_to_real \u306e\u30d1\u30c3\u30b1\u30fc\u30b8\u3092\u30af\u30ed\u30fc\u30f3\u3057\u3066\u304f\u3060\u3055\u3044\u3002<\/p>\n<h6><span style=\"color: #333333;\">\u30cd\u30c3\u30c8\u30ef\u30fc\u30af\u8a2d\u5b9a<\/span><\/h6>\n<p><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/techshare.co.jp\/faq\/wp-content\/uploads\/2023\/07\/go1_system_architecture-1.png\" alt=\"\" width=\"659\" height=\"274\" class=\"alignnone wp-image-344732\" srcset=\"https:\/\/techshare.co.jp\/faq\/wp-content\/uploads\/2023\/07\/go1_system_architecture-1.png 976w, https:\/\/techshare.co.jp\/faq\/wp-content\/uploads\/2023\/07\/go1_system_architecture-1-300x125.png 300w, https:\/\/techshare.co.jp\/faq\/wp-content\/uploads\/2023\/07\/go1_system_architecture-1-768x319.png 768w, https:\/\/techshare.co.jp\/faq\/wp-content\/uploads\/2023\/07\/go1_system_architecture-1-481x200.png 481w, https:\/\/techshare.co.jp\/faq\/wp-content\/uploads\/2023\/07\/go1_system_architecture-1-426x177.png 426w\" sizes=\"auto, (max-width: 659px) 100vw, 659px\" \/><br \/>\n\uff08Go1\u306e\u30b7\u30b9\u30c6\u30e0\u30a2\u30fc\u30ad\u30c6\u30af\u30c1\u30e3\uff09<\/p>\n<p>Go1\u3092\u30ed\u30fc\u30ec\u30d9\u30eb\u3067\u5236\u5fa1\u3059\u308b\u3068\u304d\u306f MCU (IP: 192.168.123.10) \u3092\u4f7f\u7528\u3057\u307e\u3059\u3002\u305d\u306e\u305f\u3081\u3001\u5916\u90e8\u3068\u306e\u63a5\u7d9a\u306b\u4f7f\u3063\u3066\u3044\u308bWifi\u30e2\u30b8\u30e5\u30fc\u30eb (IP: 192.168.12.1) \u3068 MCU \u9593\u306e\u30eb\u30fc\u30c8\u3092\u78ba\u7acb\u3059\u308b\u5fc5\u8981\u304c\u3042\u308a\u307e\u3059\u3002<\/p>\n<p>(1) Raspberry Pi \u306b ssh \u3067\u30ed\u30b0\u30a4\u30f3<\/p>\n<div class=\"hcb_wrap\">\n<pre><code>$ <span>ssh pi@192.168.12.1<\/span><\/code><\/pre>\n<\/div>\n<p>(2) IP\u30d5\u30a9\u30fc\u30ef\u30fc\u30c9\u3092\u6709\u52b9\u5316<\/p>\n<p>Raspberry Pi \u3067\u306e\u30d1\u30b1\u30c3\u30c8\u306e\u8ee2\u9001\u3092\u53ef\u80fd\u306b\u3059\u308b\u305f\u3081\u306b\u3001<\/p>\n<div class=\"hcb_wrap\">\n<pre><code>$ sudo vi \/etc\/sysctl.conf<\/code><\/pre>\n<\/div>\n<p>\u3067\u30d5\u30a1\u30a4\u30eb\u3092\u958b\u304d\u3001<code>net.ipv4.ip_forward=1<\/code>\u306e\u884c\u306e\u30b3\u30e1\u30f3\u30c8\u3092\u5916\u3057\u3066\u304f\u3060\u3055\u3044\u3002<\/p>\n<p>\u30d5\u30a1\u30a4\u30eb\u3092\u4fdd\u5b58\u3057\u3066\u9589\u3058\u3001\u5909\u66f4\u3057\u305f\u8a2d\u5b9a\u3092\u30ea\u30ed\u30fc\u30c9\u3057\u307e\u3059\u3002<\/p>\n<div class=\"hcb_wrap\">\n<pre><code>$ sudo sysctl -p<\/code><\/pre>\n<\/div>\n<p>(3) iptables \u306e\u8a2d\u5b9a<\/p>\n<p>iptables \u3092\u5229\u7528\u3057\u3066\u3001\u30eb\u30fc\u30c6\u30a3\u30f3\u30b0\u3068\u30d1\u30b1\u30c3\u30c8\u30d5\u30a3\u30eb\u30bf\u30ea\u30f3\u30b0\u306e\u8a2d\u5b9a\u3092\u884c\u3044\u307e\u3059\u3002<\/p>\n<p>\u307e\u305a\u3001<span><code>filter<\/code>\u3001<code>nat<\/code> \u30c6\u30fc\u30d6\u30eb\u306e\u8a2d\u5b9a\u3092\u3059\u3079\u3066\u30af\u30ea\u30a2\u3057\u307e\u3059\u3002<\/span><\/p>\n<div class=\"hcb_wrap\">\n<pre><code>$ sudo iptables -F\r\n$ sudo iptables -t nat -F<\/code><\/pre>\n<\/div>\n<p><code>wlan1<\/code>(IP: 192.168.12.1)\u3001<code>eth0<\/code>(IP: 192.168.123.161) \u3078\u51fa\u3066\u3044\u304f\u30d1\u30b1\u30c3\u30c8\u306b\u3064\u3044\u3066IP\u30de\u30b9\u30ab\u30ec\u30fc\u30c9\u3092\u6709\u52b9\u5316\u3057\u3001IP\u30a2\u30c9\u30ec\u30b9\u30fb\u30dd\u30fc\u30c8\u756a\u53f7\u3092\u5909\u63db\u3059\u308b\u3088\u3046\u306b\u8a2d\u5b9a\u3057\u307e\u3059\u3002<\/p>\n<div class=\"hcb_wrap\">\n<pre><code>$ sudo iptables -t nat -A POSTROUTING -o wlan1 -j MASQUERADE\r\n$ sudo iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE<\/code><\/pre>\n<\/div>\n<p>Raspberry Pi \u3092\u7d4c\u7531\u3057\u305f\u30d1\u30b1\u30c3\u30c8\u306e\u8ee2\u9001\u3092 <code>wlan1<\/code>\u3068<code>eth0<\/code>\u00a0\u9593\u3067\u8a31\u53ef\u3057\u307e\u3059\u3002<\/p>\n<div class=\"hcb_wrap\">\n<pre><code>$ sudo iptables -A FORWARD -i wlan1 -o eth0 -j ACCEPT\r\n$ sudo iptables -A FORWARD -i eth0 -o wlan1 -j ACCEPT <\/code><\/pre>\n<\/div>\n<p>iptables \u306e\u8a2d\u5b9a\u306f\u3001\u5404\u30c6\u30fc\u30d6\u30eb\u306b\u3064\u3044\u3066\u4ee5\u4e0b\u306e\u30b3\u30de\u30f3\u30c9\u3067\u78ba\u8a8d\u3067\u304d\u307e\u3059\u3002<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/techshare.co.jp\/faq\/wp-content\/uploads\/2023\/07\/iptables.png\" alt=\"\" width=\"779\" height=\"631\" class=\"alignnone size-full wp-image-344733\" srcset=\"https:\/\/techshare.co.jp\/faq\/wp-content\/uploads\/2023\/07\/iptables.png 779w, https:\/\/techshare.co.jp\/faq\/wp-content\/uploads\/2023\/07\/iptables-300x243.png 300w, https:\/\/techshare.co.jp\/faq\/wp-content\/uploads\/2023\/07\/iptables-768x622.png 768w, https:\/\/techshare.co.jp\/faq\/wp-content\/uploads\/2023\/07\/iptables-247x200.png 247w, https:\/\/techshare.co.jp\/faq\/wp-content\/uploads\/2023\/07\/iptables-426x345.png 426w\" sizes=\"auto, (max-width: 779px) 100vw, 779px\" \/><\/p>\n<p>\u5916\u90e8PC\u306e\u30bf\u30fc\u30df\u30ca\u30eb\u3067 <code>ping 192.168.123.10<\/code> \u3092\u6253\u3061\u3001\u4ee5\u4e0b\u306e\u3088\u3046\u306b\u306a\u3063\u305f\u3089MCU\u306b\u901a\u4fe1\u3067\u304d\u308b\u3053\u3068\u304c\u78ba\u8a8d\u3067\u304d\u307e\u3059\u3002<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/techshare.co.jp\/faq\/wp-content\/uploads\/2023\/07\/ping_result.png\" alt=\"\" width=\"685\" height=\"144\" class=\"alignnone size-full wp-image-344734\" srcset=\"https:\/\/techshare.co.jp\/faq\/wp-content\/uploads\/2023\/07\/ping_result.png 685w, https:\/\/techshare.co.jp\/faq\/wp-content\/uploads\/2023\/07\/ping_result-300x63.png 300w, https:\/\/techshare.co.jp\/faq\/wp-content\/uploads\/2023\/07\/ping_result-426x90.png 426w\" sizes=\"auto, (max-width: 685px) 100vw, 685px\" \/><\/p>\n<p>\u5fc5\u8981\u306b\u5fdc\u3058\u3066\u3001\u5916\u90e8PC\u306e\u30c7\u30d5\u30a9\u30eb\u30c8\u30b2\u30fc\u30c8\u30a6\u30a7\u30a4\u3092<code>192.168.12.1<\/code>\u306b\u8a2d\u5b9a\u3057\u3066\u304f\u3060\u3055\u3044\u3002<\/p>\n<div class=\"hcb_wrap\">\n<pre><code>$ sudo route add default gw 192.168.12.1<\/code><\/pre>\n<\/div>\n<p>&nbsp;<\/p>\n<h6><span style=\"color: #333333;\">\u5b9f\u884c<\/span><\/h6>\n<p>(1) \u306f\u3058\u3081\u306b\u30ed\u30fc\u30f3\u30c1\u30d5\u30a1\u30a4\u30eb\u3092\u5b9f\u884c<\/p>\n<div class=\"hcb_wrap\">\n<pre><code>$ roslaunch unitree_legged_real real.launch ctrl_level:=<span style=\"color: var(--hcb-color--text,#1f1e1e); font-family: var(--hcb-font-family,'Menlo','Consolas','Hiragino Kaku Gothic ProN','Hiragino Sans','Meiryo',sans-serif); font-size: var(--hcb-font-size,14px);\">lowlevel<\/span>\r\n<\/code><\/pre>\n<\/div>\n<p>(2) \u30d7\u30ed\u30b0\u30e9\u30e0\u306e\u5b9f\u884c<\/p>\n<p>\u30ed\u30fc\u30ec\u30d9\u30eb\u5236\u5fa1\u306e\u30b5\u30f3\u30d7\u30eb\u3067\u306f\u3001\u53f3\u524d\u811a\u306e Calf \u304c\u66f2\u3052\u4f38\u3070\u3057\u3055\u308c\u308b\u306e\u304c\u78ba\u8a8d\u3067\u304d\u307e\u3059\u3002<\/p>\n<div class=\"hcb_wrap\">\n<pre><code>$ rosrun unitree_legged_real example_postion<\/code><\/pre>\n<\/div>\n<p>\u203b \u30ed\u30fc\u30ec\u30d9\u30eb\u5236\u5fa1\u3092\u3059\u308b\u969b\u306f\u3001\u30b8\u30e7\u30a4\u30b9\u30c6\u30a3\u30c3\u30af\u3067 L2+A \u3092\u62bc\u3057\u30ed\u30dc\u30c3\u30c8\u3092\u5ea7\u3089\u305b\u3001\u30cf\u30f3\u30ac\u30fc\u30ad\u30e3\u30b9\u30bf\u30fc\u3067\u30ed\u30dc\u30c3\u30c8\u3092\u540a\u308b\u3057\u3066\u304f\u3060\u3055\u3044\u3002<\/p>\n<p>&nbsp;<\/p>\n<h3>\u95a2\u9023\u8a18\u4e8b<\/h3>\n<p><a href=\"&quot;https:\/\/techshare.co.jp\/faq\/unitree\/go1_ros_highlevel.html\">\u3010Unitree Go1\u3011\u5916\u90e8PC\u4e0a\u304b\u3089\u7121\u7dda\u3067 unitree_ros_to_real \u3092\u5b9f\u884c\u3059\u308b\uff1a\u30cf\u30a4\u30ec\u30d9\u30eb\u5236\u5fa1<\/a><br \/>\n<a href=\"https:\/\/techshare.co.jp\/faq\/unitree\/go1_low_stand_up.html\">\u3010Unitree Go1\u3011Low Level\u5236\u5fa1\u306e\u6982\u8981\u306b\u3064\u3044\u3066<\/a><\/p>\n<p>&nbsp;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>1. \u306f\u3058\u3081\u306b Go1\u3092ROS\u3092\u7528\u3044\u3066\u904b\u52d5\u5236\u5fa1\u3059\u308b\u305f\u3081\u306b\u3001Unitree\u793e\u306funitree_ros_to_real \u30d1\u30c3\u30b1\u30fc\u30b8\u3092\u516c\u958b\u3057\u3066\u3044\u307e\u3059\u3002 \u672c\u7a3f\u306f\u3001\u524d\u56de\u306e\u8a18\u4e8b\u306b\u5f15\u304d\u7d9a\u304d\u3001Go1\u306b\u7121\u7dda\u63a5\u7d9a\u3092\u3057\u3001\u5916\u90e8PC\u4e0a\u304b\u3089 uni &hellip;<\/p>\n","protected":false},"author":20,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[31,26],"tags":[],"class_list":["post-344729","post","type-post","status-publish","format-standard","hentry","category-go1","category-unitree"],"_links":{"self":[{"href":"https:\/\/techshare.co.jp\/faq\/wp-json\/wp\/v2\/posts\/344729","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/techshare.co.jp\/faq\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/techshare.co.jp\/faq\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/techshare.co.jp\/faq\/wp-json\/wp\/v2\/users\/20"}],"replies":[{"embeddable":true,"href":"https:\/\/techshare.co.jp\/faq\/wp-json\/wp\/v2\/comments?post=344729"}],"version-history":[{"count":10,"href":"https:\/\/techshare.co.jp\/faq\/wp-json\/wp\/v2\/posts\/344729\/revisions"}],"predecessor-version":[{"id":344977,"href":"https:\/\/techshare.co.jp\/faq\/wp-json\/wp\/v2\/posts\/344729\/revisions\/344977"}],"wp:attachment":[{"href":"https:\/\/techshare.co.jp\/faq\/wp-json\/wp\/v2\/media?parent=344729"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/techshare.co.jp\/faq\/wp-json\/wp\/v2\/categories?post=344729"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/techshare.co.jp\/faq\/wp-json\/wp\/v2\/tags?post=344729"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}