Policies needed for creating and writing files in simulation application

0

Hi,

I've been able to build, bundle and launch simulations, but now I'm trying to write a file (CSV) with my simulation application.

In my simulation application the robot does some tasks, and when it completes a task, its speed, task time, task success etc. gets logged into a CSV file by a ROS node. Then, I have another ROS node that uploads that log to my S3 bucket.

However, the node wasn't able to create a file. I looked at the location using the Terminal application and the file doesn't exist. Furthermore at the beginning of the simulation log this appeared:

WARNING: Could not change permissions for folder [/home/robomaker/.ros/log/5670f31c-4309-11ea-a51d-0242a9fe0103], make sure that the parent folder has correct permissions.

which led me to think my IAM Role doesn't have sufficient permission to write in the EC2 instance of the simulation application.

The IAM role I used for launching the sim app has the following policies:
AmazonEC2FullAccess
AmazonS3FullAccess
AWSRoboMakerFullAccess
AWSRoboMakerServiceRolePolicy
AWSCloud9Administrator
CloudWatchLogsFullAccess

My question is, what other policies do I need in order to create and write files in the simulation application instance?

已提問 4 年前檢視次數 214 次
1 個回答
0
已接受的答案

Hi khaiyichin,

Your IAM policies do not affect the ability for your application to write to disk. The /home/robomaker folder is your best bet for writing files and you should have permissions to write there. You could then upload them to S3 via boto3 or the awscli installed into your bundle.

Your error message, is a red herring in regards to write permissions. The user your code is running as has permissions to the folders, the error message in question is thrown because the user cannot chown the folder to match its parent: https://github.com/ros/ros_comm/blob/796ef0cbdc78d04938be0af96b1512f8b1803d25/tools/rosgraph/src/rosgraph/roslogging.py#L196

The terminal application is running on a separate filesystem than the simulation/robot applications, this means you will not be able to see the files created by those applications from the terminal GUI.

Regards,
Matt

AWS
已回答 4 年前

您尚未登入。 登入 去張貼答案。

一個好的回答可以清楚地回答問題並提供建設性的意見回饋,同時有助於提問者的專業成長。

回答問題指南