最終更新:ID:HukTMs0QQA 2017年02月19日(日) 19:18:26履歴
途中
- ALNavigationProxy::explore
- ALNavigationProxy::stopExploration
- ALNavigationProxy::saveExploration
- ALNavigationProxy::getMetricalMap
- ALNavigationProxy::navigateToInMap
- ALNavigationProxy::getRobotPositionInMap
- ALNavigationProxy::loadExploration
- ALNavigationProxy::relocalizeInMap
- ALNavigationProxy::startLocalization
- ALNavigationProxy::stopLocalization
qi::Future<int> ALNavigationProxy::explore(float radius)
⚠️ | 注意 これはまだ進行中の作業であり、今後APIが変更される可能性があります。 |
パラメータ: radius – メートル単位で探索する距離
返り値: 探索の最終状態に対応したエラーコードを保持しているfuture
void ALNavigationProxy::stopExploration()
⚠️ | 注意 これはまだ進行中の作業であり、今後APIが変更される可能性があります。 |
std::string ALNavigationProxy::saveExploration()
⚠️ | 注意 これはまだ進行中の作業であり、今後APIが変更される可能性があります。 |
返り値: 作成された.exploファイルのパスを示す文字列
ALValue ALNavigationProxy::getMetricalMap()
⚠️ | 注意 これはまだ進行中の作業であり、今後APIが変更される可能性があります。 |
ここで:
- mppはマップの解像度で、1ピクセルあたりのメートル数です。
- widthとheightはイメージのサイズをピクセル単位で表したもので、
- originOffsetは、マップの画素(0,0)のメトリックオフセットであり、
- [p Value、...]は、0(占有領域)から100(空き領域)の間のピクセル浮動小数点値のバッファです。
返り値: 説明されているようにフォーマットされたマップを含むALValue
qi::Future<int> ALNavigationProxy::navigateToInMap(const std::vector<float>& target)
⚠️ | 注意 これはまだ進行中の作業であり、今後APIが変更される可能性があります。 |
探索が読み込まれていない場合、または局在化が実行されていない場合はスローされます。
注意: 今のところ、Pepperは最後のthetaターゲットを使用せず、XY位置のみを使用します。最終的には、目的の角度のALMotion.moveToを使用できます。
パラメータ: target –探索されたマップフレームターゲットの [x, y, theta]
Returns: 実行のステータスを表すエラーコードを保持しているfuture
ALValue ALNavigationProxy::getRobotPositionInMap()
⚠️ | 注意 これはまだ進行中の作業であり、今後APIが変更される可能性があります。 |
結果は次のように書式設定されます。
探索が読み込まれていない場合、または局在化が実行されていない場合はスローされます。
戻り値: 説明されているようにフォーマットされた、局在化されたポーズを含むALValue
qi::Future<bool> ALNavigationProxy::loadExploration(std::string path)
⚠️ | 注意 これはまだ進行中の作業であり、今後APIが変更される可能性があります。 |
戻り値: 探査読み込みの成功を保持するfuture
qi::Future<ALValue> ALNavigationProxy::relocalizeInMap(const std::vector<float>& estimation)
⚠️ | 注意 これはまだ進行中の作業であり、今後APIが変更される可能性があります。 |
探査が読み込まれていない場合はスローされます。
パラメータ: estimation – 地図フレーム内のロボットの推定姿勢の[x, y, theta]
返り値: 次のようにフォーマットされた結果の、局在化されたポーズを保持するfuture
void ALNavigationProxy::startLocalization()
⚠️ | 注意 これはまだ進行中の作業であり、今後APIが変更される可能性があります。 |
探査が読み込まれていない場合はスローされます。
void ALNavigationProxy::stopLocalization()
⚠️ | 注意 これはまだ進行中の作業であり、今後APIが変更される可能性があります。 |
[Pose, Uncertainty]
ここで:
- Pose ローカライザによって計算される位置[X, Y, theta]
- Uncertainty 局在化されたポーズの不確実性楕円を定義するパラメータ[radiusX、radiusY、orientation]を持つ楕円
explore.py
#! /usr/bin/env python # -*- encoding: UTF-8 -*- """Example: Use localization methods""" import qi import argparse import sys def main(session, exploration_file): """ This example uses localization methods. """ # Get the services ALNavigation and ALMotion. navigation_service = session.service("ALNavigation") motion_service = session.service("ALMotion") # Wake up robot motion_service.wakeUp() # Load a previously saved exploration navigation_service.loadExploration(exploration_file) # Relocalize the robot and start the localization process. guess = [0., 0.] # assuming the robot is not far from the place where # he started the loaded exploration. navigation_service.relocalizeInMap(guess) navigation_service.startLocalization() # Navigate to another place in the map navigation_service.navigateToInMap([2., 0., 0.]) # Check where the robot arrived print "I reached: " + str(navigation_service.getRobotPositionInMap()[0]) # Stop localization navigation_service.stopLocalization() if __name__ == "__main__": parser = argparse.ArgumentParser() parser.add_argument("--ip", type=str, default="127.0.0.1", help="Robot IP address. On robot or Local Naoqi: use '127.0.0.1'.") parser.add_argument("--port", type=int, default=9559, help="Naoqi port number") parser.add_argument("--explo", type=str, help="Path to .explo file.") args = parser.parse_args() session = qi.Session() try: session.connect("tcp://" + args.ip + ":" + str(args.port)) except RuntimeError: print ("Can't connect to Naoqi at ip \"" + args.ip + "\" on port " + str(args.port) +".\n" "Please check your script arguments. Run with -h option for help.") sys.exit(1) main(session, args.explo)
コメントをかく