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

What are the Magic numbers in the ActorPlugin? #2756

Closed
mkhansenbot opened this issue Jun 13, 2020 · 5 comments
Closed

What are the Magic numbers in the ActorPlugin? #2756

mkhansenbot opened this issue Jun 13, 2020 · 5 comments

Comments

@mkhansenbot
Copy link

I'm trying to use the actor plugin in my gazebo world, and I'm able to follow the tutorial here:
http://gazebosim.org/tutorials?tut=actor&cat=build_robot#Actors

I can put the actors in an empty world, no problem. Now I'm trying to put them in a occupied world and I can't figure out what to put for the pose and target that work? The only target value that seems to work is the one given in the example, which is also hardcoded in this line:
https:/osrf/gazebo/blob/d9f480e07b9d3216ecda294691e3d5f86547951a/plugins/ActorPlugin.cc#L89

Also, I noticed that later in the code there are some other magic numbers being used in the random target generation code:

    newTarget.X(ignition::math::Rand::DblUniform(-3, 3.5));
    newTarget.Y(ignition::math::Rand::DblUniform(-10, 2));

Please help me understand what all these numbers mean? My best guess is that the random number generator is keeping the target area bounded between (-3,-10) and (3.5, 2). If so, why? Shouldn't those be the initial pose and target pose values?

@mkhansenbot
Copy link
Author

Oh and one other thing, I noticed that for some reason when I use the ActorPlugin, the person walking is slightly above the ground in the empty world.

@chapulina
Copy link
Contributor

The short answer is that there's a lot hardcoded specifically for those demos. As we migrate things to Ignition we're making sure to remove these magic numbers.

@mkhansenbot
Copy link
Author

Thanks for the response. I'm glad to hear these will be cleaned up when moving to Ignition. Do you have any timeline for that?

@chapulina
Copy link
Contributor

Basic actor support is already available on Ignition Citadel and control from plugins is already on master, which will become Ignition Dome in September. The implementation is spread across ign-common, ign-rendering and ign-gazebo.

Here's an example of an actor plugin that was ported to Ignition and shouldn't have any magic numbers that aren't configurable: gazebosim/gz-sim#157.

@mkhansenbot
Copy link
Author

Thanks, sorry for the delayed response, I'm satisfied with this answer and closing this

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

No branches or pull requests

2 participants