Skip to content

Commit

Permalink
Merge pull request #60 from ROBOTIS-GIT/develop
Browse files Browse the repository at this point in the history
Develop
  • Loading branch information
ROBOTIS-Will authored Apr 9, 2021
2 parents 2634a23 + 5d64d4b commit 73c4d67
Show file tree
Hide file tree
Showing 8 changed files with 38 additions and 42 deletions.
23 changes: 23 additions & 0 deletions .github/workflows/dynamixel2arduino_ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
name: dynamixel2arduino_ci

on:
push:
branches: [ master, develop ]
pull_request:
branches: [ master, develop ]

jobs:
dynamixel2arduino_ci:
runs-on: ubuntu-latest
strategy:
fail-fast: false
steps:
- uses: actions/checkout@v2
- name: Run Arduino CI Script
run: |
source <(curl -SLs https://raw.githubusercontent.com/ROBOTIS-GIT/Dynamixel2Arduino/master/install.sh) ${{github.ref}}
build_platform opencr
build_platform uno
build_platform mega2560
build_platform mkrzero
build_platform portenta
26 changes: 0 additions & 26 deletions .travis.yml

This file was deleted.

15 changes: 8 additions & 7 deletions examples/advanced/sync_read_write_raw/sync_read_write_raw.ino
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@


/* syncRead
DYNAMIXEL PROTOCOL 1.0 does NOT support Sync Read feature.
Structures containing the necessary information to process the 'syncRead' packet.
typedef struct XELInfoBulkRead{
Expand All @@ -68,6 +69,7 @@
*/

/* syncWrite
DYNAMIXEL PROTOCOL 1.0 supports Control Table address up to 255.
Structures containing the necessary information to process the 'syncWrite' packet.
typedef struct XELInfoBulkWrite{
Expand All @@ -85,6 +87,8 @@
} __attribute__((packed)) InfoBulkWriteInst_t;
*/

const uint8_t BROADCAST_ID = 254;
const float DYNAMIXEL_PROTOCOL_VERSION = 2.0;
const uint8_t DXL_ID_CNT = 2;
const uint8_t DXL_ID_LIST[DXL_ID_CNT] = {1, 2};
const uint16_t user_pkt_buf_cap = 128;
Expand Down Expand Up @@ -123,12 +127,13 @@ void setup() {
pinMode(LED_BUILTIN, OUTPUT);
DEBUG_SERIAL.begin(115200);
dxl.begin(57600);
dxl.setPortProtocolVersion(DYNAMIXEL_PROTOCOL_VERSION);

for(i=0; i<DXL_ID_CNT; i++){
dxl.torqueOff(DXL_ID_LIST[i]);
dxl.setOperatingMode(DXL_ID_LIST[i], OP_VELOCITY);
dxl.torqueOn(DXL_ID_LIST[i]);
}
dxl.torqueOn(BROADCAST_ID);

// Fill the members of structure to syncRead using external user packet buffer
sr_infos.packet.p_buf = user_pkt_buf;
Expand Down Expand Up @@ -170,8 +175,8 @@ void loop() {
static uint32_t try_count = 0;
uint8_t i, recv_cnt;

for(i=0; i<DXL_ID_CNT; i++){
sw_data[i].goal_velocity+=5;
for(i = 0; i < DXL_ID_CNT; i++){
sw_data[i].goal_velocity = 5 + sw_data[i].goal_velocity;
if(sw_data[i].goal_velocity >= 200){
sw_data[i].goal_velocity = 0;
}
Expand Down Expand Up @@ -214,7 +219,3 @@ void loop() {
digitalWrite(LED_BUILTIN, !digitalRead(LED_BUILTIN));
delay(750);
}




4 changes: 2 additions & 2 deletions install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ fi
# this will be eval'd in the functions below because arrays can't be exported
# For creating a new main platform, please refer to https://arduino.github.io/arduino-cli/latest/platform-specification/#hardware-folders-structure
# and https://arduino.github.io/arduino-cli/latest/platform-specification/#boardstxt
export MAIN_PLATFORMS='declare -A main_platforms=([uno]="arduino:avr:uno" [mega2560]="arduino:avr:mega:cpu=atmega2560" [leonardo]="arduino:avr:leonardo" [due]="arduino:sam:arduino_due_x" [zero]="arduino:samd:arduino_zero_native" [mzero]="arduino:samd:mzero_bl" [mzeropro]="arduino:samd:mzero_pro_bl" [mkrzero]="arduino:samd:mkrzero" [mkr1000]="arduino:samd:mkr1000" [mkrwifi1010]="arduino:samd:mkrwifi1010" [opencr]="OpenCR:OpenCR:OpenCR" [portenta]="arduino:mbed:envie_m7")'
export MAIN_PLATFORMS='declare -A main_platforms=([uno]="arduino:avr:uno" [mega2560]="arduino:avr:mega:cpu=atmega2560" [leonardo]="arduino:avr:leonardo" [due]="arduino:sam:arduino_due_x" [zero]="arduino:samd:arduino_zero_native" [mzero]="arduino:samd:mzero_bl" [mzeropro]="arduino:samd:mzero_pro_bl" [mkrzero]="arduino:samd:mkrzero" [mkr1000]="arduino:samd:mkr1000" [mkrwifi1010]="arduino:samd:mkrwifi1010" [opencr]="OpenCR:OpenCR:OpenCR" [portenta]="arduino:mbed_portenta:envie_m7")'

# make display available for arduino CLI
/sbin/start-stop-daemon --start --quiet --pidfile /tmp/custom_xvfb_1.pid --make-pidfile --background --exec /usr/bin/Xvfb -- :1 -ac -screen 0 1280x1024x16
Expand Down Expand Up @@ -55,7 +55,7 @@ DEPENDENCY_OUTPUT=$(arduino --install-boards arduino:samd 2>&1)
if [ $? -ne 0 ]; then echo -e "\xe2\x9c\x96"; else echo -e "\xe2\x9c\x93"; fi

echo -n "INSTALL Portenta H7: "
DEPENDENCY_OUTPUT=$(arduino --install-boards arduino:mbed 2>&1)
DEPENDENCY_OUTPUT=$(arduino --install-boards arduino:mbed_portenta 2>&1)
if [ $? -ne 0 ]; then echo -e "\xe2\x9c\x96"; else echo -e "\xe2\x9c\x93"; fi

echo -n "INSTALL OpenCR: "
Expand Down
2 changes: 1 addition & 1 deletion library.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name=Dynamixel2Arduino
version=0.4.6
version=0.4.7
author=ROBOTIS
license=Apache-2.0
maintainer=Will Son(willson@robotis.com)
Expand Down
7 changes: 2 additions & 5 deletions src/dxl_c/protocol.c
Original file line number Diff line number Diff line change
@@ -1,10 +1,7 @@
#include "protocol.h"

#if defined(ARDUINO)
#include <Arduino.h>
#if !defined(ESP_PLATFORM) && !defined(ARDUINO_ARCH_MBED) && !defined(ARDUINO_ARCH_SAMD)
#include <avr/pgmspace.h>
#endif
#if !defined(ESP_PLATFORM) && !defined(ARDUINO_ARCH_MBED_PORTENTA) && !defined(ARDUINO_ARCH_SAMD)
#include <avr/pgmspace.h>
#endif

#if !defined(PROGMEM)
Expand Down
1 change: 1 addition & 0 deletions src/dxl_c/protocol.h
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
#define DYNAMIXEL_PROTOCOL_H_

#include <stdint.h>
#include <stddef.h>
#include <stdbool.h>

#define DXL_BROADCAST_ID 0xFE
Expand Down
2 changes: 1 addition & 1 deletion src/utility/config.h
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@

#if defined(ARDUINO)
#include <Arduino.h>
#if !defined(ESP_PLATFORM) && !defined(ARDUINO_ARCH_MBED) && !defined(ARDUINO_ARCH_SAMD)
#if !defined(ESP_PLATFORM) && !defined(ARDUINO_ARCH_MBED_PORTENTA) && !defined(ARDUINO_ARCH_SAMD)
#include <avr/pgmspace.h>
#endif
#endif
Expand Down

0 comments on commit 73c4d67

Please sign in to comment.