{"action":"created","issue":{"url":"https://api.github.com/repos/ros2/design/issues/56","labels_url":"https://api.github.com/repos/ros2/design/issues/56/labels{/name}","comments_url":"https://api.github.com/repos/ros2/design/issues/56/comments","events_url":"https://api.github.com/repos/ros2/design/issues/56/events","html_url":"https://github.com/ros2/design/issues/56","id":100899698,"number":56,"title":"Ideas for changes to the migration guide","user":{"login":"wjwwood","id":100427,"avatar_url":"https://avatars.githubusercontent.com/u/100427?v=3","gravatar_id":"","url":"https://api.github.com/users/wjwwood","html_url":"https://github.com/wjwwood","followers_url":"https://api.github.com/users/wjwwood/followers","following_url":"https://api.github.com/users/wjwwood/following{/other_user}","gists_url":"https://api.github.com/users/wjwwood/gists{/gist_id}","starred_url":"https://api.github.com/users/wjwwood/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/wjwwood/subscriptions","organizations_url":"https://api.github.com/users/wjwwood/orgs","repos_url":"https://api.github.com/users/wjwwood/repos","events_url":"https://api.github.com/users/wjwwood/events{/privacy}","received_events_url":"https://api.github.com/users/wjwwood/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":4,"created_at":"2015-08-14T00:19:33Z","updated_at":"2015-08-17T22:40:10Z","closed_at":null,"body":"So I have some ideas for changes which would be reflected in the migration guide and would make it easier to translate between ROS API's. I wanted to get feedback on them before opening a pull request for each:\r\n\r\n----\r\n\r\n- Provide a version of `create_publisher` (and others) which take `queue_size` instead of a QoS struct.\r\n\r\nInternally this function would get the default QoS struct, change the queue_size, and then call the current methods.\r\n\r\nExample of how the migration guide would then look:\r\n\r\n```c++\r\n//  ros::Publisher chatter_pub = n.advertise<std_msgs::String>(\"chatter\", 1000);\r\n//  ros::Rate loop_rate(10);\r\n  auto chatter_pub = node->create_publisher<std_msgs::msg::String>(\"chatter\", 1000);\r\n  rclcpp::rate::Rate loop_rate(10);\r\n```\r\n\r\n----\r\n\r\n- Use `advertise` instead of `create_publisher` and `subscribe` instead of `create_subscription`.\r\n\r\nI'm sort of agnostic about this, but it might help conceptually in the transition.\r\n\r\nExample:\r\n\r\n```c++\r\n//  ros::Publisher chatter_pub = n.advertise<std_msgs::String>(\"chatter\", 1000);\r\n//  ros::Rate loop_rate(10);\r\n  auto chatter_pub = node->advertise<std_msgs::msg::String>(\"chatter\", 1000);\r\n  rclcpp::rate::Rate loop_rate(10);\r\n```\r\n\r\nWe could also provide an alias from one to the other, but then we make the API bigger, so maybe not.\r\n\r\nA little rational for the new name is that in C we need a `create`/`destroy` pair, and `create_publiser`/`destroy_publisher` made more sense than `advertise`/`destroy_publisher`.\r\nUsing the same name in C++ was just for consistency.\r\n\r\n----\r\n\r\n- Provide versions of publish and signatures of callbacks which take const references rather than smart pointers.\r\n\r\nThis would be in addition to what's there, it would affect the guide as such:\r\n\r\n```c++\r\n//  std_msgs::String msg;\r\n  std_msgs::msg::String msg;\r\n```\r\n\r\n```c++\r\n//    msg.data = ss.str();\r\n    msg.data = ss.str();\r\n```\r\n\r\n```c++\r\n//    ROS_INFO(\"%s\", msg.data.c_str());\r\n    printf(\"%s\\n\", msg.data.c_str());\r\n```"},"comment":{"url":"https://api.github.com/repos/ros2/design/issues/comments/131984205","html_url":"https://github.com/ros2/design/issues/56#issuecomment-131984205","issue_url":"https://api.github.com/repos/ros2/design/issues/56","id":131984205,"user":{"login":"wjwwood","id":100427,"avatar_url":"https://avatars.githubusercontent.com/u/100427?v=3","gravatar_id":"","url":"https://api.github.com/users/wjwwood","html_url":"https://github.com/wjwwood","followers_url":"https://api.github.com/users/wjwwood/followers","following_url":"https://api.github.com/users/wjwwood/following{/other_user}","gists_url":"https://api.github.com/users/wjwwood/gists{/gist_id}","starred_url":"https://api.github.com/users/wjwwood/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/wjwwood/subscriptions","organizations_url":"https://api.github.com/users/wjwwood/orgs","repos_url":"https://api.github.com/users/wjwwood/repos","events_url":"https://api.github.com/users/wjwwood/events{/privacy}","received_events_url":"https://api.github.com/users/wjwwood/received_events","type":"User","site_admin":false},"created_at":"2015-08-17T22:40:10Z","updated_at":"2015-08-17T22:40:10Z","body":"> I would suggest we provide the aliased functions in a backwards compatibility header which can be planned to be deprecated in the future.\r\n\r\nUnfortunately, the \"aliases\" in question are methods, so you cannot conditionally include them without having a subclass of Node and having the user use that subclass instead."}}