-
Notifications
You must be signed in to change notification settings - Fork 50
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Added ability to change rate. - Added ability to disable NED to ENU conversion. - Created parameters for co-variance. - Updated to Package format 2. - Applied ROS lint changes. - Switched to private node handle for parameters.
- Loading branch information
1 parent
fa22000
commit 9cbf481
Showing
10 changed files
with
569 additions
and
508 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
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 |
---|---|---|
|
@@ -16,7 +16,7 @@ | |
* * Neither the name of Clearpath Robotics, Inc. nor the | ||
* names of its contributors may be used to endorse or promote products | ||
* derived from this software without specific prior written permission. | ||
* | ||
* | ||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND | ||
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED | ||
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE | ||
|
@@ -27,22 +27,24 @@ | |
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | ||
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS | ||
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | ||
* | ||
* Please send comments, questions, or patches to [email protected] | ||
* | ||
* Please send comments, questions, or patches to [email protected] | ||
* | ||
*/ | ||
|
||
#ifndef INCLUDE_UM7_COMMS_H_ | ||
#define INCLUDE_UM7_COMMS_H_ | ||
#ifndef UM7_COMMS_H_ | ||
#define UM7_COMMS_H_ | ||
|
||
#include <stdint.h> | ||
#include <string> | ||
|
||
namespace serial { | ||
class Serial; | ||
namespace serial | ||
{ | ||
class Serial; | ||
} | ||
|
||
namespace um7 { | ||
namespace um7 | ||
{ | ||
|
||
class SerialTimeout : public std::exception {}; | ||
|
||
|
@@ -51,37 +53,39 @@ class BadChecksum : public std::exception {}; | |
class Registers; | ||
class Accessor_; | ||
|
||
class Comms { | ||
public: | ||
explicit Comms(serial::Serial* s) : serial_(s), first_spin_(true) { | ||
} | ||
class Comms | ||
{ | ||
public: | ||
explicit Comms(serial::Serial* s) : serial_(s), first_spin_(true) | ||
{ | ||
} | ||
|
||
/** | ||
* Returns -1 if the serial port timed out before receiving a packet | ||
* successfully, or if there was a bad checksum or any other error. | ||
* Otherwise, returns the 8-bit register number of the successfully | ||
* returned packet. | ||
*/ | ||
int16_t receive(Registers* r); | ||
/** | ||
* Returns -1 if the serial port timed out before receiving a packet | ||
* successfully, or if there was a bad checksum or any other error. | ||
* Otherwise, returns the 8-bit register number of the successfully | ||
* returned packet. | ||
*/ | ||
int16_t receive(Registers* r); | ||
|
||
void send(const Accessor_& a) const; | ||
void send(const Accessor_& a) const; | ||
|
||
bool sendWaitAck(const Accessor_& a); | ||
bool sendWaitAck(const Accessor_& a); | ||
|
||
static const uint8_t PACKET_HAS_DATA; | ||
static const uint8_t PACKET_IS_BATCH; | ||
static const uint8_t PACKET_BATCH_LENGTH_MASK; | ||
static const uint8_t PACKET_BATCH_LENGTH_OFFSET; | ||
static const uint8_t PACKET_HAS_DATA; | ||
static const uint8_t PACKET_IS_BATCH; | ||
static const uint8_t PACKET_BATCH_LENGTH_MASK; | ||
static const uint8_t PACKET_BATCH_LENGTH_OFFSET; | ||
|
||
static std::string checksum(const std::string& s); | ||
static std::string checksum(const std::string& s); | ||
|
||
static std::string message(uint8_t address, std::string data); | ||
static std::string message(uint8_t address, std::string data); | ||
|
||
private: | ||
bool first_spin_; | ||
serial::Serial* serial_; | ||
private: | ||
bool first_spin_; | ||
serial::Serial* serial_; | ||
}; | ||
} | ||
} // namespace um7 | ||
|
||
#endif // INCLUDE_UM7_COMMS_H_ | ||
#endif // UM7_COMMS_H | ||
|
Oops, something went wrong.