Skip to content

Commit 113d566

Browse files
author
Taehun Lim
authored
Merge pull request #106 from ROBOTIS-GIT/develop
fixed opencr_ld and add parameter to ros serial
2 parents df6f6dc + 5aee998 commit 113d566

File tree

82 files changed

+2456
-299
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

82 files changed

+2456
-299
lines changed

arduino/opencr_arduino/opencr/cores/arduino/Print.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -191,7 +191,7 @@ size_t Print::println(const Printable& x)
191191
return n;
192192
}
193193

194-
size_t Print::printf(char *fmt, ... )
194+
size_t Print::printf(const char *fmt, ... )
195195
{
196196
char buf[256]; // resulting string limited to 128 chars
197197
char buf_out[256];

arduino/opencr_arduino/opencr/cores/arduino/Print.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ class Print
8181
size_t println(const Printable&);
8282
size_t println(void);
8383

84-
size_t printf(char *fmt, ... );
84+
size_t printf(const char *fmt, ... );
8585

8686
};
8787

arduino/opencr_arduino/opencr/libraries/I2Cdev/I2Cdev.cpp

+3-3
Original file line numberDiff line numberDiff line change
@@ -70,9 +70,9 @@ void I2Cdev::begin( uint32_t freq )
7070
#if I2CDEV_IMPLEMENTATION == I2CDEV_BUILTIN_FASTWIRE
7171
I2cHandle.Instance = I2C1;
7272

73-
if ( freq == 400 ) I2cHandle.Init.Timing = 0x40940607; //0x4 0 9 1 27 32;
74-
else if( freq == 100 ) I2cHandle.Init.Timing = 0x40912732;
75-
else I2cHandle.Init.Timing = 0x40940607; //0x4 0 9 1 27 32;
73+
if ( freq == 400 ) I2cHandle.Init.Timing = 0x6000030D; //0x4 0 9 1 27 32;
74+
else if( freq == 100 ) I2cHandle.Init.Timing = 0x20404768;
75+
else I2cHandle.Init.Timing = 0x6000030D; //0x4 0 9 1 27 32;
7676

7777

7878
I2cHandle.Init.OwnAddress1 = 0x00;

arduino/opencr_arduino/opencr/libraries/OpenCR/examples/07. DynamixelSDK/dxl_monitor/dxl_monitor.ino

+1-2
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,7 @@
77
#define PROTOCOL_VERSION2 2.0
88

99
// Default setting
10-
#define DEVICENAME "/dev/OpenCR" // Check which port is being used on your controller
11-
// ex) Windows: "COM1" Linux: "/dev/ttyUSB0"
10+
#define DEVICENAME "OpenCR_DXL_Port" // This definition only has a symbolic meaning and does not affect to any functionality
1211

1312

1413
#define CMD_SERIAL Serial // USB Serial

arduino/opencr_arduino/opencr/libraries/OpenCR/examples/07. DynamixelSDK/protocol1.0/bulk_read/bulk_read.ino

+1-2
Original file line numberDiff line numberDiff line change
@@ -60,8 +60,7 @@
6060
#define DXL1_ID 1 // Dynamixel#1 ID: 1
6161
#define DXL2_ID 2 // Dynamixel#2 ID: 2
6262
#define BAUDRATE 57600
63-
#define DEVICENAME "1" // Check which port is being used on your controller
64-
// ex) Windows: "COM1" Linux: "/dev/ttyUSB0" Mac: "/dev/tty.usbserial-*"
63+
#define DEVICENAME "OpenCR_DXL_Port" // This definition only has a symbolic meaning and does not affect to any functionality
6564

6665
#define TORQUE_ENABLE 1 // Value for enabling the torque
6766
#define TORQUE_DISABLE 0 // Value for disabling the torque

arduino/opencr_arduino/opencr/libraries/OpenCR/examples/07. DynamixelSDK/protocol1.0/ping/ping.ino

+1-1
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@
4848
// Default setting
4949
#define DXL_ID 1 // Dynamixel ID: 1
5050
#define BAUDRATE 57600
51-
#define DEVICENAME "1" // Check which port is being used on your controller
51+
#define DEVICENAME "OpenCR_DXL_Port" // This definition only has a symbolic meaning and does not affect to any functionality
5252

5353
#define CMD_SERIAL Serial
5454

arduino/opencr_arduino/opencr/libraries/OpenCR/examples/07. DynamixelSDK/protocol1.0/read_write/read_write.ino

+1-1
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@
5353
// Default setting
5454
#define DXL_ID 1 // Dynamixel ID: 1
5555
#define BAUDRATE 57600
56-
#define DEVICENAME "1" // Check which port is being used on your controller
56+
#define DEVICENAME "OpenCR_DXL_Port" // This definition only has a symbolic meaning and does not affect to any functionality
5757

5858

5959
#define TORQUE_ENABLE 1 // Value for enabling the torque

arduino/opencr_arduino/opencr/libraries/OpenCR/examples/07. DynamixelSDK/protocol1.0/reset/reset.ino

+1-2
Original file line numberDiff line numberDiff line change
@@ -54,8 +54,7 @@
5454
// Default setting
5555
#define DXL_ID 1 // Dynamixel ID: 1
5656
#define BAUDRATE 57600
57-
#define DEVICENAME "1" // Check which port is being used on your controller
58-
// ex) Windows: "COM1" Linux: "/dev/ttyUSB0" Mac: "/dev/tty.usbserial-*"
57+
#define DEVICENAME "OpenCR_DXL_Port" // This definition only has a symbolic meaning and does not affect to any functionality
5958

6059
#define FACTORYRST_DEFAULTBAUDRATE 57600 // Dynamixel baudrate set by factoryreset
6160
#define NEW_BAUDNUM 1 // New baudnum to recover Dynamixel baudrate as it was

arduino/opencr_arduino/opencr/libraries/OpenCR/examples/07. DynamixelSDK/protocol1.0/sync_write/sync_write.ino

+1-2
Original file line numberDiff line numberDiff line change
@@ -57,8 +57,7 @@
5757
#define DXL1_ID 1 // Dynamixel#1 ID: 1
5858
#define DXL2_ID 2 // Dynamixel#2 ID: 2
5959
#define BAUDRATE 57600
60-
#define DEVICENAME "1" // Check which port is being used on your controller
61-
// ex) Windows: "COM1" Linux: "/dev/ttyUSB0" Mac: "/dev/tty.usbserial-*"
60+
#define DEVICENAME "OpenCR_DXL_Port" // This definition only has a symbolic meaning and does not affect to any functionality
6261

6362
#define TORQUE_ENABLE 1 // Value for enabling the torque
6463
#define TORQUE_DISABLE 0 // Value for disabling the torque

arduino/opencr_arduino/opencr/libraries/OpenCR/examples/07. DynamixelSDK/protocol2.0/broadcast_ping/broadcast_ping.ino

+1-2
Original file line numberDiff line numberDiff line change
@@ -47,8 +47,7 @@
4747

4848
// Default setting
4949
#define BAUDRATE 57600
50-
#define DEVICENAME "1" // Check which port is being used on your controller
51-
50+
#define DEVICENAME "OpenCR_DXL_Port" // This definition only has a symbolic meaning and does not affect to any functionality
5251

5352

5453
void setup()

arduino/opencr_arduino/opencr/libraries/OpenCR/examples/07. DynamixelSDK/protocol2.0/bulk_read_write/bulk_read_write.ino

+1-2
Original file line numberDiff line numberDiff line change
@@ -59,8 +59,7 @@
5959
#define DXL1_ID 1 // Dynamixel#1 ID: 1
6060
#define DXL2_ID 2 // Dynamixel#2 ID: 2
6161
#define BAUDRATE 57600
62-
#define DEVICENAME "1" // Check which port is being used on your controller
63-
// ex) Windows: "COM1" Linux: "/dev/ttyUSB0"
62+
#define DEVICENAME "OpenCR_DXL_Port" // This definition only has a symbolic meaning and does not affect to any functionality
6463

6564
#define TORQUE_ENABLE 1 // Value for enabling the torque
6665
#define TORQUE_DISABLE 0 // Value for disabling the torque

arduino/opencr_arduino/opencr/libraries/OpenCR/examples/07. DynamixelSDK/protocol2.0/factory_reset/factory_reset.ino

+1-1
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@
5454
// Default setting
5555
#define DXL_ID 1 // Dynamixel ID: 1
5656
#define BAUDRATE 57600
57-
#define DEVICENAME "1" // Check which port is being used on your controller
57+
#define DEVICENAME "OpenCR_DXL_Port" // This definition only has a symbolic meaning and does not affect to any functionality
5858

5959
#define FACTORYRST_DEFAULTBAUDRATE 57600 // Dynamixel baudrate set by factoryreset
6060
#define NEW_BAUDNUM 3 // New baudnum to recover Dynamixel baudrate as it was

arduino/opencr_arduino/opencr/libraries/OpenCR/examples/07. DynamixelSDK/protocol2.0/indirect_address/indirect_address.ino

+1-2
Original file line numberDiff line numberDiff line change
@@ -68,8 +68,7 @@
6868
// Default setting
6969
#define DXL_ID 1 // Dynamixel ID: 1
7070
#define BAUDRATE 57600
71-
#define DEVICENAME "1" // Check which port is being used on your controller
72-
// ex) Serial1: "1" Serial2: "2" Serial3: "3"
71+
#define DEVICENAME "OpenCR_DXL_Port" // This definition only has a symbolic meaning and does not affect to any functionality
7372

7473
#define TORQUE_ENABLE 1 // Value for enabling the torque
7574
#define TORQUE_DISABLE 0 // Value for disabling the torque

arduino/opencr_arduino/opencr/libraries/OpenCR/examples/07. DynamixelSDK/protocol2.0/ping/ping.ino

+1-1
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@
4848
// Default setting
4949
#define DXL_ID 1 // Dynamixel ID: 1
5050
#define BAUDRATE 57600
51-
#define DEVICENAME "1" // Check which port is being used on your controller
51+
#define DEVICENAME "OpenCR_DXL_Port" // This definition only has a symbolic meaning and does not affect to any functionality
5252

5353

5454

arduino/opencr_arduino/opencr/libraries/OpenCR/examples/07. DynamixelSDK/protocol2.0/read_write/read_write.ino

+1-2
Original file line numberDiff line numberDiff line change
@@ -53,8 +53,7 @@
5353
// Default setting
5454
#define DXL_ID 1 // Dynamixel ID: 1
5555
#define BAUDRATE 57600
56-
#define DEVICENAME "1" // Check which port is being used on your controller
57-
// ex) Serial1: "1" Serial2: "2" Serial3: "3"
56+
#define DEVICENAME "OpenCR_DXL_Port" // This definition only has a symbolic meaning and does not affect to any functionality
5857

5958
#define TORQUE_ENABLE 1 // Value for enabling the torque
6059
#define TORQUE_DISABLE 0 // Value for disabling the torque

arduino/opencr_arduino/opencr/libraries/OpenCR/examples/07. DynamixelSDK/protocol2.0/reboot/reboot.ino

+1-1
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@
4848
// Default setting
4949
#define DXL_ID 1 // Dynamixel ID: 1
5050
#define BAUDRATE 57600
51-
#define DEVICENAME "1" // Check which port is being used on your controller
51+
#define DEVICENAME "OpenCR_DXL_Port" // This definition only has a symbolic meaning and does not affect to any functionality
5252

5353
#define CMD_SERIAL Serial
5454

arduino/opencr_arduino/opencr/libraries/OpenCR/examples/07. DynamixelSDK/protocol2.0/sync_read_write/sync_read_write.ino

+1-2
Original file line numberDiff line numberDiff line change
@@ -57,8 +57,7 @@
5757
#define DXL1_ID 1 // Dynamixel#1 ID: 1
5858
#define DXL2_ID 2 // Dynamixel#2 ID: 2
5959
#define BAUDRATE 57600
60-
#define DEVICENAME "1" // Check which port is being used on your controller
61-
// ex) Windows: "COM1" Linux: "/dev/ttyUSB0"
60+
#define DEVICENAME "OpenCR_DXL_Port" // This definition only has a symbolic meaning and does not affect to any functionality
6261

6362
#define TORQUE_ENABLE 1 // Value for enabling the torque
6463
#define TORQUE_DISABLE 0 // Value for disabling the torque

arduino/opencr_arduino/opencr/libraries/OpenCR/examples/07. DynamixelSDK/protocol_combined/protocol_combined.ino

+1-2
Original file line numberDiff line numberDiff line change
@@ -63,8 +63,7 @@
6363
#define DXL1_ID 1 // Dynamixel#1 ID: 1
6464
#define DXL2_ID 2 // Dynamixel#2 ID: 2
6565
#define BAUDRATE 57600
66-
#define DEVICENAME "1" // Check which port is being used on your controller
67-
// ex) Windows: "COM1" Linux: "/dev/ttyUSB0" Mac: "/dev/tty.usbserial-*"
66+
#define DEVICENAME "OpenCR_DXL_Port" // This definition only has a symbolic meaning and does not affect to any functionality
6867

6968
#define TORQUE_ENABLE 1 // Value for enabling the torque
7069
#define TORQUE_DISABLE 0 // Value for disabling the torque

arduino/opencr_arduino/opencr/libraries/OpenCR/examples/10. Etc/CAMERA/ov7725_al422b/ov7725_al422b.cpp

-3
Original file line numberDiff line numberDiff line change
@@ -26,9 +26,6 @@ void lcdInit()
2626
{
2727
__SD_CS_DISABLE();
2828
SPI.beginFast();
29-
SPI.setDataMode(SPI_MODE3);
30-
SPI.setBitOrder(MSBFIRST);
31-
SPI.setClockDivider(SPI_CLOCK_DIV4);
3229

3330
TFTLCD.lcd_init();
3431
Tp.tp_init();

arduino/opencr_arduino/opencr/libraries/OpenCR/examples/10. Etc/CAMERA/ov7725_al422b/settings.h

+7-2
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,13 @@
66

77
#define _USE_FULLSCREEN true // true : use 320x240, false : use 160x120
88

9-
#define MIN_OBJECT_PIXEL 3 //Set the object size to detect
10-
#define MAX_OBJECT 50 //maximum number of object to detect
9+
#if _USE_FULLSCREEN == true
10+
#define MIN_OBJECT_PIXEL 5 //Set the object size to detect
11+
#else
12+
#define MIN_OBJECT_PIXEL 3 //Set the object size to detect
13+
#endif
14+
15+
#define MAX_OBJECT 200 //maximum number of object to detect
1116
#define SELECTED_COLOR 0 //0:Red, 1:Blue
1217

1318
//Dynamixel Definition

arduino/opencr_arduino/opencr/libraries/OpenCR/examples/10. Etc/CAMERA/ov7725_al422b/src/tftLcd.cpp

+2-4
Original file line numberDiff line numberDiff line change
@@ -208,12 +208,10 @@ void TFT_LCD::drawFrame(void)
208208
{
209209
lcd_set_cursor(0, 0);
210210
lcd_write_byte(0x22, LCD_CMD);
211-
211+
SPI.beginTransaction(SPISettings(25000000, MSBFIRST, SPI_MODE0));
212212
__LCD_DC_SET();
213213
__LCD_CS_CLR();
214-
215-
SPI.writeFast(image_buf, IMG_WIDTH*IMG_HEIGHT*2);
216-
214+
SPI.transfer(image_buf, NULL, IMG_WIDTH*IMG_HEIGHT*2);
217215
__LCD_CS_SET();
218216
}
219217

Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
/* EventResponder - Simple event-based programming for Arduino
2+
* Copyright 2017 Paul Stoffregen
3+
*
4+
* Permission is hereby granted, free of charge, to any person obtaining
5+
* a copy of this software and associated documentation files (the
6+
* "Software"), to deal in the Software without restriction, including
7+
* without limitation the rights to use, copy, modify, merge, publish,
8+
* distribute, sublicense, and/or sell copies of the Software, and to
9+
* permit persons to whom the Software is furnished to do so, subject to
10+
* the following conditions:
11+
*
12+
* The above copyright notice and this permission notice shall be
13+
* included in all copies or substantial portions of the Software.
14+
*
15+
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
16+
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
17+
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
18+
* NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
19+
* BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
20+
* ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
21+
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
22+
* SOFTWARE.
23+
*/
24+
25+
/* EventResponder is an experimental API, almost certain to
26+
* incompatibly change as it develops. Please understand any
27+
* programs you write now using EventResponder may need to be
28+
* updated as EventResponder develops.
29+
*
30+
* Please post EventResponder post your feedback here:
31+
* https://forum.pjrc.com/threads/44723-Arduino-Events
32+
*/
33+
34+
#include <Arduino.h>
35+
#include "EventResponder.h"
36+
37+
38+
bool EventResponder::clearEvent()
39+
{
40+
bool ret = false;
41+
if (_triggered) {
42+
_triggered = false;
43+
ret = true;
44+
}
45+
return ret;
46+
}
47+

0 commit comments

Comments
 (0)