meta.stackexchange.com#141944建议可以在这里询问像我这样的“AWS + 个人使用”问题,所以希望我在正确的网站上。
按照AWS Robomaker
(aws.amazon.com)的教程,在“使用 AWS RoboMaker 中的容器创建和运行机器人和模拟应用程序”部分的第 6 步中,运行以下命令失败并出现错误(已替换凭据)。
我错过了什么/错了什么?这个AWS账户我基本上是重新创建的,所以没有做太多配置。
$ aws robomaker create-simulation-job --cli-input-json file://create_simulation_job.json
An error occurred (AccessDeniedException) when calling the CreateSimulationJob operation: User: arn:aws:iam::292945459999:user/fname.lname is not authorized to perform: robomaker:CreateSimulationJob on resource: arn:aws:robomaker:us-east-1:292945459999:simulation-application/robomaker-helloworld-sim-app/1675482941456
create_simulation_job.json 的内容
(由于教程中不清楚,我猜测是从Robomaker上的robomaker-helloworld-sim-app模拟应用程序中获取“应用程序”的ARN)
"maxJobDurationInSeconds": 3600,
"iamRole": "arn:aws:iam::292945459999:role/RoboMaker-HelloWorld-Role",
"robotApplications": [
{
"application": "arn:aws:robomaker:us-east-1:292945459999:simulation-application/robomaker-helloworld-sim-app/1675482941456",
"applicationVersion": "$LATEST",
"launchConfig": {
"environmentVariables": {
"ROS_IP": "ROBOMAKER_ROBOT_APP_IP",
"ROS_MASTER_URI": "http://ROBOMAKER_ROBOT_APP_IP:11311",
"GAZEBO_MASTER_URI": "http://ROBOMAKER_SIM_APP_IP:11345"
},
"streamUI": false,
"command": [
"roslaunch", "hello_world_robot", "rotate.launch"
]
},
"tools": [
{
"streamUI": true,
"name": "robot-terminal",
"command": "/entrypoint.sh && xfce4-terminal",
"streamOutputToCloudWatch": true,
"exitBehavior": "RESTART"
}
]
}
],
"simulationApplications": [
{
"application": "arn:aws:robomaker:us-east-1:292945459999:simulation-application/robomaker-helloworld-sim-app/1675482941456",
"launchConfig": {
"environmentVariables": {
"ROS_IP": "ROBOMAKER_SIM_APP_IP",
"ROS_MASTER_URI": "http://ROBOMAKER_ROBOT_APP_IP:11311",
"GAZEBO_MASTER_URI": "http://ROBOMAKER_SIM_APP_IP:11345",
"TURTLEBOT3_MODEL":"waffle_pi"
},
"streamUI": true,
"command": [
"roslaunch", "hello_world_simulation", "empty_world.launch"
]
},
"tools": [
{
"streamUI": true,
"name": "gzclient",
"command": "/entrypoint.sh && gzclient",
"streamOutputToCloudWatch": true,
"exitBehavior": "RESTART"
}
]
}
]
}
IAM 用户具有以下权限:AdministratorAccess, AWSDeepRacerRoboMakerAccessPolicy, AWSRoboMaker_FullAccess
$ lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description: Ubuntu 20.04.5 LTS
Release: 20.04
Codename: focal
$ aws --version
aws-cli/1.27.64 Python/3.8.10 Linux/5.4.0-137-generic botocore/1.29.64
自己解决了。
我想
aws robomaker create-robot-application
我忘了在教程 (aws.amazon.com)中运行命令,因为我没有在“Robomaker -> 开发 -> 机器人应用程序”中看到机器人应用程序。所以我首先(重新)运行:然后将文件中的 ARN 替换
create_simulation_job.json
为 create-robot-application 刚刚返回的那个,运行aws robomaker create-simulation-job
命令并且这次它通过了,我在“Robomaker -> Simulation run -> Simulation jobs”上看到了一个模拟作业,正如预期的那样。在 OP 的 create_simulation_job.json 中,有一件事显然是错误的:我传递了“sim app”的 ARN,而“robot app”的 ARN 是预期的(尽管错误消息没有说清楚)。