30 namespace canopen_schunk {
38 :
DS402Node(node_id, can_device, heartbeat_monitor)
96 rpdo_mappings.clear();
117 m_sdo.
upload(
false, 0x6064, 0x0, current_position);
119 LOGGING_INFO(CanOpen,
"Initially, node is at position " << current_position <<
endl);
124 bool disable_again =
false;
130 disable_again =
true;
138 while (!calib_ok && counter--)
148 LOGGING_ERROR (CanOpen,
"Commutation of node "<< (
int)(
m_node_id) <<
" could not be ensured after 50 tries! Aborting... You probably should do a recalibration!" <<
endl);
160 #ifdef _IC_BUILDER_ICL_COMM_WEBSOCKET_ 166 #endif // _IC_BUILDER_ICL_COMM_WEBSOCKET_ 175 bool commutation_search_completed =
true;
179 m_sdo.
upload(
false, 0x2050, 0, commutation_status);
181 commutation_search_completed = commutation_status & (1 << 0);
183 return commutation_search_completed;
190 LOGGING_ERROR (CanOpen,
"configureHomingMethod called for a Schunk powerball node (id " <<
192 "However, the powerballs only support one homing mode so this request will be ignored." <<
endl 198 LOGGING_ERROR (CanOpen,
"configureHomingSpeeds called for a Schunk powerball node (id " <<
200 "However, the powerballs do not allow that, so this request will be ignored." <<
endl 205 const int16_t interpolation_type,
206 const uint8_t size_of_data_record)
virtual void configureInterpolationData(const uint8_t buffer_organization=0, const int16_t interpolation_type=0, const uint8_t size_of_data_record=4)
Configure the buffer for the interpolated position mode.
bool CommutationCalibrated()
Checks if the device is already correctly commutated by checking the value of the relevant register e...
CanDevPtr m_can_dev
Device handle for transmission of messages.
virtual void initNode()
Initializes the node and sets the Schunk Default PDO mapping.
void commutationSearch()
Performs a commutation search for a Schunk powerball module.
double m_transmission_factor
std::vector< MappingConfiguration > MappingConfigurationList
The MappingConfigurationList holds multiple Mapping configurations. The Mapping of a single PDO is de...
virtual void initPDOMappingSingle(const PDO::MappingConfigurationList &config, const uint16_t pdo_nr, const PDO::eTransmissionType &transmission_type, const ePDO_TYPE &pdo_type, const bool dummy_mapping=false, const uint8_t cyclic_timeout_cycles=0)
Init PDO mapping with a given mapping configuration for a given pdo nr.
virtual void enableNode(const ds402::eModeOfOperation operation_mode=ds402::MOO_RESERVED_0)
Switches on the device and enters Operation Enabled mode with the given mode. If the requested mode i...
virtual void initNode()
Initializes the node. Tries to query all required data from the device.
#define LOGGING_INFO(streamname, arg)
SDO m_sdo
SDO object for specific calls.
boost::shared_ptr< icl_comm::websocket::WsBroadcaster > m_ws_broadcaster
Interface to send out diagnostics data. Only available if compiled with IC_BUILDER_ICL_COMM_WEBSOCKET...
#define LOGGING_DEBUG(streamname, arg)
bool download(const bool normal_transfer, const uint16_t index, const uint8_t subindex, const std::vector< uint8_t > &usrdata)
Downloads SDO data from the master to the slave (From PC to node).
virtual void initDS402State(const icl_hardware::canopen_schunk::ds402::eState &requested_state)
Initializes a state of the DS402 state machine. Performs all necessary state transitions until the ta...
virtual void configureInterpolationData(const uint8_t buffer_organization=0, const int16_t interpolation_type=0, const uint8_t size_of_data_record=4)
Additionally to the basis implementation this sets a number of cycles that are allowed to be missed b...
SchunkPowerBallNode(const uint8_t node_id, const icl_hardware::canopen_schunk::CanDevPtr &can_device, HeartBeatMonitor::Ptr heartbeat_monitor)
static void sendSync(const CanDevPtr &can_device)
sendSync sends a SYNC message which is used to ensure synchronous processing of all CanOpen nodes...
#define LOGGING_ERROR(streamname, arg)
uint8_t m_node_id
CANOPEN ID of the node.
virtual void setDefaultPDOMapping(const DS402Node::eDefaultPDOMapping mapping)
Choose one of the predefined default mappings. Please see the enum eDefaultPDOMapping for a list of a...
ThreadStream & endl(ThreadStream &stream)
virtual void disableNode()
Puts the device into STATE_SWITCHED_ON mode. If the device was in InterpolatedPositionMode, interpolation will be stopped here, as well.
virtual void configureHomingMethod(const uint8_t homing_method)
Set the device's homing method for a Schunk PowerBall.
bool upload(const bool normal_transfer, const uint16_t index, const uint8_t subindex, std::vector< uint8_t > &uploaded_data)
Uploads data from a slave (node) to a master (PC).
bool setTPDOValue(const std::string &identifier, const T value)
Set the value of a PDO which is mapped to a given identifier.
virtual void configureHomingSpeeds(const uint32_t low_speed, const uint32_t high_speed=0)
Set the speeds for homing for a Schunk PowerBall.
void downloadPDOs()
Downloads all Receive-PDOs of this node to the device.
void start()
start Starts the device by setting the NMT state to operational
virtual bool setModeOfOperation(const ds402::eModeOfOperation op_mode)
Sets and initializes a mode of operation. First it will check whether the device supports the request...
void uploadPDOs()
Uploads all Transmit-PDOs of this node from the device.
Mapping of a PDO. This is basically a description that says where to look in the object dictionary an...
Class that holds devices according to the DS402 (drives and motion control) specification.
static const double RAD_TO_STEPS_FACTOR
This factor will be used to convert RAD numbers into encoder ticks.
NMT m_nmt
Object to handle NMT calls and status.
int usleep(unsigned long useconds)