Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
VESC motor controller driver boilerplate, no functionality yet
- Loading branch information
Michael Boulet
committed
Nov 25, 2015
0 parents
commit c271b39
Showing
14 changed files
with
302 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
# -*- mode: gitignore; -*- | ||
*~ | ||
\#*\# | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
cmake_minimum_required(VERSION 2.8.3) | ||
project(vesc) | ||
find_package(catkin REQUIRED) | ||
catkin_metapackage() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
<?xml version="1.0"?> | ||
<package> | ||
<name>vesc</name> | ||
<version>0.0.1</version> | ||
<description> | ||
Metapackage for ROS interface to the Vedder VESC open source motor controller. | ||
</description> | ||
|
||
<maintainer email="boulet@ll.mit.edu">Michael T. Boulet</maintainer> | ||
<author email="boulet@ll.mit.edu">Michael T. Boulet</author> | ||
<license>BSD</license> | ||
|
||
<url type="website">http://www.ros.org/wiki/vesc</url> | ||
<url type="repository">https://github.mit.edu/racecar/vesc</url> | ||
<url type="bugtracker">https://github.mit.edu/racecar/vesc/issues</url> | ||
|
||
<buildtool_depend>catkin</buildtool_depend> | ||
|
||
<run_depend>vesc_driver</run_depend> | ||
<run_depend>vesc_msgs</run_depend> | ||
|
||
<export> | ||
<metapackage/> | ||
</export> | ||
|
||
</package> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,60 @@ | ||
cmake_minimum_required(VERSION 2.8.3) | ||
project(vesc_driver) | ||
|
||
find_package(catkin REQUIRED COMPONENTS | ||
nodelet | ||
pluginlib | ||
roscpp | ||
vesc_msgs | ||
) | ||
|
||
catkin_package( | ||
INCLUDE_DIRS include | ||
CATKIN_DEPENDS nodelet pluginlib roscpp vesc_msgs | ||
) | ||
|
||
########### | ||
## Build ## | ||
########### | ||
|
||
include_directories( | ||
${Boost_INCLUDE_DIR} | ||
${catkin_INCLUDE_DIRS} | ||
) | ||
|
||
# node executable | ||
add_executable(vesc_driver_node src/vesc_driver_node.cpp src/vesc_driver.cpp) | ||
target_link_libraries(vesc_driver_node | ||
${catkin_LIBRARIES} | ||
) | ||
|
||
# nodelet library | ||
add_library(vesc_driver_nodelet src/vesc_driver_nodelet.cpp src/vesc_driver.cpp) | ||
target_link_libraries(vesc_driver_nodelet | ||
${catkin_LIBRARIES} | ||
) | ||
|
||
############# | ||
## Install ## | ||
############# | ||
|
||
install(TARGETS vesc_driver_node | ||
RUNTIME DESTINATION ${CATKIN_PACKAGE_BIN_DESTINATION} | ||
) | ||
|
||
install(TARGETS vesc_driver_nodelet | ||
LIBRARY DESTINATION ${CATKIN_PACKAGE_LIB_DESTINATION} | ||
) | ||
|
||
install(DIRECTORY include/${PROJECT_NAME}/ | ||
DESTINATION ${CATKIN_PACKAGE_INCLUDE_DESTINATION}) | ||
install(FILES vesc_driver_nodelet.xml | ||
DESTINATION ${CATKIN_PACKAGE_SHARE_DESTINATION}) | ||
install(DIRECTORY launch/ | ||
DESTINATION ${CATKIN_PACKAGE_SHARE_DESTINATION}/launch) | ||
|
||
############# | ||
## Testing ## | ||
############# | ||
|
||
# TODO |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
<!-- -*- mode: XML -*- --> | ||
<launch> | ||
|
||
<!-- Optionally launch in GDB, for debugging --> | ||
<arg name="debug" default="false" /> | ||
<arg if="$(arg debug)" name="launch_prefix" value="xterm -e gdb --args" /> | ||
<arg unless="$(arg debug)" name="launch_prefix" value="" /> | ||
|
||
<!-- VESC driver node --> | ||
<node pkg="vesc_driver" type="vesc_driver_node" name="vesc_driver_node" | ||
output="screen" launch-prefix="$(arg launch_prefix)" > | ||
</node> | ||
|
||
</launch> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
<!-- -*- mode: XML -*- --> | ||
<launch> | ||
|
||
<arg name="start_manager" default="true" /> | ||
<arg name="manager" default="vesc_driver_nodelet_manager" /> | ||
|
||
<!-- Optionally launch manager in GDB, for debugging --> | ||
<arg name="debug" default="false" /> | ||
<arg if="$(arg debug)" name="launch_prefix" value="xterm -e gdb --args" /> | ||
<arg unless="$(arg debug)" name="launch_prefix" value="" /> | ||
<!-- Worker threads --> | ||
<arg name="num_worker_threads" default="4" /> | ||
|
||
<!-- Also globally disable bond heartbeat timeout in debug mode, so everything | ||
doesn't die when you hit a break point --> | ||
<param if="$(arg debug)" name="/bond_disable_heartbeat_timeout" value="true" /> | ||
|
||
<!-- Nodelet manager --> | ||
<node if="$(arg start_manager)" pkg="nodelet" type="nodelet" name="$(arg manager)" | ||
args="manager" output="screen" launch-prefix="$(arg launch_prefix)"> | ||
<param name="num_worker_threads" value="$(arg num_worker_threads)" /> | ||
</node> | ||
|
||
<!-- VESC driver nodelet --> | ||
<node pkg="nodelet" type="nodelet" name="vesc_driver_nodelet" | ||
args="load vesc_driver::VescDriverNodelet $(arg manager)" > | ||
</node> | ||
|
||
</launch> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
<?xml version="1.0"?> | ||
<package> | ||
<name>vesc_driver</name> | ||
<version>0.0.1</version> | ||
<description> | ||
ROS device driver for the Vedder VESC open source motor driver. | ||
</description> | ||
|
||
<maintainer email="boulet@ll.mit.edu">Michael T. Boulet</maintainer> | ||
<author email="boulet@ll.mit.edu">Michael T. Boulet</author> | ||
<license>BSD</license> | ||
|
||
<url type="website">http://www.ros.org/wiki/vesc_driver</url> | ||
<url type="repository">https://github.mit.edu/racecar/vesc</url> | ||
<url type="bugtracker">https://github.mit.edu/racecar/vesc/issues</url> | ||
|
||
<buildtool_depend>catkin</buildtool_depend> | ||
|
||
<build_depend>nodelet</build_depend> | ||
<build_depend>pluginlib</build_depend> | ||
<build_depend>roscpp</build_depend> | ||
<build_depend>vesc_msgs</build_depend> | ||
|
||
<run_depend>nodelet</run_depend> | ||
<run_depend>pluginlib</run_depend> | ||
<run_depend>roscpp</run_depend> | ||
<run_depend>vesc_msgs</run_depend> | ||
|
||
<export> | ||
<nodelet plugin="${prefix}/vesc_driver_nodelet.xml"/> | ||
</export> | ||
|
||
</package> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
#include <ros/ros.h> | ||
|
||
#include "vesc_driver.h" | ||
|
||
namespace vesc_driver | ||
{ | ||
|
||
VescDriver::VescDriver(ros::NodeHandle nh, | ||
ros::NodeHandle private_nh) | ||
{ | ||
ROS_DEBUG("Constructing VescDriver"); | ||
} | ||
|
||
} // namespace vesc_driver |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
#ifndef VESC_DRIVER_VESC_DRIVER_H | ||
#define VESC_DRIVER_VESC_DRIVER_H | ||
|
||
#include <ros/ros.h> | ||
|
||
namespace vesc_driver | ||
{ | ||
|
||
class VescDriver | ||
{ | ||
public: | ||
|
||
VescDriver(ros::NodeHandle nh, | ||
ros::NodeHandle private_nh); | ||
|
||
private: | ||
|
||
}; | ||
|
||
} // namespace vesc_driver | ||
|
||
#endif // VESC_DRIVER_VESC_DRIVER_H |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
#include <ros/ros.h> | ||
|
||
#include "vesc_driver.h" | ||
|
||
int main(int argc, char** argv) | ||
{ | ||
ros::init(argc, argv, "vesc_driver_node"); | ||
ros::NodeHandle nh; | ||
ros::NodeHandle private_nh("~"); | ||
|
||
vesc_driver::VescDriver vesc_driver(nh, private_nh); | ||
|
||
ros::spin(); | ||
|
||
return 0; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
#include <ros/ros.h> | ||
#include <pluginlib/class_list_macros.h> | ||
#include <nodelet/nodelet.h> | ||
|
||
#include <boost/shared_ptr.hpp> | ||
|
||
#include "vesc_driver.h" | ||
|
||
namespace vesc_driver | ||
{ | ||
|
||
class VescDriverNodelet: public nodelet::Nodelet | ||
{ | ||
public: | ||
|
||
VescDriverNodelet() {} | ||
|
||
private: | ||
|
||
virtual void onInit(void); | ||
|
||
boost::shared_ptr<VescDriver> vesc_driver_; | ||
|
||
}; // class VescDriverNodelet | ||
|
||
void VescDriverNodelet::onInit() | ||
{ | ||
NODELET_DEBUG("Initializing VESC driver nodelet"); | ||
vesc_driver_.reset(new VescDriver(getNodeHandle(), getPrivateNodeHandle())); | ||
} | ||
|
||
} // namespace vesc_driver | ||
|
||
PLUGINLIB_EXPORT_CLASS(vesc_driver::VescDriverNodelet, nodelet::Nodelet); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
<library path="lib/libvesc_driver_nodelet"> | ||
<class type="vesc_driver::VescDriverNodelet" base_class_type="nodelet::Nodelet"> | ||
<description>Vedder VESC motor controller interface nodelet.</description> | ||
</class> | ||
</library> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
cmake_minimum_required(VERSION 2.8.3) | ||
project(vesc_msgs) | ||
|
||
find_package(catkin REQUIRED COMPONENTS | ||
message_generation | ||
) | ||
|
||
add_message_files( | ||
DIRECTORY msg | ||
FILES | ||
) | ||
generate_messages( | ||
DEPENDENCIES | ||
) | ||
|
||
catkin_package( | ||
CATKIN_DEPENDS message_runtime | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
<?xml version="1.0"?> | ||
<package> | ||
<name>vesc_msgs</name> | ||
<version>0.0.1</version> | ||
<description> | ||
ROS message definitions for the Vedder VESC open source motor controller. | ||
</description> | ||
|
||
<maintainer email="boulet@ll.mit.edu">Michael T. Boulet</maintainer> | ||
<author email="boulet@ll.mit.edu">Michael T. Boulet</author> | ||
<license>BSD</license> | ||
|
||
<url type="website">http://ros.org/wiki/vesc_msgs</url> | ||
<url type="repository">https://github.mit.edu/racecar/vesc</url> | ||
<url type="bugtracker">https://github.mit.edu/racecar/vesc/issues</url> | ||
|
||
<buildtool_depend>catkin</buildtool_depend> | ||
|
||
<build_depend>message_generation</build_depend> | ||
|
||
<run_depend>message_runtime</run_depend> | ||
|
||
</package> |