Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
B
battery_driver
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
humanoides
battery_driver
Commits
e1b920ef
Commit
e1b920ef
authored
8 years ago
by
Sergi Hernandez
Browse files
Options
Downloads
Patches
Plain Diff
Updated to version 2 of the dynamixel protocol.
Updated to the new version of the dynamixel library.
parent
fa01a342
No related branches found
No related tags found
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
src/battery_charger.cpp
+4
-4
4 additions, 4 deletions
src/battery_charger.cpp
src/battery_charger.h
+2
-2
2 additions, 2 deletions
src/battery_charger.h
src/examples/battery_charger_test.cpp
+1
-1
1 addition, 1 deletion
src/examples/battery_charger_test.cpp
with
7 additions
and
7 deletions
src/battery_charger.cpp
+
4
−
4
View file @
e1b920ef
...
@@ -6,11 +6,11 @@
...
@@ -6,11 +6,11 @@
CBattery_Charger
::
CBattery_Charger
(
std
::
string
&
battery_id
,
unsigned
char
bus_id
,
int
baudrate
,
unsigned
char
dev_id
)
CBattery_Charger
::
CBattery_Charger
(
std
::
string
&
battery_id
,
unsigned
char
bus_id
,
int
baudrate
,
unsigned
char
dev_id
)
{
{
this
->
dyn_server
=
CDynamixelServer
::
instance
();
this
->
dyn_server
=
CDynamixelServer
FTDI
::
instance
();
this
->
dyn_device
=
NULL
;
this
->
dyn_device
=
NULL
;
try
{
try
{
this
->
dyn_server
->
config_bus
(
bus_id
,
baudrate
);
this
->
dyn_server
->
config_bus
(
bus_id
,
baudrate
);
this
->
dyn_device
=
this
->
dyn_server
->
get_device
(
dev_id
);
this
->
dyn_device
=
this
->
dyn_server
->
get_device
(
dev_id
,
dyn_version2
);
this
->
battery_id
=
battery_id
;
this
->
battery_id
=
battery_id
;
}
catch
(
CException
&
e
){
}
catch
(
CException
&
e
){
/* handle exceptions */
/* handle exceptions */
...
@@ -23,11 +23,11 @@ CBattery_Charger::CBattery_Charger(std::string& battery_id,unsigned char bus_id,
...
@@ -23,11 +23,11 @@ CBattery_Charger::CBattery_Charger(std::string& battery_id,unsigned char bus_id,
CBattery_Charger
::
CBattery_Charger
(
std
::
string
&
battery_id
,
std
::
string
&
bus_id
,
int
baudrate
,
unsigned
char
dev_id
)
CBattery_Charger
::
CBattery_Charger
(
std
::
string
&
battery_id
,
std
::
string
&
bus_id
,
int
baudrate
,
unsigned
char
dev_id
)
{
{
this
->
dyn_server
=
CDynamixelServer
::
instance
();
this
->
dyn_server
=
CDynamixelServer
FTDI
::
instance
();
this
->
dyn_device
=
NULL
;
this
->
dyn_device
=
NULL
;
try
{
try
{
this
->
dyn_server
->
config_bus
(
bus_id
,
baudrate
);
this
->
dyn_server
->
config_bus
(
bus_id
,
baudrate
);
this
->
dyn_device
=
this
->
dyn_server
->
get_device
(
dev_id
);
this
->
dyn_device
=
this
->
dyn_server
->
get_device
(
dev_id
,
dyn_version2
);
this
->
battery_id
=
battery_id
;
this
->
battery_id
=
battery_id
;
}
catch
(
CException
&
e
){
}
catch
(
CException
&
e
){
/* handle exceptions */
/* handle exceptions */
...
...
This diff is collapsed.
Click to expand it.
src/battery_charger.h
+
2
−
2
View file @
e1b920ef
#ifndef _BATTERY_CHARGER_H
#ifndef _BATTERY_CHARGER_H
#define _BATTERY_CHARGER_H
#define _BATTERY_CHARGER_H
#include
"dynamixelserver.h"
#include
"dynamixelserver
_ftdi
.h"
#include
"dynamixel.h"
#include
"dynamixel.h"
#include
"threadserver.h"
#include
"threadserver.h"
#include
"eventserver.h"
#include
"eventserver.h"
...
@@ -38,7 +38,7 @@ class CBattery_Charger
...
@@ -38,7 +38,7 @@ class CBattery_Charger
{
{
private:
private:
std
::
string
battery_id
;
std
::
string
battery_id
;
CDynamixelServer
*
dyn_server
;
CDynamixelServer
FTDI
*
dyn_server
;
CDynamixel
*
dyn_device
;
CDynamixel
*
dyn_device
;
protected:
protected:
void
check_model
(
void
);
void
check_model
(
void
);
...
...
This diff is collapsed.
Click to expand it.
src/examples/battery_charger_test.cpp
+
1
−
1
View file @
e1b920ef
...
@@ -14,7 +14,7 @@ int main(int argc, char *argv[])
...
@@ -14,7 +14,7 @@ int main(int argc, char *argv[])
int
i
=
0
;
int
i
=
0
;
try
{
try
{
CBattery_Charger
battery
(
battery_name
,
battery_serial
,
576
00
,
0xC0
);
CBattery_Charger
battery
(
battery_name
,
battery_serial
,
10000
00
,
0xC0
);
battery
.
get_buzzer_config
(
&
buzzer
);
battery
.
get_buzzer_config
(
&
buzzer
);
std
::
cout
<<
"Buzzer frequency: "
<<
buzzer
.
freq_hz
<<
" Hz"
<<
std
::
endl
;
std
::
cout
<<
"Buzzer frequency: "
<<
buzzer
.
freq_hz
<<
" Hz"
<<
std
::
endl
;
std
::
cout
<<
"Buzzer time on: "
<<
buzzer
.
time_on_s
<<
" s"
<<
std
::
endl
;
std
::
cout
<<
"Buzzer time on: "
<<
buzzer
.
time_on_s
<<
" s"
<<
std
::
endl
;
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment