Skip to content

Commit 948c6e2

Browse files
committed
fix some bugs
1 parent ff97d51 commit 948c6e2

File tree

2 files changed

+21
-6
lines changed

2 files changed

+21
-6
lines changed

quadruped_hardware/src/quad_hardware_control.cpp

Lines changed: 18 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,16 +28,31 @@ void setProcessScheduler()
2828
param.sched_priority = sched_get_priority_max(SCHED_FIFO);
2929
if (sched_setscheduler(pid, SCHED_FIFO, &param) == -1)
3030
{
31-
std::cout << "[ERROR] function setprocessscheduler failed \n ";
31+
std::cout << "[ERROR] function set process scheduler failed \n ";
3232
}
3333
}
3434

35-
int main()
35+
int main(int argc, char **argv)
3636
{
3737
setProcessScheduler();
3838

3939
double dt = 0.001;
40-
int cmd_panel_id = 1; // Wireless=1, keyboard=2
40+
int cmd_panel_id; // Wireless=1, keyboard=2
41+
42+
if (argc > 1) {
43+
if(std::string(argv[1]) == "wireless") {
44+
cmd_panel_id = 1;
45+
} else if(std::string(argv[1]) == "keyboard") {
46+
cmd_panel_id = 2;
47+
} else {
48+
std::cout << "Invalid command panel. Please enter either 'wireless' or 'keyboard'." << std::endl;
49+
return 1;
50+
}
51+
}
52+
else {
53+
cmd_panel_id = 2; // Default to keyboard
54+
}
55+
4156
IOInterface *ioInter;
4257
ManipulationUDP *manipulationIO;
4358

quadruped_sim/scripts/multiRobotSim.yaml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ windows:
66
- shell_command:
77
- roslaunch quadruped_sim world_only.launch
88
shell_command_before:
9-
- source ~/Projects/manipulation_ws/devel/setup.bash
9+
- source $PWD/../../../../devel/setup.bash
1010

1111
- window_name: Robot1
1212
layout: tiled
@@ -18,7 +18,7 @@ windows:
1818
- sleep 6
1919
- rosrun quadruped_sim quad_sim_control $robot_type __ns:=$ns
2020
shell_command_before:
21-
- source ~/Projects/manipulation_ws/devel/setup.bash
21+
- source $PWD/../../../../devel/setup.bash
2222
- export ns=robot_1
2323
- export robot_type=a1
2424
- export x_pos=0.0
@@ -35,7 +35,7 @@ windows:
3535
- sleep 6
3636
- rosrun quadruped_sim quad_sim_control $robot_type __ns:=$ns
3737
shell_command_before:
38-
- source ~/Projects/manipulation_ws/devel/setup.bash
38+
- source $PWD/../../../../devel/setup.bash
3939
- export ns=robot_2
4040
- export robot_type=aliengo
4141
- export x_pos=0.0

0 commit comments

Comments
 (0)