Skip to content

Commit

Permalink
Remove semicolons
Browse files Browse the repository at this point in the history
  • Loading branch information
dhood committed Nov 17, 2017
1 parent 52dbdac commit fb69a37
Show file tree
Hide file tree
Showing 5 changed files with 21 additions and 21 deletions.
16 changes: 8 additions & 8 deletions composition/src/api_composition.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ int main(int argc, char * argv[])
if (
!ament_index_cpp::get_resource("node_plugin", request->package_name, content, &base_path))
{
RCLCPP_ERROR(node->get_name(), "Could not find requested resource in ament index");
RCLCPP_ERROR(node->get_name(), "Could not find requested resource in ament index")
response->success = false;
return;
}
Expand All @@ -98,7 +98,7 @@ int main(int argc, char * argv[])
for (auto line : lines) {
std::vector<std::string> parts = split(line, ';');
if (parts.size() != 2) {
RCLCPP_ERROR(node->get_name(), "Invalid resource entry");
RCLCPP_ERROR(node->get_name(), "Invalid resource entry")
response->success = false;
return;
}
Expand All @@ -114,23 +114,23 @@ int main(int argc, char * argv[])
if (!fs::path(library_path).is_absolute()) {
library_path = base_path + "/" + library_path;
}
RCLCPP_INFO(node->get_name(), "Load library %s", library_path.c_str());
RCLCPP_INFO(node->get_name(), "Load library %s", library_path.c_str())
class_loader::ClassLoader * loader;
try {
loader = new class_loader::ClassLoader(library_path);
} catch (const std::exception & ex) {
RCLCPP_ERROR(node->get_name(), "Failed to load library: %s", ex.what());
RCLCPP_ERROR(node->get_name(), "Failed to load library: %s", ex.what())
response->success = false;
return;
} catch (...) {
RCLCPP_ERROR(node->get_name(), "Failed to load library");
RCLCPP_ERROR(node->get_name(), "Failed to load library")
response->success = false;
return;
}
auto classes = loader->getAvailableClasses<rclcpp::Node>();
for (auto clazz : classes) {
if (clazz == class_name) {
RCLCPP_INFO(node->get_name(), "Instantiate class %s", clazz.c_str());
RCLCPP_INFO(node->get_name(), "Instantiate class %s", clazz.c_str())
auto node = loader->createInstance<rclcpp::Node>(clazz);
exec.add_node(node);
nodes.push_back(node);
Expand All @@ -145,13 +145,13 @@ int main(int argc, char * argv[])
RCLCPP_ERROR(
node->get_name(), "Failed to find class with the requested plugin name '%s' in "
"the loaded library",
request->plugin_name.c_str());
request->plugin_name.c_str())
response->success = false;
return;
}
RCLCPP_ERROR(
node->get_name(), "Failed to find plugin name '%s' in prefix '%s'",
request->plugin_name.c_str(), base_path.c_str());
request->plugin_name.c_str(), base_path.c_str())
response->success = false;
});

Expand Down
12 changes: 6 additions & 6 deletions composition/src/api_composition_cli.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -52,31 +52,31 @@ int main(int argc, char * argv[])
if (!rclcpp::ok()) {
RCLCPP_ERROR(
node->get_name(),
"Interrupted while waiting for the service. Exiting.");
"Interrupted while waiting for the service. Exiting.")
return 0;
}
RCLCPP_INFO(node->get_name(), "Service not available, waiting again...");
RCLCPP_INFO(node->get_name(), "Service not available, waiting again...")
}

auto request = std::make_shared<composition::srv::LoadNode::Request>();
request->package_name = argv[1];
request->plugin_name = argv[2];

RCLCPP_INFO(node->get_name(), "Sending request...");
RCLCPP_INFO(node->get_name(), "Sending request...")
auto result = client->async_send_request(request);
RCLCPP_INFO(node->get_name(), "Waiting for response...");
RCLCPP_INFO(node->get_name(), "Waiting for response...")
if (rclcpp::spin_until_future_complete(node, result) !=
rclcpp::executor::FutureReturnCode::SUCCESS)
{
RCLCPP_ERROR(node->get_name(), "Interrupted while waiting for response. Exiting.");
RCLCPP_ERROR(node->get_name(), "Interrupted while waiting for response. Exiting.")
if (!rclcpp::ok()) {
return 0;
}
return 1;
}
RCLCPP_INFO(
node->get_name(), "Result of load_node: success = %s",
result.get()->success ? "true" : "false");
result.get()->success ? "true" : "false")

rclcpp::shutdown();

Expand Down
6 changes: 3 additions & 3 deletions composition/src/client_component.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -60,10 +60,10 @@ void Client::on_timer()
if (!rclcpp::ok()) {
RCLCPP_ERROR(
this->get_name(),
"Interrupted while waiting for the service. Exiting.");
"Interrupted while waiting for the service. Exiting.")
return;
}
RCLCPP_INFO(this->get_name(), "Service not available after waiting");
RCLCPP_INFO(this->get_name(), "Service not available after waiting")
return;
}

Expand All @@ -84,7 +84,7 @@ void Client::on_timer()
using ServiceResponseFuture =
rclcpp::client::Client<example_interfaces::srv::AddTwoInts>::SharedFuture;
auto response_received_callback = [this](ServiceResponseFuture future) {
RCLCPP_INFO(this->get_name(), "Got result: [%" PRIu64 "]", future.get()->sum);
RCLCPP_INFO(this->get_name(), "Got result: [%" PRIu64 "]", future.get()->sum)
};
auto future_result = client_->async_send_request(request, response_received_callback);
}
Expand Down
6 changes: 3 additions & 3 deletions composition/src/dlopen_composition.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
int main(int argc, char * argv[])
{
if (argc < 2) {
fprintf(stderr, "Requires at least one argument to be passed with the library to load\n");
fprintf(stderr, "Requires at least one argument to be passed with the library to load\n")
return 1;
}
rclcpp::init(argc, argv);
Expand All @@ -37,11 +37,11 @@ int main(int argc, char * argv[])
libraries.push_back(argv[i]);
}
for (auto library : libraries) {
RCLCPP_INFO(DLOPEN_COMPOSITION_LOGGER_NAME, "Load library %s", library.c_str());
RCLCPP_INFO(DLOPEN_COMPOSITION_LOGGER_NAME, "Load library %s", library.c_str())
auto loader = new class_loader::ClassLoader(library);
auto classes = loader->getAvailableClasses<rclcpp::Node>();
for (auto clazz : classes) {
RCLCPP_INFO(DLOPEN_COMPOSITION_LOGGER_NAME, "Instantiate class %s", clazz.c_str());
RCLCPP_INFO(DLOPEN_COMPOSITION_LOGGER_NAME, "Instantiate class %s", clazz.c_str())
auto node = loader->createInstance<rclcpp::Node>(clazz);
exec.add_node(node);
nodes.push_back(node);
Expand Down
2 changes: 1 addition & 1 deletion image_tools/src/showimage.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ encoding2mat_type(const std::string & encoding)
void show_image(
const sensor_msgs::msg::Image::SharedPtr msg, bool show_camera, std::string logger_name)
{
RCLCPP_INFO(logger_name, "Received image #%s", msg->header.frame_id.c_str());
RCLCPP_INFO(logger_name, "Received image #%s", msg->header.frame_id.c_str())

if (show_camera) {
// Convert to an OpenCV matrix by assigning the data.
Expand Down

0 comments on commit fb69a37

Please sign in to comment.