{"id":16678904,"url":"https://github.com/otl/roscpp14","last_synced_at":"2025-04-09T21:53:03.566Z","repository":{"id":145693724,"uuid":"41490641","full_name":"OTL/roscpp14","owner":"OTL","description":"roscpp meets c++14 now!!","archived":false,"fork":false,"pushed_at":"2015-08-29T13:05:04.000Z","size":180,"stargazers_count":12,"open_issues_count":0,"forks_count":1,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-04-09T21:52:59.793Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"C++","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/OTL.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2015-08-27T14:13:13.000Z","updated_at":"2023-11-21T12:03:32.000Z","dependencies_parsed_at":"2023-04-06T11:30:55.234Z","dependency_job_id":null,"html_url":"https://github.com/OTL/roscpp14","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/OTL%2Froscpp14","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/OTL%2Froscpp14/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/OTL%2Froscpp14/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/OTL%2Froscpp14/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/OTL","download_url":"https://codeload.github.com/OTL/roscpp14/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248119401,"owners_count":21050754,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-10-12T13:31:56.751Z","updated_at":"2025-04-09T21:53:03.548Z","avatar_url":"https://github.com/OTL.png","language":"C++","funding_links":[],"categories":[],"sub_categories":[],"readme":"# roscpp14: ROS meets C++14!!\n\nYou can use c++14 if you use roscpp14.\n\n## Use lambda for callback function\n\n### Topic Subscriber\n\n```c++\n#include \u003croscpp14/ros.h\u003e\n#include \u003cstd_msgs/String.h\u003e\n\nint main(int argc, char **argv)\n{\n  ros::init(argc, argv, \"listener\");\n  roscpp14::NodeHandle node;\n  auto sub = node.subscribe\u003cstd_msgs::String\u003e(\"chatter\", 10,\n                                              [] (const auto \u0026msg) {\n                                                ROS_INFO(\"%s\", msg.data.c_str()); });\n  ros::spin();\n  return 0;\n}\n```\n\n### Service Server\n\n```c++\n#include \u003croscpp14/ros.h\u003e\n#include \u003cstd_srvs/Empty.h\u003e\n\nint main(int argc, char **argv) \n{\n  ros::init(argc, argv, \"service_server\");\n  roscpp14::NodeHandle node;\n  auto ser = node.advertiseService\u003cstd_srvs::Empty\u003e(\"call_me\",\n                                                    [\u0026] (auto \u0026req, auto \u0026res) {\n                                                      ROS_INFO(\"called!\");\n                                                      return true;\n                                                    });\n  ros::spin();\n  return 0;\n}\n```\n\n## Use user-defined literal for ros::Rate\n\nWhen you create a timer for 10.0[Hz], you'll write as below in roscpp.\n\n```c++\nros::Rate r(10.0);\nr.sleep();\n```\n\nYou can use 10.0_Hz like below with roscpp14 now!\n\n```c++\nusing roscpp14::operator\"\" _Hz;\n\nauto r = 10.0_Hz;\nr.sleep();\n```\n\n## C++11\n\nIf you can't use c++14 (Ubuntu14.04 default), you can write like below. (I don't like repeating the type of message in lambda, so I chose c++14 for generic lambda)\n\n```c++\n  auto sub = node.subscribe\u003cstd_msgs::String\u003e(\"chatter\", 10,\n                                              [] (const std_msgs::String \u0026msg) {\n                                                ROS_INFO(\"%s\", msg.data.c_str()); });\n```\n\n## Install\n\n### Supported Platforms\n\n* ROS\n  * Jade\n* OS\n  * OSX (10.10.x)\n  * Ubuntu15.04\n  * Ubuntu14.04 (with g++-4.9)\n\n### How to install\n\n```bash\ncd ~/catkin_ws/src\ngit clone https://github.com/OTL/roscpp14.git\n```\n\n### Ubuntu14.04\nroscpp14 uses c++14. This means it requires g++-4.9, which can not be installed by default.\nPlease install g++-4.9 using ppa, like below.\n\n```bash\nsudo add-apt-repository ppa:ubuntu-toolchain-r/test\nsudo apt-get update\nsudo apt-get install g++-4.9\n```\n\n## How to use\n\nJust add roscpp14 as dependency.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fotl%2Froscpp14","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fotl%2Froscpp14","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fotl%2Froscpp14/lists"}