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?

asked 4 years ago196 views
1 Answer
0
Accepted Answer

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
answered 4 years ago

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.

Guidelines for Answering Questions