Skip to content

Commit

Permalink
Merge pull request #3 from iq-motion-control/multiturn_feature_requests
Browse files Browse the repository at this point in the history
Multiturn feature requests
  • Loading branch information
IQ-raf authored Nov 6, 2020
2 parents 3d2d976 + 418a56b commit 4af461f
Show file tree
Hide file tree
Showing 5 changed files with 53 additions and 49 deletions.
32 changes: 32 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
# Prerequisites
*.d

# Compiled Object files
*.slo
*.lo
*.o
*.obj

# Precompiled Headers
*.gch
*.pch

# Compiled Dynamic libraries
*.so
*.dylib
*.dll

# Fortran module files
*.mod
*.smod

# Compiled Static libraries
*.lai
*.la
*.a
*.lib

# Executables
*.exe
*.out
*.app
5 changes: 3 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
![Release Version](release_badge.svg)
![tag](https://img.shields.io/github/v/tag/iq-motion-control/iq-module-communication-cpp)
![release](https://img.shields.io/github/release/iq-motion-control/iq-module-communication-cpp/all.svg)

# C++ API

Expand All @@ -7,7 +8,7 @@ This is the library to control a IQ Motion Control Module with C++
## Getting Started

Add this library to your C++ project to interface with the motors.
Read the programming [documentation](http://iq-control.com/documentation) on our website to learn how to use this library.
Read the programming [documentation](http://iq-control.com/support) on our website to learn how to use this library.
Use our [release page](https://github.com/iq-motion-control/iq-module-communication-cpp/releases) to make sure you are using the latest version

### Prerequisites
Expand Down
16 changes: 4 additions & 12 deletions inc/brushless_drive_client.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
*/
/*
Name: brushless_drive_client.hpp
Last update: 3/7/2019 by Raphael Van Hoffelen
Last update: 2020/11/6 by Matthew Piccoli
Author: Matthew Piccoli
Contributors: Raphael Van Hoffelen
*/
Expand Down Expand Up @@ -64,9 +64,7 @@ class BrushlessDriveClient: public ClientAbstract{
motor_redline_start_( kTypeBrushlessDrive, obj_idn, kSubMotorRedlineStart),
motor_redline_end_( kTypeBrushlessDrive, obj_idn, kSubMotorRedlineEnd),
motor_l_( kTypeBrushlessDrive, obj_idn, kSubMotorL),
derate_( kTypeBrushlessDrive, obj_idn, kSubDerate),
i_soft_start( kTypeBrushlessDrive, obj_idn, kSubISoftStart),
i_soft_end( kTypeBrushlessDrive, obj_idn, kSubISoftEnd)
derate_( kTypeBrushlessDrive, obj_idn, kSubDerate)
{};

// Client Entries
Expand Down Expand Up @@ -108,14 +106,12 @@ class BrushlessDriveClient: public ClientAbstract{
ClientEntry<float> motor_redline_end_;
ClientEntry<float> motor_l_;
ClientEntry<int32_t> derate_;
ClientEntry<float> i_soft_start;
ClientEntry<float> i_soft_end;



void ReadMsg(uint8_t* rx_data, uint8_t rx_length)
{
static const uint8_t kEntryLength = kSubISoftEnd+1;
static const uint8_t kEntryLength = kSubDerate+1;
ClientEntryAbstract* entry_array[kEntryLength] = {
&drive_mode_, // 0
&drive_phase_pwm_, // 1
Expand Down Expand Up @@ -158,9 +154,7 @@ class BrushlessDriveClient: public ClientAbstract{
&motor_redline_start_, // 38
&motor_redline_end_, // 39
&motor_l_, // 40
&derate_, // 41
&i_soft_start, // 42
&i_soft_end // 43
&derate_ // 41
};

ParseMsg(rx_data, rx_length, entry_array, kEntryLength);
Expand Down Expand Up @@ -198,8 +192,6 @@ class BrushlessDriveClient: public ClientAbstract{
static const uint8_t kSubMotorRedlineEnd = 39;
static const uint8_t kSubMotorL = 40;
static const uint8_t kSubDerate = 41;
static const uint8_t kSubISoftStart = 42;
static const uint8_t kSubISoftEnd = 43;
};

#endif /* BRUSHLESS_DRIVE_CLIENT_HPP_ */
19 changes: 14 additions & 5 deletions inc/multi_turn_angle_control_client.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@

/*
Name: multi_turn_angle_control_client.hpp
Last update: 3/7/2019 by Raphael Van Hoffelen
Last update: 2020/11/6 by Matthew Piccoli
Author: Matthew Piccoli
Contributors: Raphael Van Hoffelen
*/
Expand Down Expand Up @@ -60,12 +60,14 @@ class MultiTurnAngleControlClient: public ClientAbstract{
trajectory_duration_( kTypeAngleMotorControl, obj_idn, kSubTrajectoryDuration),
trajectory_linear_displacement_( kTypeAngleMotorControl, obj_idn, kSubTrajectoryLinearDisplacement),
trajectory_linear_velocity_( kTypeAngleMotorControl, obj_idn, kSubTrajectoryLinearVelocity),
trajectory_linear_acceleration_( kTypeAngleMotorControl, obj_idn, kSubTrajectoryLinearAcceleration)
trajectory_linear_acceleration_( kTypeAngleMotorControl, obj_idn, kSubTrajectoryLinearAcceleration),
trajectory_average_speed_( kTypeAngleMotorControl, obj_idn, kSubTrajectoryAverageSpeed),
trajectory_queue_mode_( kTypeAngleMotorControl, obj_idn, kSubTrajectoryQueueMode)
{};

// Client Entries
// Control commands
ClientEntry<uint8_t> ctrl_mode_;
ClientEntry<int8_t> ctrl_mode_;
ClientEntryVoid ctrl_brake_;
ClientEntryVoid ctrl_coast_;
ClientEntry<float> ctrl_pwm_;
Expand Down Expand Up @@ -97,10 +99,13 @@ class MultiTurnAngleControlClient: public ClientAbstract{
ClientEntry<float> trajectory_linear_displacement_;
ClientEntry<float> trajectory_linear_velocity_;
ClientEntry<float> trajectory_linear_acceleration_;
ClientEntry<float> trajectory_average_speed_;
ClientEntry<int8_t> trajectory_queue_mode_;


void ReadMsg(uint8_t* rx_data, uint8_t rx_length)
{
static const uint8_t kEntryLength = kSubTrajectoryLinearAcceleration+1;
static const uint8_t kEntryLength = kSubTrajectoryQueueMode+1;
ClientEntryAbstract* entry_array[kEntryLength] = {
&ctrl_mode_, // 0
&ctrl_brake_, // 1
Expand All @@ -127,7 +132,9 @@ class MultiTurnAngleControlClient: public ClientAbstract{
&trajectory_duration_, // 22
&trajectory_linear_displacement_, // 23
&trajectory_linear_velocity_, // 24
&trajectory_linear_acceleration_ // 25
&trajectory_linear_acceleration_, // 25
&trajectory_average_speed_, // 26
&trajectory_queue_mode_ // 27
};

ParseMsg(rx_data, rx_length, entry_array, kEntryLength);
Expand Down Expand Up @@ -160,6 +167,8 @@ class MultiTurnAngleControlClient: public ClientAbstract{
static const uint8_t kSubTrajectoryLinearDisplacement = 23;
static const uint8_t kSubTrajectoryLinearVelocity = 24;
static const uint8_t kSubTrajectoryLinearAcceleration = 25;
static const uint8_t kSubTrajectoryAverageSpeed = 26;
static const uint8_t kSubTrajectoryQueueMode = 27;
};


Expand Down
30 changes: 0 additions & 30 deletions release_badge.svg

This file was deleted.

0 comments on commit 4af461f

Please sign in to comment.