Skip to content

Commit

Permalink
Merge branch 'develop' of github.com:ROBOTIS-GIT/OpenCR into develop
Browse files Browse the repository at this point in the history
  • Loading branch information
ROBOTIS-Will committed Jan 28, 2022
2 parents d4064e4 + 9b189ef commit f5a21f9
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,10 @@

#define DEBUG_SERIAL SerialBT2

namespace Internal {
static uint16_t dummy_raw_data_;
}

class Turtlebot3Controller
{
public:
Expand All @@ -38,7 +42,7 @@ class Turtlebot3Controller

bool init(float max_lin_vel, float max_ang_vel, uint8_t scale_lin_vel = 1, uint8_t scale_ang_vel = 1);

bool getRCdata(float *get_cmd_vel);
bool getRCdata(float *get_cmd_vel, uint16_t &raw_data = Internal::dummy_raw_data_);

private:
geometry_msgs::Twist cmd_vel_;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ bool Turtlebot3Controller::init(float max_lin_vel, float max_ang_vel, uint8_t sc
return true;
}

bool Turtlebot3Controller::getRCdata(float *get_cmd_vel)
bool Turtlebot3Controller::getRCdata(float *get_cmd_vel, uint16_t &raw_data)
{
uint16_t received_data = 0;
bool clicked_state = false;
Expand All @@ -55,6 +55,8 @@ bool Turtlebot3Controller::getRCdata(float *get_cmd_vel)
if (rc100_.available())
{
received_data = rc100_.readData();
if (&raw_data != &Internal::dummy_raw_data_)
raw_data = received_data;

if (received_data & RC100_BTN_U)
{
Expand Down Expand Up @@ -102,4 +104,4 @@ bool Turtlebot3Controller::getRCdata(float *get_cmd_vel)
}

return clicked_state;
}
}
2 changes: 1 addition & 1 deletion arduino/opencr_arduino/opencr/platform.txt
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ recipe.s.o.pattern="{compiler.path}{compiler.c.cmd}" {compiler.S.flags} -mcpu={b

## Create archives
recipe.ar.pattern="{compiler.path}{compiler.ar.cmd}" {compiler.ar.flags} {compiler.ar.extra_flags} "{archive_file_path}" "{object_file}"
recipe.c.combine.pattern="{compiler.path}{compiler.c.elf.cmd}" {compiler.c.elf.flags} -mcpu={build.mcu} "-T{build.variant.path}/{build.ldscript}" "-Wl,-Map,{build.path}/{build.project_name}.map" {compiler.c.elf.extra_flags} -o "{build.path}/{build.project_name}.elf" "-L{build.path}" -lm -lgcc -mthumb -Wl,--cref -Wl,--check-sections -Wl,--gc-sections -Wl,--unresolved-symbols=report-all -Wl,--warn-common -Wl,--warn-unresolved-symbols -Wl,--start-group {object_files} -Wl,--whole-archive {compiler.libraries.ldflags} "{build.path}/{archive_file}" -Wl,--no-whole-archive -Wl,--end-group
recipe.c.combine.pattern="{compiler.path}{compiler.c.elf.cmd}" {compiler.c.elf.flags} -mcpu={build.mcu} "-T{build.variant.path}/{build.ldscript}" "-Wl,-Map,{build.path}/{build.project_name}.map" {compiler.c.elf.extra_flags} -o "{build.path}/{build.project_name}.elf" "-L{build.path}" -lm -lgcc -mthumb -Wl,--cref -Wl,--check-sections -Wl,--gc-sections -Wl,--unresolved-symbols=report-all -Wl,--warn-common -Wl,--warn-unresolved-symbols -Wl,--start-group {object_files} -Wl,--whole-archive "{build.path}/{archive_file}" -Wl,--no-whole-archive {compiler.libraries.ldflags} -Wl,--end-group

## Create eeprom
recipe.objcopy.eep.pattern=
Expand Down

0 comments on commit f5a21f9

Please sign in to comment.