epos reference

48
EPOS 0.3 Generated by Doxygen 1.6.3 Fri Oct 21 00:57:35 2011

Upload: -

Post on 04-Apr-2018

241 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Epos Reference

7/29/2019 Epos Reference

http://slidepdf.com/reader/full/epos-reference 1/48

EPOS

0.3

Generated by Doxygen 1.6.3

Fri Oct 21 00:57:35 2011

Page 2: Epos Reference

7/29/2019 Epos Reference

http://slidepdf.com/reader/full/epos-reference 2/48

Page 3: Epos Reference

7/29/2019 Epos Reference

http://slidepdf.com/reader/full/epos-reference 3/48

Contents

1 Namespace Index 1

1.1 Namespace List . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1

2 Class Index 3

2.1 Class Hierarchy . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3

3 Class Index 5

3.1 Class List . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5

4 File Index 7

4.1 File List . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7

5 Namespace Documentation 9

5.1 epos Namespace Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9

5.1.1 Typedef Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9

5.1.1.1 Byte . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9

5.1.1.2 DWord . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9

5.1.1.3 Word . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10

5.1.2 Enumeration Type Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . 10

5.1.2.1 CommandStatus . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10

6 Class Documentation 11

6.1 AbstractEposGateway Class Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11

6.1.1 Detailed Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11

6.1.2 Member Function Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . 12

6.1.2.1 readObject . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12

6.1.2.2 readObject . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12

6.1.2.3 readObject . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12

6.1.2.4 sendFrame . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12

6.1.2.5 writeObject . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13

Page 4: Epos Reference

7/29/2019 Epos Reference

http://slidepdf.com/reader/full/epos-reference 4/48

ii CONTENTS

6.1.2.6 writeObject . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13

6.1.2.7 writeObject . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13

6.2 EposRs232Gateway Class Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 146.2.1 Detailed Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14

6.2.2 Constructor & Destructor Documentation . . . . . . . . . . . . . . . . . . . . . . 15

6.2.2.1 EposRs232Gateway . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15

6.2.2.2 EposRs232Gateway . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15

6.2.3 Member Function Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . 16

6.2.3.1 readObject . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16

6.2.3.2 readObject . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16

6.2.3.3 readObject . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16

6.2.3.4 sendFrame . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17

6.2.3.5 writeObject . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17

6.2.3.6 writeObject . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17

6.2.3.7 writeObject . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 18

6.3 MainMotorController Class Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . 19

6.3.1 Detailed Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 20

6.3.2 Constructor & Destructor Documentation . . . . . . . . . . . . . . . . . . . . . . 20

6.3.2.1 MainMotorController . . . . . . . . . . . . . . . . . . . . . . . . . . . 20

6.3.3 Member Function Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . 20

6.3.3.1 convertStatusToString . . . . . . . . . . . . . . . . . . . . . . . . . . . 20

6.3.3.2 isInit . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21

6.3.3.3 postStatus . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21

6.3.3.4 setSpeed . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 22

6.3.3.5 speedDiagnostic . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 22

6.3.3.6 statusDiagnostic . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 22

6.4 Rs232 Class Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 24

6.4.1 Detailed Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 24

6.4.2 Constructor & Destructor Documentation . . . . . . . . . . . . . . . . . . . . . . 24

6.4.2.1 Rs232 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 24

6.4.2.2 Rs232 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 24

6.4.3 Member Function Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . 25

6.4.3.1 close . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 25

6.4.3.2 forceUnlock . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 25

6.4.3.3 open . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 25

6.4.3.4 read . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 25

Generated on Fri Oct 21 00:57:35 2011 for EPOS by Doxygen

Page 5: Epos Reference

7/29/2019 Epos Reference

http://slidepdf.com/reader/full/epos-reference 5/48

CONTENTS iii

6.4.3.5 read . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 26

6.4.3.6 write . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 26

6.4.3.7 write . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 26

7 File Documentation 29

7.1 AbstractEposGateway.h File Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . 29

7.1.1 Detailed Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 30

7.2 EposRs232Gateway.cpp File Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . 32

7.3 EposRs232Gateway.h File Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 33

7.3.1 Detailed Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 33

7.4 main.cpp File Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 35

7.4.1 Function Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 35

7.4.1.1 main . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 35

7.5 MainMotorController.cpp File Reference . . . . . . . . . . . . . . . . . . . . . . . . . . 36

7.5.1 Define Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 36

7.5.1.1 MIKE . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 36

7.6 MainMotorController.h File Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . 37

7.6.1 Detailed Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 37

7.7 Rs232.cpp File Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 39

7.8 Rs232.h File Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 40

Generated on Fri Oct 21 00:57:35 2011 for EPOS by Doxygen

Page 6: Epos Reference

7/29/2019 Epos Reference

http://slidepdf.com/reader/full/epos-reference 6/48

Page 7: Epos Reference

7/29/2019 Epos Reference

http://slidepdf.com/reader/full/epos-reference 7/48

Chapter 1

Namespace Index

1.1 Namespace List

Here is a list of all namespaces with brief descriptions:

epos . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9

Page 8: Epos Reference

7/29/2019 Epos Reference

http://slidepdf.com/reader/full/epos-reference 8/48

2 Namespace Index

Generated on Fri Oct 21 00:57:35 2011 for EPOS by Doxygen

Page 9: Epos Reference

7/29/2019 Epos Reference

http://slidepdf.com/reader/full/epos-reference 9/48

Chapter 2

Class Index

2.1 Class Hierarchy

This inheritance list is sorted roughly, but not completely, alphabetically:

AbstractEposGateway . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11

EposRs232Gateway . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14

MainMotorController . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 19

Rs232 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 24

Page 10: Epos Reference

7/29/2019 Epos Reference

http://slidepdf.com/reader/full/epos-reference 10/48

4 Class Index

Generated on Fri Oct 21 00:57:35 2011 for EPOS by Doxygen

Page 11: Epos Reference

7/29/2019 Epos Reference

http://slidepdf.com/reader/full/epos-reference 11/48

Chapter 3

Class Index

3.1 Class List

Here are the classes, structs, unions and interfaces with brief descriptions:

AbstractEposGateway (Abstract gateway for EPOS devices ) . . . . . . . . . . . . . . . . . . 11

EposRs232Gateway (RS232 EPOS gateway ) . . . . . . . . . . . . . . . . . . . . . . . . . . . 14

MainMotorController (MainMotorController (p. 19) PANDORA main motor controller ) . . 19

Rs232 (Simple C++ wrapper of unix serial port interface ) . . . . . . . . . . . . . . . . . . . . 24

Page 12: Epos Reference

7/29/2019 Epos Reference

http://slidepdf.com/reader/full/epos-reference 12/48

6 Class Index

Generated on Fri Oct 21 00:57:35 2011 for EPOS by Doxygen

Page 13: Epos Reference

7/29/2019 Epos Reference

http://slidepdf.com/reader/full/epos-reference 13/48

Chapter 4

File Index

4.1 File List

Here is a list of all files with brief descriptions:

AbstractEposGateway.h (Abstract interface for a EPOS / EPOS P device gateway ) . . . . . . 29

EposRs232Gateway.cpp . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 32

EposRs232Gateway.h (RS232 interface for a EPOS device gateway ) . . . . . . . . . . . . . . 33

main.cpp . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 35

MainMotorController.cpp . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 36

MainMotorController.h (ROS controller for PANDORA main motors ) . . . . . . . . . . . . . 37

Rs232.cpp . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 39

Rs232.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 40

Page 14: Epos Reference

7/29/2019 Epos Reference

http://slidepdf.com/reader/full/epos-reference 14/48

8 File Index

Generated on Fri Oct 21 00:57:35 2011 for EPOS by Doxygen

Page 15: Epos Reference

7/29/2019 Epos Reference

http://slidepdf.com/reader/full/epos-reference 15/48

Chapter 5

Namespace Documentation

5.1 epos Namespace Reference

Typedefs

• typedef uint16_t Word

 EPOS word (16bit).

• typedef uint32_t DWord

 Double (long) EPOS word (32bit).

• typedef unsigned char Byte

Short EPOS word (8bit).

Enumerations

• enum CommandStatus {

SUCCESS = 0, BUSY, NACK, TIMEOUT,

RS232, API, RESYNC, PROTOCOL }

enumeration of error codes during device communication

5.1.1 Typedef Documentation

5.1.1.1 typedef unsigned char epos::Byte

Short EPOS word (8bit).

Definition at line 100 of file AbstractEposGateway.h.

5.1.1.2 typedef uint32_t epos::DWord

Double (long) EPOS word (32bit).

Definition at line 98 of file AbstractEposGateway.h.

Page 16: Epos Reference

7/29/2019 Epos Reference

http://slidepdf.com/reader/full/epos-reference 16/48

10 Namespace Documentation

5.1.1.3 typedef uint16_t epos::Word

EPOS word (16bit).

Definition at line 96 of file AbstractEposGateway.h.

5.1.2 Enumeration Type Documentation

5.1.2.1 enum epos::CommandStatus

enumeration of error codes during device communication

For communication with the device, a protocol is implemented. In the event that the communication was

successful, each protocol command returns CommandStatus::SUCCESS.

Enumerator:

SUCCESS Command sent successfully. This status code is returned by the implementation in the

event of a successful transaction with the device. Please, note that this doesn’t mean the command

execution was successful, only the data transfer was. In some cases the device my return error

codes using the response data, signifying the result of the command execution. In the event that

a transaction does not return SUCCESS the returned data are undefined.

 BUSY  Device busy. This error code is returned if the device signals that it is not ready to receive new

commands.

 NACK  Device replied with NACK.

TIMEOUT  Time out.

 RS232 RS232 port error. Usually port disconnected.

 API  Invalid API usage. Read documentation. RESYNC  Unexpected responce during handshake. Please disconnect and reconnect to resyncronize

gateway

 PROTOCOL Responce from device violates protocol. Check for changes in updated firmware

Definition at line 110 of file AbstractEposGateway.h.

Generated on Fri Oct 21 00:57:35 2011 for EPOS by Doxygen

Page 17: Epos Reference

7/29/2019 Epos Reference

http://slidepdf.com/reader/full/epos-reference 17/48

Chapter 6

Class Documentation

6.1 AbstractEposGateway Class Reference

Abstract gateway for EPOS devices.

#include <AbstractEposGateway.h>

Inherited by EposRs232Gateway.

Public Member Functions

• virtual epos::CommandStatus sendFrame (unsigned char opCode, epos::Word ∗data, unsigned

short length, epos::Word∗

response)=0• virtual epos::CommandStatus readObject (unsigned char nodeId, uint16_t index, unsigned char

subIndex, epos::DWord ∗responce)=0

• virtual epos::CommandStatus readObject (unsigned char nodeId, uint16_t index, unsigned char

subIndex, epos::Word ∗responce)=0

• virtual epos::CommandStatus readObject (unsigned char nodeId, uint16_t index, unsigned char

subIndex, char ∗responce)=0

• virtual epos::CommandStatus writeObject (unsigned char nodeId, uint16_t index, unsigned char

subIndex, epos::DWord data)=0

• virtual epos::CommandStatus writeObject (unsigned char nodeId, uint16_t index, unsigned char

subIndex, epos::Word data)=0

• virtual epos::CommandStatus writeObject (unsigned char nodeId, uint16_t index, unsigned char

subIndex, char data)=0

6.1.1 Detailed Description

Abstract gateway for EPOS devices. All gateways for EPOS (P) devices must implement this class to

provide compatibility with new devices and hardware implementations.

Author

Charalampos Serenis

Electical and Computer Engineer

Department of Electrical and Computer Engineering

Aristotle University of Thessaloniki, Greece

Page 18: Epos Reference

7/29/2019 Epos Reference

http://slidepdf.com/reader/full/epos-reference 18/48

12 Class Documentation

Definition at line 165 of file AbstractEposGateway.h.

6.1.2 Member Function Documentation

6.1.2.1 virtual epos::CommandStatus AbstractEposGateway::readObject (unsigned char nodeId ,

uint16_t index, unsigned char subIndex, char ∗ responce) [pure virtual]

Implemented in EposRs232Gateway (p. 16).

6.1.2.2 virtual epos::CommandStatus AbstractEposGateway::readObject (unsigned char nodeId ,

uint16_t index, unsigned char subIndex, epos::Word ∗  responce) [pure virtual]

Implemented in EposRs232Gateway (p. 16).

6.1.2.3 virtual epos::CommandStatus AbstractEposGateway::readObject (unsigned char nodeId ,

uint16_t index, unsigned char subIndex, epos::DWord ∗  responce) [pure virtual]

Read object dictionary entry (4 Data Bytes and less)

Read an object value at the given Index and SubIndex from the Object Dictionary.

Parameters

← nodeId  the node ID of the device from which to read the data

← index the index of the Object Dictionary we wish to read

 subIndex the sub-index of the Dictionary we wish to read→ responce the data read

Returns

the status of the operation

Implemented in EposRs232Gateway (p. 16).

6.1.2.4 virtual epos::CommandStatus AbstractEposGateway::sendFrame (unsigned char opCode,

epos::Word ∗  data, unsigned short length, epos::Word ∗  response) [pure virtual]

Send a custom frame using the EPOS gateway

this function can be used to send new, or custom CAN commands to the CANOpen bus.

Parameters

← opCode the operation code of the command

in[  data the data that we wish to write to the CANOpen bus

← length the size of the data array

← response the data received from the device as a response to the command

Implemented in EposRs232Gateway (p. 17).

Generated on Fri Oct 21 00:57:35 2011 for EPOS by Doxygen

Page 19: Epos Reference

7/29/2019 Epos Reference

http://slidepdf.com/reader/full/epos-reference 19/48

6.1 AbstractEposGateway Class Reference 13

6.1.2.5 virtual epos::CommandStatus AbstractEposGateway::writeObject (unsigned char nodeId ,

uint16_t index, unsigned char subIndex, char data) [pure virtual]

Implemented in EposRs232Gateway (p. 17).

6.1.2.6 virtual epos::CommandStatus AbstractEposGateway::writeObject (unsigned char nodeId ,

uint16_t index, unsigned char subIndex, epos::Word data) [pure virtual]

Implemented in EposRs232Gateway (p. 17).

6.1.2.7 virtual epos::CommandStatus AbstractEposGateway::writeObject (unsigned char nodeId ,

uint16_t index, unsigned char subIndex, epos::DWord data) [pure virtual]

Write Object Dictionary Entry (4 Data Bytes and less)

Write an object value to the given Index and SubIndex from the Object Dictionary.

Parameters

← nodeID the node ID of the device from which to read the data

← index the index of the Object Dictionary we wish to read

← subIndex the sub-index of the Dictionary we wish to read

← data the data that should be written

Returns

the status of the operation

Implemented in EposRs232Gateway (p. 18).

The documentation for this class was generated from the following file:

• AbstractEposGateway.h

Generated on Fri Oct 21 00:57:35 2011 for EPOS by Doxygen

Page 20: Epos Reference

7/29/2019 Epos Reference

http://slidepdf.com/reader/full/epos-reference 20/48

14 Class Documentation

6.2 EposRs232Gateway Class Reference

RS232 EPOS gateway.

#include <EposRs232Gateway.h>

Inherits AbstractEposGateway.

Collaboration diagram for EposRs232Gateway:

EposRs232Gateway

AbstractEposGateway Rs232

port

Public Member Functions

• EposRs232Gateway (void)

Generic constructor.

• EposRs232Gateway (const std::string &device, unsigned int baudRate=38400, unsigned int time-out=500)

Construct an EposRs232Gateway (p. 14) object and open EPOS device for read/write.

• epos::CommandStatus sendFrame (unsigned char opCode, epos::Word ∗data, unsigned short

length, epos::Word ∗response)

• epos::CommandStatus readObject (unsigned char nodeID, uint16_t index, unsigned char

subIndex, epos::DWord ∗responce)

• epos::CommandStatus readObject (unsigned char nodeID, uint16_t index, unsigned char

subIndex, epos::Word ∗responce)

• epos::CommandStatus readObject (unsigned char nodeID, uint16_t index, unsigned char

subIndex, char ∗responce)

• epos::CommandStatus writeObject (unsigned char nodeID, uint16_t index, unsigned char

subIndex, epos::DWord data)

• epos::CommandStatus writeObject (unsigned char nodeID, uint16_t index, unsigned char

subIndex, epos::Word data)

• epos::CommandStatus writeObject (unsigned char nodeID, uint16_t index, unsigned char

subIndex, char data)

6.2.1 Detailed Description

RS232 EPOS gateway. EposRs232Gateway (p. 14) provides access to EPOS devices connected to the PC

through an RS232 port. Class provides generic functions for read and write commands through the gateway

Generated on Fri Oct 21 00:57:35 2011 for EPOS by Doxygen

Page 21: Epos Reference

7/29/2019 Epos Reference

http://slidepdf.com/reader/full/epos-reference 21/48

6.2 EposRs232Gateway Class Reference 15

Author

Charalampos Serenis

Electical and Computer Engineer

Department of Electrical and Computer EngineeringAristotle University of Thessaloniki, Greece

Definition at line 101 of file EposRs232Gateway.h.

6.2.2 Constructor & Destructor Documentation

6.2.2.1 EposRs232Gateway::EposRs232Gateway (void)

Generic constructor.

Definition at line 25 of file EposRs232Gateway.cpp.

6.2.2.2 EposRs232Gateway::EposRs232Gateway (const std::string & device, unsigned int

 baudRate = 38400, unsigned int timeout = 500)

Construct an EposRs232Gateway (p. 14) object and open EPOS device for read/write.

Parameters

← device the device name of the serial port the EPOS device is connected. e.g. "/dev/ttyS0"

← baudRate the baudrate that should be used for communication. valid values are:

• 115200

• 57600

• 38400

• 19200

• 9600

• 4800

• 2400

• 1800

• 1200

• 600

• 300

• 200

• 150

• 134

• 110

• 75

• 50

← timeout timeout in ms. This is used when attempting to read data from the serial port

Definition at line 33 of file EposRs232Gateway.cpp.

Here is the call graph for this function:

EposRs232Gateway::EposRs232Gateway Rs232::open

Generated on Fri Oct 21 00:57:35 2011 for EPOS by Doxygen

Page 22: Epos Reference

7/29/2019 Epos Reference

http://slidepdf.com/reader/full/epos-reference 22/48

16 Class Documentation

6.2.3 Member Function Documentation

6.2.3.1 epos::CommandStatus EposRs232Gateway::readObject (unsigned char nodeID, uint16_t

index, unsigned char subIndex, char ∗ responce) [virtual]

Implements AbstractEposGateway (p. 12).

Definition at line 340 of file EposRs232Gateway.cpp.

6.2.3.2 epos::CommandStatus EposRs232Gateway::readObject (unsigned char nodeID, uint16_t

index, unsigned char subIndex, epos::Word ∗ responce) [virtual]

Implements AbstractEposGateway (p. 12).

Definition at line 342 of file EposRs232Gateway.cpp.

Here is the call graph for this function:

EposRs232Gateway::readObject EposRs232Gateway::sendFrame

Rs232::read

Rs232::write

6.2.3.3 epos::CommandStatus EposRs232Gateway::readObject (unsigned char nodeID, uint16_t

index, unsigned char subIndex, epos::DWord ∗  responce) [virtual]

Read object dictionary entry (4 Data Bytes and less)Read an object value at the given Index and SubIndex from the Object Dictionary.

Parameters

← nodeId  the node ID of the device from which to read the data

← index the index of the Object Dictionary we wish to read

← subIndex the sub-index of the Dictionary we wish to read

→ responce the data read

Returns

the status of the operation

Implements AbstractEposGateway (p. 12).

Definition at line 338 of file EposRs232Gateway.cpp.

Here is the caller graph for this function:

EposRs232Gateway::readObject

MainMotorController::MainMotorController

M ai nM otor Co ntro ll er ::po stStatus m ai n

Generated on Fri Oct 21 00:57:35 2011 for EPOS by Doxygen

Page 23: Epos Reference

7/29/2019 Epos Reference

http://slidepdf.com/reader/full/epos-reference 23/48

6.2 EposRs232Gateway Class Reference 17

6.2.3.4 epos::CommandStatus EposRs232Gateway::sendFrame (unsigned char opCode,

epos::Word ∗  data, unsigned short length, epos::Word ∗  response) [virtual]

Send a CAN frame using the EPOS gatewaythis function can be used to send new, or custom CAN commands to the CANOpen bus.

Parameters

← opCode the operation code of the command

in[  data the data that we wish to write to the CANOpen bus

← length the size of the data array

← response the data received from the device as a response to the command

Implements AbstractEposGateway (p. 12).

Definition at line 84 of file EposRs232Gateway.cpp.

Here is the call graph for this function:

EposRs232Gateway::sendFrame

Rs232::read

Rs232::write

Here is the caller graph for this function:

EposRs232Gateway::sendFrame

EposRs232Gateway::readObject

EposRs232Gateway::writeObject

MainMotorController::MainMotorController

MainMotorController::setSpeed main

6.2.3.5 epos::CommandStatus EposRs232Gateway::writeObject (unsigned char nodeID, uint16_t

index, unsigned char subIndex, char data) [virtual]

Implements AbstractEposGateway (p. 13).

Definition at line 374 of file EposRs232Gateway.cpp.

Here is the call graph for this function:

EposRs232Gateway::writeObject EposRs232Gateway::sendFrame

Rs232::read

Rs232::write

6.2.3.6 epos::CommandStatus EposRs232Gateway::writeObject (unsigned char nodeID, uint16_t

index, unsigned char subIndex, epos::Word data) [virtual]

Implements AbstractEposGateway (p. 13).

Generated on Fri Oct 21 00:57:35 2011 for EPOS by Doxygen

Page 24: Epos Reference

7/29/2019 Epos Reference

http://slidepdf.com/reader/full/epos-reference 24/48

18 Class Documentation

Definition at line 364 of file EposRs232Gateway.cpp.

Here is the call graph for this function:

EposRs232Gateway::writeObject EposRs232Gateway::sendFrame

Rs232::read

Rs232::write

6.2.3.7 epos::CommandStatus EposRs232Gateway::writeObject (unsigned char nodeID, uint16_t

index, unsigned char subIndex, epos::DWord data) [virtual]

Write Object Dictionary Entry (4 Data Bytes and less)

Write an object value to the given Index and SubIndex from the Object Dictionary.

Parameters

← nodeID the node ID of the device from which to read the data

← index the index of the Object Dictionary we wish to read

← subIndex the sub-index of the Dictionary we wish to read

← data the data that should be written

Returns

the status of the operation

Implements AbstractEposGateway (p. 13).

Definition at line 349 of file EposRs232Gateway.cpp.

Here is the call graph for this function:

EposRs232Gateway::writeObject EposRs232Gateway::sendFrame

Rs232::read

Rs232::write

Here is the caller graph for this function:

EposRs232Gateway::writeObject

MainMotorController::MainMotorController

M ai nM otor Co ntro ll er ::se tSpe ed m ai n

The documentation for this class was generated from the following files:

• EposRs232Gateway.h

• EposRs232Gateway.cpp

Generated on Fri Oct 21 00:57:35 2011 for EPOS by Doxygen

Page 25: Epos Reference

7/29/2019 Epos Reference

http://slidepdf.com/reader/full/epos-reference 25/48

6.3 MainMotorController Class Reference 19

6.3 MainMotorController Class Reference

MainMotorController (p. 19) PANDORA main motor controller.

#include <MainMotorController.h>

Collaboration diagram for MainMotorController:

MainMotorController

EposRs232Gateway

m_gateway

AbstractEposGateway Rs232

port

Public Member Functions

• MainMotorController (std::string dev, int speed, int timeout, ros::Publisher ∗p, ros::NodeHandle

&handle)

initialize the MainMotorController (p. 19)

• bool setSpeed (mainMotorControl_communications::setVehicleSpeedSrv::Request &req,

mainMotorControl_communications::setVehicleSpeedSrv::Response &res)

set vehicle speed 

• void postStatus (const ros::TimerEvent &event)

 post the controller status for health monitoring

• bool isInit (void)

check MainMotorController (p. 19) initialization status

• void speedDiagnostic (diagnostic_updater::DiagnosticStatusWrapper &stat)

unknown function

• void statusDiagnostic (diagnostic_updater::DiagnosticStatusWrapper &stat)

unknown function

• std::string convertStatusToString (epos::CommandStatus status)

convert epos::CommandStatus (p. 10) to a human readable string

Generated on Fri Oct 21 00:57:35 2011 for EPOS by Doxygen

Page 26: Epos Reference

7/29/2019 Epos Reference

http://slidepdf.com/reader/full/epos-reference 26/48

20 Class Documentation

6.3.1 Detailed Description

MainMotorController (p. 19) PANDORA main motor controller. MainMotorController (p. 19) setups

the required topics and services to access the EPOS controller from ros. The MainMotorController (p. 19)takes care of the required convertions from linear and angular speed to rpms using robotKinematic library.

Finaly the required rpms are transmited to the EPOS controller using the designed protocol.

Author

Charalampos Serenis

Electical and Computer Engineer

Department of Electrical and Computer Engineering

Aristotle University of Thessaloniki, Greece

Definition at line 93 of file MainMotorController.h.

6.3.2 Constructor & Destructor Documentation

6.3.2.1 MainMotorController::MainMotorController (std::string dev, int speed , int timeout,

ros::Publisher ∗  p, ros::NodeHandle & handle)

initialize the MainMotorController (p. 19)

requires a string to the character device that the EPOS controller is connected, the BAUD rate of the

controller, the timeout in ms, a ROS Publisher object and a ROS node handler.

Parameters

← dev a standard string of the character device the controller is connected. e.g. "/dev/ttyS0"

← speed  the BAUD rate of the controller. e.g. 115200

← timeout the time it should take to timeout an expected reception from the character device in

miliseconds. e.g. 500

← p a ros::Publisher object that is going to be used to publish the required topics

← handle a ros::NodeHandle used to advertise services

Definition at line 185 of file MainMotorController.cpp.

Here is the call graph for this function:

MainMotorController::MainMotorController

EposRs232Gateway::readObject

MainMotorController::speedDiagnostic

MainMotorController::statusDiagnostic

EposRs232Gateway::writeObject

MainMotorController::convertStatusToString

EposRs232Gateway::sendFrame

Rs232::read

Rs232::write

6.3.3 Member Function Documentation

6.3.3.1 std::string MainMotorController::convertStatusToString (epos::CommandStatus status)

convert epos::CommandStatus (p. 10) to a human readable string

Generated on Fri Oct 21 00:57:35 2011 for EPOS by Doxygen

Page 27: Epos Reference

7/29/2019 Epos Reference

http://slidepdf.com/reader/full/epos-reference 27/48

6.3 MainMotorController Class Reference 21

Parameters

← status the status code that we wish convert to string

Returnsa human readable string describing the error

Definition at line 164 of file MainMotorController.cpp.

Here is the caller graph for this function:

MainMotorController::convertStatusToString MainMotorController::statusDiagnostic MainMotorController::MainMotorController

6.3.3.2 bool MainMotorController::isInit (void) [inline]

check MainMotorController (p. 19) initialization status

checks if the controller object is correctly initialized and communicates with the underlying hardware.

No error handling exists, this functions simply returns true if the controller communicates with the EPOS

device and false if there is an error. No error code is returned.

Returns

true if communication is ok with epos, false if there is a comminication error

Definition at line 173 of file MainMotorController.h.

Here is the caller graph for this function:

MainMotorController::isInit main

6.3.3.3 void MainMotorController::postStatus (const ros::TimerEvent & event)

post the controller status for health monitoring

callback function for ros timer. Post the controller status in topic /mainMotorControl/status

Parameters

← event a ros::TimerEvent used to call the callback function

Definition at line 254 of file MainMotorController.cpp.

Here is the call graph for this function:

MainMotorController::postStatus EposRs232Gateway::readObject

Here is the caller graph for this function:

MainMotorController::postStatus main

Generated on Fri Oct 21 00:57:35 2011 for EPOS by Doxygen

Page 28: Epos Reference

7/29/2019 Epos Reference

http://slidepdf.com/reader/full/epos-reference 28/48

22 Class Documentation

6.3.3.4 bool MainMotorController::setSpeed (mainMotorControl_-

communications::setVehicleSpeedSrv::Request & req, mainMotorControl_-

communications::setVehicleSpeedSrv::Response & res)

set vehicle speed

callback function for ros service. For more information please see ROS service mainMotorControl_-

communications::setVehicleSpeedSrv

Parameters

← req a ros request

→ the reply of the service

set vehicle speed

sets the vehicle speed.

Definition at line 27 of file MainMotorController.cpp.

Here is the call graph for this function:

MainMotorController::setSpeed EposRs232Gateway::writeObject EposRs232Gateway::sendFrame

Rs232::read

Rs232::write

Here is the caller graph for this function:

MainMotorController::setSpeed main

6.3.3.5 void MainMotorController::speedDiagnostic (diagnostic_-

updater::DiagnosticStatusWrapper & stat)

unknown function

functions added by diagnostic team, dont know what they do!

Definition at line 235 of file MainMotorController.cpp.

Here is the caller graph for this function:

MainMotorController::speedDiagnostic MainMotorController::MainMotorController

6.3.3.6 void MainMotorController::statusDiagnostic (diagnostic_-

updater::DiagnosticStatusWrapper & stat)

unknown function

functions added by diagnostic team, dont know what they do!

Definition at line 245 of file MainMotorController.cpp.

Generated on Fri Oct 21 00:57:35 2011 for EPOS by Doxygen

Page 29: Epos Reference

7/29/2019 Epos Reference

http://slidepdf.com/reader/full/epos-reference 29/48

6.3 MainMotorController Class Reference 23

Here is the call graph for this function:

MainMotorController::statusDiagnostic MainMotorController::convertStatusToString

Here is the caller graph for this function:

MainMotorController::statusDiagnostic MainMotorController::MainMotorController

The documentation for this class was generated from the following files:

• MainMotorController.h

• MainMotorController.cpp

Generated on Fri Oct 21 00:57:35 2011 for EPOS by Doxygen

Page 30: Epos Reference

7/29/2019 Epos Reference

http://slidepdf.com/reader/full/epos-reference 30/48

24 Class Documentation

6.4 Rs232 Class Reference

Simple C++ wrapper of unix serial port interface.

#include <Rs232.h>

Public Member Functions

• Rs232 (void)

 Initializes internal variables but doesn’t open serial port.

• Rs232 (std::string port, unsigned int baudRate, unsigned int timeout)

• int open (std::string port, unsigned int speed=38400, int iTimeOut=500)

• int close (void)

• int write (char ∗data, unsigned int size)

• int write (char data)

• int read (char ∗data, unsigned int size)

• int read (char &data)

• void forceUnlock (void)

6.4.1 Detailed Description

Simple C++ wrapper of unix serial port interface. Open serial ports for read and write in binary mode.

Provides the necessary locking mechanisms to prevent concurrent access to the serial port.

Author

Charalampos Serenis

Electical and Computer Engineer

Department of Electrical and Computer Engineering

Aristotle University of Thessaloniki, Greece

Definition at line 51 of file Rs232.h.

6.4.2 Constructor & Destructor Documentation

6.4.2.1 Rs232::Rs232 (void)

Initializes internal variables but doesn’t open serial port.

Definition at line 23 of file Rs232.cpp.

6.4.2.2 Rs232::Rs232 (std::string port, unsigned int baudRate, unsigned int timeout)

Initializes internal variables and opens serial port for binary read / write.

Parameters

 port the serial device to open

 baudRate port baud rate in bits per second

 timeout time in ms to wait for rear/write operations to complete

Generated on Fri Oct 21 00:57:35 2011 for EPOS by Doxygen

Page 31: Epos Reference

7/29/2019 Epos Reference

http://slidepdf.com/reader/full/epos-reference 31/48

6.4 Rs232 Class Reference 25

See also

open (p. 25)

Definition at line 30 of file Rs232.cpp.

Here is the call graph for this function:

Rs232:: Rs 232 Rs 232:: open

6.4.3 Member Function Documentation

6.4.3.1 int Rs232::close (void)

Close serial port

Close serial port currently accessed by the object. In the event that no port is open by the object a warning

is generated and no action is taken.

Definition at line 138 of file Rs232.cpp.

6.4.3.2 void Rs232::forceUnlock (void)

Definition at line 215 of file Rs232.cpp.

6.4.3.3 int Rs232::open (std::string port, unsigned int speed = 38400, int iTimeOut = 500)

Open serial port for binary rear / write

Opens the serial device defined by parameter port for binary read / write. In the event that the port is already

opened an error is generated, and no new port is open.

Parameters

 port the serial port to open

 baudRate port baud rate in bits per second

 timeout time in ms to wait fore read / write operations to complete

Definition at line 42 of file Rs232.cpp.Here is the caller graph for this function:

Rs232::open

EposRs232Gateway::EposRs232Gateway

Rs232::Rs232

6.4.3.4 int Rs232::read (char & data)

Definition at line 183 of file Rs232.cpp.

Generated on Fri Oct 21 00:57:35 2011 for EPOS by Doxygen

Page 32: Epos Reference

7/29/2019 Epos Reference

http://slidepdf.com/reader/full/epos-reference 32/48

26 Class Documentation

Here is the call graph for this function:

Rs23 2::r ea d Rs2 32 ::re ad

6.4.3.5 int Rs232::read (char ∗ data, unsigned int size)

Definition at line 190 of file Rs232.cpp.

Here is the caller graph for this function:

Rs232::read

Rs232::read

EposRs232Gateway::sendFrame

EposRs232Gateway::readObject

EposRs232Gateway::writeObject

MainMotorController::MainMotorController

M ai nM ot or Co nt ro ll er :: se tSpe ed m ai n

6.4.3.6 int Rs232::write (char data)

Definition at line 149 of file Rs232.cpp.

Here is the call graph for this function:

R s2 32 :: wr it e R s2 32 ::w ri te

6.4.3.7 int Rs232::write (char ∗  data, unsigned int size)

Write data to serial port

Write size number of bytes to the serial port, from memory pointed by data. This is a blocking operation.

During write the object is locked and any concurrent access to the serial port (i.e. read, write, close) will

wait until the operation finishes or fails. Access to the same serial port by another program or by another

object holding a valid file descriptor to the serial port will not be blocked.

Parameters

 data a pointer to the data that need to be written to the serial port

 size the number of bytes that need to be written to the serial port

Returns

on success the number of bytes written to the serial port, which is the same as size

on error the error number returned by the OS. An error message is output to stderr

Definition at line 155 of file Rs232.cpp.

Generated on Fri Oct 21 00:57:35 2011 for EPOS by Doxygen

Page 33: Epos Reference

7/29/2019 Epos Reference

http://slidepdf.com/reader/full/epos-reference 33/48

6.4 Rs232 Class Reference 27

Here is the caller graph for this function:

Rs232::write

EposRs232Gateway::sendFrame

Rs232::write

EposRs232Gateway::readObject

EposRs232Gateway::writeObject

MainMotorController::MainMotorController

M ai nM ot or Co nt ro ll er :: se tSpe ed m ai n

The documentation for this class was generated from the following files:

• Rs232.h

• Rs232.cpp

Generated on Fri Oct 21 00:57:35 2011 for EPOS by Doxygen

Page 34: Epos Reference

7/29/2019 Epos Reference

http://slidepdf.com/reader/full/epos-reference 34/48

28 Class Documentation

Generated on Fri Oct 21 00:57:35 2011 for EPOS by Doxygen

Page 35: Epos Reference

7/29/2019 Epos Reference

http://slidepdf.com/reader/full/epos-reference 35/48

Chapter 7

File Documentation

7.1 AbstractEposGateway.h File Reference

Abstract interface for a EPOS / EPOS P device gateway.

#include <stdint.h>

Include dependency graph for AbstractEposGateway.h:

AbstractEposGateway.h

stdint.h

This graph shows which files directly or indirectly include this file:

AbstractEposGateway.h

EposRs232Gateway.h

main.cpp MainMotorController.h

MainMotorController.cpp

Classes

• class AbstractEposGateway

 Abstract gateway for EPOS devices.

Page 36: Epos Reference

7/29/2019 Epos Reference

http://slidepdf.com/reader/full/epos-reference 36/48

30 File Documentation

Namespaces

• namespace epos

Typedefs

• typedef uint16_t epos::Word

 EPOS word (16bit).

• typedef uint32_t epos::DWord

 Double (long) EPOS word (32bit).

• typedef unsigned char epos::Byte

Short EPOS word (8bit).

Enumerations

• enum epos::CommandStatus {

epos::SUCCESS = 0, epos::BUSY, epos::NACK, epos::TIMEOUT,

epos::RS232, epos::API, epos::RESYNC, epos::PROTOCOL }

enumeration of error codes during device communication

7.1.1 Detailed Description

Abstract interface for a EPOS / EPOS P device gateway. Declares all the neccessary datatypes and inter-

faces to access an EPOS / EPOS P motor controller. This interface is provided in order to support different

hardware implementations of the gateway, such as RS232 interface USB interface, etc. AbstractEpos-

Gateway.h (p. 29) declares the following namespaces:

• epos

AbstractEposGateway.h (p. 29) declares the following typedefs:

• Word

• DWord

• Byte

AbstractEposGateway.h (p. 29) declares the following enumerations:

• CommandStatus

AbstractEposGateway.h (p. 29) declares the following abstract classes:

• AbstractEposGateway (p. 11)

AbstractEposGateway.h (p. 29) declares the following methods:

Generated on Fri Oct 21 00:57:35 2011 for EPOS by Doxygen

Page 37: Epos Reference

7/29/2019 Epos Reference

http://slidepdf.com/reader/full/epos-reference 37/48

7.1 AbstractEposGateway.h File Reference 31

• int getSoftwareVersion(void);

• epos::status AbstractEposGateway::sendFrame (p. 12)( unsigned char opCode,

epos::Word (p. 10) ∗data, unsigned short length, epos::Word (p. 10) ∗response);

• epos::status AbstractEposGateway::readObject (p. 12)( unsigned char nodeID, uint16_t in-

dex, unsigned char subIndex, epos::DWord (p. 9) ∗responce);

• epos::status AbstractEposGateway::readObject (p. 12)( unsigned char nodeID, uint16_t in-

dex, unsigned char subIndex, epos::Word (p. 10) ∗responce);

• epos::status AbstractEposGateway::readObject (p. 12)( unsigned char nodeID, uint16_t in-

dex, unsigned char subIndex, char ∗responce);

• epos::status AbstractEposGateway::writeObject (p. 13)( unsigned char nodeID, uint16_t in-

dex, unsigned char subIndex, epos::DWord (p. 9) data);

• epos::status AbstractEposGateway::writeObject (p. 13)( unsigned char nodeID, uint16_t in-

dex, unsigned char subIndex, epos::Word (p. 10) data);

• epos::status AbstractEposGateway::writeObject (p. 13)( unsigned char nodeID, uint16_t in-

dex, unsigned char subIndex, char data);

Author

Charalampos Serenis

Electical and Computer Engineer

Department of Electrical and Computer Engineering

Aristotle University of Thessaloniki, Greece

Definition in file AbstractEposGateway.h .

Generated on Fri Oct 21 00:57:35 2011 for EPOS by Doxygen

Page 38: Epos Reference

7/29/2019 Epos Reference

http://slidepdf.com/reader/full/epos-reference 38/48

32 File Documentation

7.2 EposRs232Gateway.cpp File Reference

#include <iostream>

#include <EposRs232Gateway.h>

#include <string>

#include <pthread.h>

#include <cstring>

#include <stdint.h>

#include <unistd.h>

#include <termios.h>

#include <fcntl.h>

#include <errno.h>

Include dependency graph for EposRs232Gateway.cpp:

EposRs232Gateway.cpp

iostream string pthread.h cstring stdint.h unistd.h termios.h fcntl.h errno.h

This graph shows which files directly or indirectly include this file:

EposRs232Gateway.cpp

Generated on Fri Oct 21 00:57:35 2011 for EPOS by Doxygen

Page 39: Epos Reference

7/29/2019 Epos Reference

http://slidepdf.com/reader/full/epos-reference 39/48

7.3 EposRs232Gateway.h File Reference 33

7.3 EposRs232Gateway.h File Reference

RS232 interface for a EPOS device gateway.

#include <string>

#include <pthread.h>

#include <Rs232.h>

#include <AbstractEposGateway.h>

Include dependency graph for EposRs232Gateway.h:

EposRs232Gateway.h

string

pthread.hRs232.hAbstractEposGateway.h

i ostr ea m cstri ngstdint.h unistd.h termios.h fcntl.h errno.h

This graph shows which files directly or indirectly include this file:

EposRs232Gateway.h

main.cpp MainMotorController.h

MainMotorController.cpp

Classes

• class EposRs232Gateway

 RS232 EPOS gateway.

7.3.1 Detailed Description

RS232 interface for a EPOS device gateway. Defines the implementation for the RS232 device gateway.

This class EposRs232Gateway (p. 14) inherits the AbstractEposGateway (p. 11).

EposRs232Gateway.h (p. 33) declares the following methods:

• int getSoftwareVersion(void);

• epos::status EposRs232Gateway::sendFrame (p. 17)( unsigned char opCode, epos::Word

(p. 10) ∗data, unsigned short length, epos::Word (p. 10) ∗response);

• epos::status EposRs232Gateway::readObject(p. 16)( unsigned char nodeID, uint16_t index,

unsigned char subIndex, epos::DWord (p. 9) ∗responce);

Generated on Fri Oct 21 00:57:35 2011 for EPOS by Doxygen

Page 40: Epos Reference

7/29/2019 Epos Reference

http://slidepdf.com/reader/full/epos-reference 40/48

34 File Documentation

• epos::status EposRs232Gateway::readObject(p. 16)( unsigned char nodeID, uint16_t index,

unsigned char subIndex, epos::Word (p. 10) ∗responce);

• epos::status EposRs232Gateway::readObject(p. 16)( unsigned char nodeID, uint16_t index,

unsigned char subIndex, char ∗responce);

• epos::status EposRs232Gateway::writeObject (p. 18)( unsigned char nodeID, uint16_t in-

dex, unsigned char subIndex, epos::DWord (p. 9) data);

• epos::status EposRs232Gateway::writeObject (p. 18)( unsigned char nodeID, uint16_t in-

dex, unsigned char subIndex, epos::Word (p. 10) data);

• epos::status EposRs232Gateway::writeObject (p. 18)( unsigned char nodeID, uint16_t in-

dex, unsigned char subIndex, char data);

Author

Charalampos Serenis

Electical and Computer Engineer

Department of Electrical and Computer Engineering

Aristotle University of Thessaloniki, Greece

Definition in file EposRs232Gateway.h.

Generated on Fri Oct 21 00:57:35 2011 for EPOS by Doxygen

Page 41: Epos Reference

7/29/2019 Epos Reference

http://slidepdf.com/reader/full/epos-reference 41/48

7.4 main.cpp File Reference 35

7.4 main.cpp File Reference

#include <iostream>

#include <cstdio>

#include "ros/ros.h"

#include "mainMotorControl_communications/setVehicleSpeedSrv.h"

#include "mainMotorControl_communications/mainMotorStateMsg.h"

#include <EposRs232Gateway.h>

#include <Kinematic.h>

#include <fstream>

#include <SubscriberTester.h>

#include <PublisherTester.h>

#include "diagnostic_updater/diagnostic_updater.h"

#include "MainMotorController.h"

Include dependency graph for main.cpp:

main.cpp

iostream

cstdio ros/ros.h mainMotorControl_communications/setVehicleSpeedSrv.h mainMotorControl_communications/mainMotorStateMsg.hEposRs232Gateway.h Kinematic.h fstream SubscriberTester.h PublisherTester.h diagnostic_updater/diagnostic_updater.h

string

pthread.hR s2 32 .h A bs tr ac tE po sG at ew ay .h

cstring stdint.hunistd.ht e rm ios . h f c nt l. h e rr no . h

This graph shows which files directly or indirectly include this file:

main.cpp

Functions

• int main (int argc, char ∗∗argv)

7.4.1 Function Documentation

7.4.1.1 int main (int argc, char ∗∗  argv)

Definition at line 42 of file main.cpp.

Here is the call graph for this function:

main

MainMotorController::isInit

MainMotorController::postStatus

MainMotorController::setSpeed

EposRs232Gateway::readObject

EposRs232Gateway::writeObject EposRs232Gateway::sendFrame

Rs232::read

Rs232::write

Generated on Fri Oct 21 00:57:35 2011 for EPOS by Doxygen

Page 42: Epos Reference

7/29/2019 Epos Reference

http://slidepdf.com/reader/full/epos-reference 42/48

36 File Documentation

7.5 MainMotorController.cpp File Reference

#include "MainMotorController.h"

Include dependency graph for MainMotorController.cpp:

MainMotorController.cpp

MainMotorController.h

ros/ros.h mainMotorControl_communications/setVehicleSpeedSrv.h mainMotorControl_communications/mainMotorStateMsg.h EposRs232Gateway.h Kinematic.h fstream SubscriberTester.h PublisherTester.h diagnostic_updater/diagnostic_updater.h

string

pthread.hRs232.hAbstractEposGateway.h

iost ream cstringstdint.h unistd.h termios.h fcntl.h errno.h

Defines

• #define MIKE

7.5.1 Define Documentation

7.5.1.1 #define MIKE

Generated on Fri Oct 21 00:57:35 2011 for EPOS by Doxygen

Page 43: Epos Reference

7/29/2019 Epos Reference

http://slidepdf.com/reader/full/epos-reference 43/48

7.6 MainMotorController.h File Reference 37

7.6 MainMotorController.h File Reference

ROS controller for PANDORA main motors.

#include "ros/ros.h"

#include "mainMotorControl_communications/setVehicleSpeedSrv.h"

#include "mainMotorControl_communications/mainMotorStateMsg.h"

#include <EposRs232Gateway.h>

#include <Kinematic.h>

#include <fstream>

#include <SubscriberTester.h>

#include <PublisherTester.h>

#include "diagnostic_updater/diagnostic_updater.h"

Include dependency graph for MainMotorController.h:

MainMotorController.h

ros/ros.h mainMotorControl_communications/setVehicleSpeedSrv.h mainMotorControl_communications/mainMotorStateMsg.h EposRs232Gateway.h Kinematic.h fstream SubscriberTester.h PublisherTester.h diagnostic_updater/diagnostic_updater.h

string

pthread.hRs232.hAbstractEposGateway.h

iost ream cstringstdint.h unistd.h termios.h fcntl.h errno.h

This graph shows which files directly or indirectly include this file:

MainMotorController.h

MainMotorController.cpp

Classes

• class MainMotorController

 MainMotorController (p. 19) PANDORA main motor controller.

7.6.1 Detailed Description

ROS controller for PANDORA main motors. Objects of class MainMotorController (p. 19) declare and

initialize all the necessary subsystems for communication with the underlaying hardware responsible for

controlling the 2 EPOS controllers. Furhtermore, the object setups all the described ROS topics and ser-

vices to communicate with other ROS nodes. This class acts as a midleware between the ROS API and the

libraries/objects driving the hardware. MainMotorController.h (p. 37) declares the following classes:

• MainMotorController (p. 19)

MainMotorController.h (p. 37) declares the following methods:

Generated on Fri Oct 21 00:57:35 2011 for EPOS by Doxygen

Page 44: Epos Reference

7/29/2019 Epos Reference

http://slidepdf.com/reader/full/epos-reference 44/48

38 File Documentation

• MainMotorController (p. 19)( std::string dev, int speed, int timeout, ros::Publisher ∗p,

ros::NodeHandle &handle);

• bool setSpeed( mainMotorControl_communications::setVehicleSpeedSrv::Request &req,

mainMotorControl_communications::setVehicleSpeedSrv::Response &res);

• void postStatus(const ros::TimerEvent& event);

• inline bool isInit(void);

• void speedDiagnostic( diagnostic_updater::DiagnosticStatusWrapper &stat);

• void statusDiagnostic( diagnostic_updater::DiagnosticStatusWrapper &stat);

• std::string convertStatusToString(epos::CommandStatus);

Author

Charalampos SerenisElectical and Computer Engineer

Department of Electrical and Computer Engineering

Aristotle University of Thessaloniki, Greece

Definition in file MainMotorController.h.

Generated on Fri Oct 21 00:57:35 2011 for EPOS by Doxygen

Page 45: Epos Reference

7/29/2019 Epos Reference

http://slidepdf.com/reader/full/epos-reference 45/48

7.7 Rs232.cpp File Reference 39

7.7 Rs232.cpp File Reference

#include <Rs232.h>

Include dependency graph for Rs232.cpp:

Rs232.cpp

Rs232.h

iostream string cstring stdint.h unistd.h termios.h fcntl.h errno.h

Generated on Fri Oct 21 00:57:35 2011 for EPOS by Doxygen

Page 46: Epos Reference

7/29/2019 Epos Reference

http://slidepdf.com/reader/full/epos-reference 46/48

40 File Documentation

7.8 Rs232.h File Reference

#include <iostream>

#include <string>

#include <cstring>

#include <stdint.h>

#include <unistd.h>

#include <termios.h>

#include <fcntl.h>

#include <errno.h>

Include dependency graph for Rs232.h:

Rs232.h

iostream string cstring stdint.h unistd.h termios.h fcntl.h errno.h

This graph shows which files directly or indirectly include this file:

Rs232.h

EposRs232Gateway.h Rs232.cpp

main.cpp MainMotorController.h

MainMotorController.cpp

Classes

• class Rs232

Simple C++ wrapper of unix serial port interface.

Generated on Fri Oct 21 00:57:35 2011 for EPOS by Doxygen

Page 47: Epos Reference

7/29/2019 Epos Reference

http://slidepdf.com/reader/full/epos-reference 47/48

Index

AbstractEposGateway, 11

readObject, 12

sendFrame, 12

writeObject, 12, 13

AbstractEposGateway.h, 29

API

epos, 10

BUSY

epos, 10

Byte

epos, 9

close

Rs232, 25

CommandStatus

epos, 10

convertStatusToString

MainMotorController, 20

DWordepos, 9

epos, 9

API, 10

BUSY, 10

Byte, 9

CommandStatus, 10

DWord, 9

NACK, 10

PROTOCOL, 10

RESYNC, 10

RS232, 10SUCCESS, 10

TIMEOUT, 10

Word, 9

EposRs232Gateway, 14

EposRs232Gateway, 15

readObject, 16

sendFrame, 16

writeObject, 17, 18

EposRs232Gateway.cpp, 32

EposRs232Gateway.h, 33

forceUnlock 

Rs232, 25

isInit

MainMotorController, 21

main

main.cpp, 35

main.cpp, 35

main, 35

MainMotorController, 19convertStatusToString, 20

isInit, 21

MainMotorController, 20

postStatus, 21

setSpeed, 21

speedDiagnostic, 22

statusDiagnostic, 22

MainMotorController.cpp, 36

MIKE, 36

MainMotorController.h, 37

MIKE

MainMotorController.cpp, 36

NACK

epos, 10

open

Rs232, 25

postStatus

MainMotorController, 21

PROTOCOL

epos, 10

read

Rs232, 25, 26

readObject

AbstractEposGateway, 12

EposRs232Gateway, 16

RESYNC

epos, 10

RS232

epos, 10

Rs232, 24

close, 25

forceUnlock, 25

open, 25

read, 25, 26

Page 48: Epos Reference

7/29/2019 Epos Reference

http://slidepdf.com/reader/full/epos-reference 48/48

42 INDEX

Rs232, 24

write, 26

Rs232.cpp, 39

Rs232.h, 40

sendFrame

AbstractEposGateway, 12

EposRs232Gateway, 16

setSpeed

MainMotorController, 21

speedDiagnostic

MainMotorController, 22

statusDiagnostic

MainMotorController, 22

SUCCESS

epos, 10

TIMEOUT

epos, 10

Word

epos, 9

write

Rs232, 26

writeObject

AbstractEposGateway, 12, 13

EposRs232Gateway, 17, 18