Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Spawn vehicles via rpc #1937

Closed

Conversation

KerryMoffittRtn
Copy link
Contributor

No description provided.

@madratman madratman requested a review from msb336 August 21, 2019 07:27
@hos-b
Copy link

hos-b commented Nov 21, 2019

@KerryMoffittRtn Hi. Since apparently this PR is not getting merged, could you help me with my problem ?
I'm trying to add some cars on the fly but I get the following error :
rpclib: function 'enableApiControl' (called with 2 arg(s)) threw an exception. The exception contained this information: Vehicle API for 'agent-0' is not available. This could either because this is simulation-only API or this vehicle does not exist.
If I don't use enableApiControl, I won't get an error but it also won't spawn anything. I get the same error when I run HelloSpawnedDrones.

Thanks

@@ -80,6 +80,8 @@ class RpcLibClientBase {
vector<ImageCaptureBase::ImageResponse> simGetImages(vector<ImageCaptureBase::ImageRequest> request, const std::string& vehicle_name = "");
vector<uint8_t> simGetImage(const std::string& camera_name, ImageCaptureBase::ImageType type, const std::string& vehicle_name = "");

bool simAddVehicle(const std::string& vehicle_name, const std::string& vehicle_type, const std::string& pawn_path, float north, float east, float down);
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

client.simAddVehicle("My", "simpleflight", "", 0, 0, 0);
client.enableApiControl(true, "My");
client.armDisarm(true, "My");
client.takeoffAsync(1.0, "My")->waitOnLastTask();
client.moveToPositionAsync(10, 10, -10, 10, 10, DrivetrainType::ForwardOnly, YawMode(false, 0.0), -1.0, 1.0, "My")->waitOnLastTask();
Don't know why these commands go wrong

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The error message looks like this:
LogTemp: Error: Exception occurred while updating world: PositionController does not support yaw axis i.e. 3
LogTemp: Error: Exception occurred while updating world: reset() must be called first before update()
LogTemp: Error: Exception occurred while updating world: reset() must be called first before update()
LogTemp: Error: Exception occurred while updating world: reset() must be called first before update()

@rajat2004
Copy link
Contributor

@KerryMoffittRtn Thanks for this! It's a very interesting PR, I've opened a new PR #2390 which is rebased on master, will be adding some more things on that

@madratman
Copy link
Contributor

Closing this in favor of #2390
I am slightly wary of this feature, and I am not sure how many people actually want it.
Spawning pure physics bodies at run time could be interesting in case of RL algorithms in the context of (dynamic) obstacle avoidance (a la papers throwing objects at robots learning to walk in sim.).

@madratman madratman closed this Mar 24, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants