-
Notifications
You must be signed in to change notification settings - Fork 140
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
Added support for using ROS parameters to spawn entities in Gazebo using ros_gz_sim::create #465
Conversation
* Add harmonic CI (gazebosim#447) * Add harmonic CI Signed-off-by: Michael Carroll <[email protected]> * Include garden options Signed-off-by: Michael Carroll <[email protected]> * Add harmonic stanza Signed-off-by: Michael Carroll <[email protected]> * Additional message headers Signed-off-by: Michael Carroll <[email protected]> --------- Signed-off-by: Michael Carroll <[email protected]> * Use stable osrf repo for Garden and stable+prerelease for Harmonic (gazebosim#448) Harmonic is now in the prerelease repository Signed-off-by: Jose Luis Rivero <[email protected]> * Add additional cmake/package.xml changes * Update headers * Update namespaces * Add ci for harmonic/humble * Update readme --------- Signed-off-by: Michael Carroll <[email protected]> Signed-off-by: Jose Luis Rivero <[email protected]> Signed-off-by: Addisu Z. Taddese <[email protected]> Co-authored-by: Michael Carroll <[email protected]> Co-authored-by: Jose Luis Rivero <[email protected]> Signed-off-by: Ayush1285 <[email protected]>
Signed-off-by: Ayush1285 <[email protected]>
Signed-off-by: Ayush1285 <[email protected]>
Signed-off-by: Ayush Singh <[email protected]>
Signed-off-by: Ayush1285 <[email protected]>
@ahcorde can you please review it for approval? |
Signed-off-by: Ayush1285 <[email protected]>
@ahcorde approval required for the workflow, can you please look into it? |
Thanks for the contribution, @Ayush1285! Is this a duplicate of #463? |
Just checked the other PR. I guess we both created PRs parallelly for the same issue. |
@Ayush1285 , I've closed the other PR. Let's iterate on this one and get it merged. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
do you mind to target rolling
? then we can backport the changes to humble
and iron
.
const std::string & topic_name, const rclcpp::Node::SharedPtr ros2_node, | ||
gz::msgs::EntityFactory & req) | ||
{ | ||
const auto timeout = std::chrono::seconds(1); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
include <chrono>
, <future>
, <functional>
} | ||
|
||
|
||
int main(int _argc, char ** _argv) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
} | |
int main(int _argc, char ** _argv) | |
} | |
int main(int _argc, char ** _argv) |
@@ -59,8 +99,24 @@ int main(int _argc, char ** _argv) | |||
[-R ROLL] [-P PITCH] [-Y YAW])"); | |||
gflags::ParseCommandLineFlags(&_argc, &_argv, true); | |||
|
|||
// Declare ROS Parameters to be passed from Launch file |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
// Declare ROS Parameters to be passed from Launch file | |
// Declare ROS 2 parameters to be passed from launch file |
arguments=[ | ||
'-name', 'my_custom_model', | ||
'-x', '1.2', | ||
'-y', '3.3', | ||
'-z', '2.4' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
these arguments are parameters now, aren't they ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
these arguments are parameters now, aren't they ?
Yes, I'll move them to parameters.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Remove gflags on rolling too
Why are we removing gflags? Wouldn't this break a lot of launch files already out there? |
maybe add a warning |
Yes, I've created a new PR #475 for rolling. |
I will close this PR in favour of this PR on rolling |
🎉 New feature
Closes #459
Summary
Added ROS parameters support in ros_gz_sim::create node, while preserving the existing behavior. ROS parameters will be checked first, if not found then will revert back to Gflags arguments.
Test it
Launch the demo launch file from the ros_gz_sim_demos package.
ros2 launch ros_gz_sim_demos robot_description_publisher.launch.py
Checklist
codecheck
passed (See contributing)Note to maintainers: Remember to use Squash-Merge and edit the commit message to match the pull request summary while retaining
Signed-off-by
messages.