Classes | Public Member Functions | Protected Member Functions | Private Types | Private Member Functions | Private Attributes | List of all members
canopen::Motor402 Class Reference

#include <motor.h>

Inheritance diagram for canopen::Motor402:
Inheritance graph
[legend]

Classes

class  Allocator
 

Public Member Functions

virtual bool enterModeAndWait (uint16_t mode)
 
virtual uint16_t getMode ()
 
virtual bool isModeSupported (uint16_t mode)
 
 Motor402 (const std::string &name, ObjectStorageSharedPtr storage, const canopen::Settings &settings)
 
virtual void registerDefaultModes (ObjectStorageSharedPtr storage)
 
template<typename T , typename ... Args>
bool registerMode (uint16_t mode, Args &&... args)
 
virtual bool setTarget (double val)
 
- Public Member Functions inherited from canopen::Layer
void diag (LayerReport &report)
 
LayerState getLayerState ()
 
void halt (LayerStatus &status)
 
void init (LayerStatus &status)
 
 Layer (const std::string &n)
 
void read (LayerStatus &status)
 
void recover (LayerStatus &status)
 
void shutdown (LayerStatus &status)
 
void write (LayerStatus &status)
 
virtual ~Layer ()
 

Protected Member Functions

virtual void handleDiag (LayerReport &report)
 
virtual void handleHalt (LayerStatus &status)
 
virtual void handleInit (LayerStatus &status)
 
virtual void handleRead (LayerStatus &status, const LayerState &current_state)
 
virtual void handleRecover (LayerStatus &status)
 
virtual void handleShutdown (LayerStatus &status)
 
virtual void handleWrite (LayerStatus &status, const LayerState &current_state)
 
- Protected Member Functions inherited from canopen::MotorBase
 MotorBase (const std::string &name)
 

Private Types

typedef std::function< void()> AllocFuncType
 

Private Member Functions

ModeSharedPtr allocMode (uint16_t mode)
 
virtual bool isModeSupportedByDevice (uint16_t mode)
 
bool readState (LayerStatus &status, const LayerState &current_state)
 
void registerMode (uint16_t id, const ModeSharedPtr &m)
 
bool switchMode (LayerStatus &status, uint16_t mode)
 
bool switchState (LayerStatus &status, const State402::InternalState &target)
 

Private Attributes

uint16_t control_word_
 
canopen::ObjectStorage::Entry< uint16_t > control_word_entry_
 
boost::mutex cw_mutex_
 
boost::mutex map_mutex_
 
std::unordered_map< uint16_t, AllocFuncTypemode_allocators_
 
boost::condition_variable mode_cond_
 
uint16_t mode_id_
 
boost::mutex mode_mutex_
 
std::unordered_map< uint16_t, ModeSharedPtrmodes_
 
const bool monitor_mode_
 
canopen::ObjectStorage::Entry< int8_t > op_mode_
 
canopen::ObjectStorage::Entry< int8_t > op_mode_display_
 
ModeSharedPtr selected_mode_
 
std::atomic< bool > start_fault_reset_
 
State402 state_handler_
 
const boost::chrono::seconds state_switch_timeout_
 
std::atomic< uint16_t > status_word_
 
canopen::ObjectStorage::Entry< uint16_t > status_word_entry_
 
canopen::ObjectStorage::Entry< uint32_t > supported_drive_modes_
 
const State402::InternalState switching_state_
 
std::atomic< State402::InternalStatetarget_state_
 

Additional Inherited Members

- Public Types inherited from canopen::MotorBase
typedef std::shared_ptr< MotorBaseMotorBaseSharedPtr
 
enum  OperationMode {
  No_Mode = 0, Profiled_Position = 1, Velocity = 2, Profiled_Velocity = 3,
  Profiled_Torque = 4, Reserved = 5, Homing = 6, Interpolated_Position = 7,
  Cyclic_Synchronous_Position = 8, Cyclic_Synchronous_Velocity = 9, Cyclic_Synchronous_Torque = 10
}
 
- Public Types inherited from canopen::Layer
enum  LayerState
 
- Public Attributes inherited from canopen::Layer
 Error
 
 Halt
 
 Init
 
const std::string name
 
 Off
 
 Ready
 
 Recover
 
 Shutdown
 

Detailed Description

Definition at line 291 of file motor.h.

Member Typedef Documentation

◆ AllocFuncType

typedef std::function<void()> canopen::Motor402::AllocFuncType
private

Definition at line 370 of file motor.h.

Constructor & Destructor Documentation

◆ Motor402()

canopen::Motor402::Motor402 ( const std::string &  name,
ObjectStorageSharedPtr  storage,
const canopen::Settings &  settings 
)
inline

Definition at line 295 of file motor.h.

Member Function Documentation

◆ allocMode()

ModeSharedPtr canopen::Motor402::allocMode ( uint16_t  mode)
private

Definition at line 279 of file motor.cpp.

◆ enterModeAndWait()

bool canopen::Motor402::enterModeAndWait ( uint16_t  mode)
virtual

Implements canopen::MotorBase.

Definition at line 254 of file motor.cpp.

◆ getMode()

uint16_t canopen::Motor402::getMode ( )
virtual

Implements canopen::MotorBase.

Definition at line 263 of file motor.cpp.

◆ handleDiag()

void canopen::Motor402::handleDiag ( LayerReport report)
protectedvirtual

Implements canopen::Layer.

Definition at line 438 of file motor.cpp.

◆ handleHalt()

void canopen::Motor402::handleHalt ( LayerStatus status)
protectedvirtual

Implements canopen::Layer.

Definition at line 518 of file motor.cpp.

◆ handleInit()

void canopen::Motor402::handleInit ( LayerStatus status)
protectedvirtual

Implements canopen::Layer.

Definition at line 471 of file motor.cpp.

◆ handleRead()

void canopen::Motor402::handleRead ( LayerStatus status,
const LayerState current_state 
)
protectedvirtual

Implements canopen::Layer.

Definition at line 409 of file motor.cpp.

◆ handleRecover()

void canopen::Motor402::handleRecover ( LayerStatus status)
protectedvirtual

Implements canopen::Layer.

Definition at line 534 of file motor.cpp.

◆ handleShutdown()

void canopen::Motor402::handleShutdown ( LayerStatus status)
protectedvirtual

Implements canopen::Layer.

Definition at line 514 of file motor.cpp.

◆ handleWrite()

void canopen::Motor402::handleWrite ( LayerStatus status,
const LayerState current_state 
)
protectedvirtual

Implements canopen::Layer.

Definition at line 414 of file motor.cpp.

◆ isModeSupported()

bool canopen::Motor402::isModeSupported ( uint16_t  mode)
virtual

Implements canopen::MotorBase.

Definition at line 252 of file motor.cpp.

◆ isModeSupportedByDevice()

bool canopen::Motor402::isModeSupportedByDevice ( uint16_t  mode)
privatevirtual

Definition at line 268 of file motor.cpp.

◆ readState()

bool canopen::Motor402::readState ( LayerStatus status,
const LayerState current_state 
)
private

Definition at line 379 of file motor.cpp.

◆ registerDefaultModes()

virtual void canopen::Motor402::registerDefaultModes ( ObjectStorageSharedPtr  storage)
inlinevirtual

Reimplemented from canopen::MotorBase.

Definition at line 324 of file motor.h.

◆ registerMode() [1/2]

template<typename T , typename ... Args>
bool canopen::Motor402::registerMode ( uint16_t  mode,
Args &&...  args 
)
inline

Definition at line 318 of file motor.h.

◆ registerMode() [2/2]

void canopen::Motor402::registerMode ( uint16_t  id,
const ModeSharedPtr m 
)
private

Definition at line 274 of file motor.cpp.

◆ setTarget()

bool canopen::Motor402::setTarget ( double  val)
virtual

Implements canopen::MotorBase.

Definition at line 245 of file motor.cpp.

◆ switchMode()

bool canopen::Motor402::switchMode ( LayerStatus status,
uint16_t  mode 
)
private

Definition at line 291 of file motor.cpp.

◆ switchState()

bool canopen::Motor402::switchState ( LayerStatus status,
const State402::InternalState target 
)
private

Definition at line 359 of file motor.cpp.

Member Data Documentation

◆ control_word_

uint16_t canopen::Motor402::control_word_
private

Definition at line 360 of file motor.h.

◆ control_word_entry_

canopen::ObjectStorage::Entry<uint16_t > canopen::Motor402::control_word_entry_
private

Definition at line 382 of file motor.h.

◆ cw_mutex_

boost::mutex canopen::Motor402::cw_mutex_
private

Definition at line 361 of file motor.h.

◆ map_mutex_

boost::mutex canopen::Motor402::map_mutex_
private

Definition at line 368 of file motor.h.

◆ mode_allocators_

std::unordered_map<uint16_t, AllocFuncType> canopen::Motor402::mode_allocators_
private

Definition at line 371 of file motor.h.

◆ mode_cond_

boost::condition_variable canopen::Motor402::mode_cond_
private

Definition at line 375 of file motor.h.

◆ mode_id_

uint16_t canopen::Motor402::mode_id_
private

Definition at line 374 of file motor.h.

◆ mode_mutex_

boost::mutex canopen::Motor402::mode_mutex_
private

Definition at line 376 of file motor.h.

◆ modes_

std::unordered_map<uint16_t, ModeSharedPtr > canopen::Motor402::modes_
private

Definition at line 369 of file motor.h.

◆ monitor_mode_

const bool canopen::Motor402::monitor_mode_
private

Definition at line 378 of file motor.h.

◆ op_mode_

canopen::ObjectStorage::Entry<int8_t> canopen::Motor402::op_mode_
private

Definition at line 384 of file motor.h.

◆ op_mode_display_

canopen::ObjectStorage::Entry<int8_t> canopen::Motor402::op_mode_display_
private

Definition at line 383 of file motor.h.

◆ selected_mode_

ModeSharedPtr canopen::Motor402::selected_mode_
private

Definition at line 373 of file motor.h.

◆ start_fault_reset_

std::atomic<bool> canopen::Motor402::start_fault_reset_
private

Definition at line 362 of file motor.h.

◆ state_handler_

State402 canopen::Motor402::state_handler_
private

Definition at line 366 of file motor.h.

◆ state_switch_timeout_

const boost::chrono::seconds canopen::Motor402::state_switch_timeout_
private

Definition at line 379 of file motor.h.

◆ status_word_

std::atomic<uint16_t> canopen::Motor402::status_word_
private

Definition at line 359 of file motor.h.

◆ status_word_entry_

canopen::ObjectStorage::Entry<uint16_t> canopen::Motor402::status_word_entry_
private

Definition at line 381 of file motor.h.

◆ supported_drive_modes_

canopen::ObjectStorage::Entry<uint32_t> canopen::Motor402::supported_drive_modes_
private

Definition at line 385 of file motor.h.

◆ switching_state_

const State402::InternalState canopen::Motor402::switching_state_
private

Definition at line 377 of file motor.h.

◆ target_state_

std::atomic<State402::InternalState> canopen::Motor402::target_state_
private

Definition at line 363 of file motor.h.


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


canopen_402
Author(s): Thiago de Freitas , Mathias Lüdtke
autogenerated on Mon Feb 28 2022 23:28:06