Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix warnings and package dependencies #14

Open
wants to merge 2 commits into
base: indigo-devel
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion roboteq_driver/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
cmake_minimum_required(VERSION 2.8.3)
project(roboteq_driver)

find_package(catkin REQUIRED COMPONENTS roboteq_msgs roscpp serial)
find_package(catkin REQUIRED COMPONENTS roscpp serial message_generation std_msgs roboteq_msgs)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why are these necessary here? This package doesn't generate any messages, and roboteq_msgs contains the dependency on the std_msgs.


catkin_package()

Expand Down
9 changes: 7 additions & 2 deletions roboteq_driver/package.xml
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,17 @@
<license>BSD</license>

<buildtool_depend>catkin</buildtool_depend>
<build_depend>roboteq_msgs</build_depend>
<build_depend>message_generation</build_depend>
<build_depend>std_msgs</build_depend>
<build_depend>roscpp</build_depend>
<build_depend>serial</build_depend>
<run_depend>roboteq_msgs</run_depend>
<build_depend>roboteq_msgs</build_depend>
<run_depend>message_generation</run_depend>
<run_depend>std_msgs</run_depend>
<run_depend>message_runtime</run_depend>
<run_depend>roscpp</run_depend>
<run_depend>serial</run_depend>
<run_depend>roboteq_msgs</run_depend>

<export>
</export>
Expand Down
1 change: 1 addition & 0 deletions roboteq_driver/src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ add_executable(${PROJECT_NAME}_node driver controller channel)
add_dependencies(${PROJECT_NAME}_node ${PROJECT_NAME}_script roboteq_msgs_generate_messages_cpp)
target_link_libraries(${PROJECT_NAME}_node ${PROJECT_NAME}_script ${catkin_LIBRARIES})
set_target_properties(${PROJECT_NAME}_node PROPERTIES OUTPUT_NAME driver_node PREFIX "")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Wextra -Wno-unused-parameter")
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would prefer set_directory_properties, see:

https://github.com/ros/ros_comm/search?q=set_directory_properties&type=Code

Otherwise this all LGTM.


# Mark executables and/or libraries for installation
install(TARGETS ${PROJECT_NAME}_node
Expand Down
2 changes: 1 addition & 1 deletion roboteq_driver/src/channel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
namespace roboteq {

Channel::Channel(int channel_num, std::string ns, Controller* controller) :
channel_num_(channel_num), nh_(ns), controller_(controller), max_rpm_(3500),
nh_(ns), controller_(controller), channel_num_(channel_num), max_rpm_(3500),
last_mode_(255)
{
sub_cmd_ = nh_.subscribe("cmd", 1, &Channel::cmdCallback, this);
Expand Down
6 changes: 3 additions & 3 deletions roboteq_driver/src/controller.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,8 @@ const std::string eol("\r");
const size_t max_line_length(128);

Controller::Controller(const char *port, int baud)
: nh_("~"), port_(port), baud_(baud), connected_(false), receiving_script_messages_(false),
version_(""), start_script_attempts_(0), serial_(NULL),
: port_(port), baud_(baud), connected_(false), receiving_script_messages_(false),
version_(""), serial_(NULL), nh_("~"), start_script_attempts_(0),
command("!", this), query("?", this), param("^", this)
{
pub_status_ = nh_.advertise<roboteq_msgs::Status>("status", 1);
Expand Down Expand Up @@ -198,7 +198,7 @@ void Controller::processFeedback(std::string msg) {
ROS_WARN("Failure parsing feedback channel number. Dropping message.");
return;
}
if (channel_num >= 1 && channel_num <= channels_.size()) {
if (channel_num >= 1 && channel_num <= (int)channels_.size()) {
channels_[channel_num - 1]->feedbackCallback(fields);
} else {
ROS_WARN("Bad channel number. Dropping message.");
Expand Down