diff --git a/README.md b/README.md index badfb1a..c4e0b1c 100644 --- a/README.md +++ b/README.md @@ -51,14 +51,13 @@ Note, the examples found in the "examples" directory are built with the library. cmake .. make -j -#### catkin #### +#### colcon #### mkdir -p create_ws/src - cd create_ws - catkin init - cd src + cd create_ws/src git clone https://github.com/AutonomyLab/libcreate.git - catkin build + cd .. + colcon build ## Running Tests ## diff --git a/include/create/serial.h b/include/create/serial.h index 9dd9bc3..28b5f69 100644 --- a/include/create/serial.h +++ b/include/create/serial.h @@ -40,13 +40,14 @@ POSSIBILITY OF SUCH DAMAGE. #include #include #include +#include #include "create/data.h" #include "create/types.h" #include "create/util.h" namespace create { - class Serial { + class Serial : public boost::enable_shared_from_this { protected: boost::asio::io_service io; diff --git a/package.xml b/package.xml index 7c3e2a9..cdfe8df 100644 --- a/package.xml +++ b/package.xml @@ -1,10 +1,11 @@ - + libcreate - 1.6.1 + 2.0.0 C++ library for interfacing with iRobot's Create 1 and Create 2 Jacob Perron + Yutaka Kondo BSD @@ -14,17 +15,15 @@ Jacob Perron - cmake + ament_cmake boost - catkin - doxygen gtest - cmake + ament_cmake diff --git a/src/serial.cpp b/src/serial.cpp index 3894b9e..12876aa 100644 --- a/src/serial.cpp +++ b/src/serial.cpp @@ -72,7 +72,7 @@ namespace create { // Start continuously reading one byte at a time boost::asio::async_read(port, boost::asio::buffer(&byteRead, 1), - boost::bind(&Serial::onData, this, _1, _2)); + boost::bind(&Serial::onData, shared_from_this(), _1, _2)); ioThread = boost::thread(boost::bind(&boost::asio::io_service::run, &io)); @@ -145,7 +145,7 @@ namespace create { // Read the next byte boost::asio::async_read(port, boost::asio::buffer(&byteRead, 1), - boost::bind(&Serial::onData, this, _1, _2)); + boost::bind(&Serial::onData, shared_from_this(), _1, _2)); } bool Serial::send(const uint8_t* bytes, unsigned int numBytes) {