Skip to content

Instantly share code, notes, and snippets.

@alifahrri
Created November 11, 2018 14:38
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save alifahrri/1c1c74f9dae44471bad5e9543af033d2 to your computer and use it in GitHub Desktop.
Save alifahrri/1c1c74f9dae44471bad5e9543af033d2 to your computer and use it in GitHub Desktop.
cheatsheet for roscpp

yaml

XmlRpc::XmlRpcValue my_list;
nh.getParam("my_list", my_list);
ROS_ASSERT(my_list.getType() == XmlRpc::XmlRpcValue::TypeArray);

for (int32_t i = 0; i < my_list.size(); ++i) 
{
  ROS_ASSERT(my_list[i].getType() == XmlRpc::XmlRpcValue::TypeDouble);
  sum += static_cast<double>(my_list[i]);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment