osrf / rosbook

Example code to accompany the book Programming Robots with ROS
Apache License 2.0
476 stars 237 forks source link

Chapter 21: src/code/cpp example code has errors #46

Closed kyletpugh closed 5 years ago

kyletpugh commented 5 years ago

Chapter 21 provides sample c++ code (code/cpp in this repo) that cannot be built because it has errors. service_client.cpp has an error redefining argv when it should just be passed. service_server.cpp also does the same thing but with argc and argv, also this code does not declare l or count as integers before using them. Actions for c++ are not covered in the book at all, and it is not clear that Action is appended to the generated header include file. Finally, action_server.cpp does not declare the SimpleActionServer correctly so it does not compile, it needs to at least provide some parameters. The lines following should not include Action in the class names, as those are the wrapper classes for publishing.

codebot commented 5 years ago

fixed in 2ac7cd2d4acbadb54ffa6cd3d1d5f096021918b9