-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
174649d
commit 24b6c75
Showing
4 changed files
with
88 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
/** | ||
* @Kit : Qt-Creator: Desktop | ||
* @Author : Wang Zhe | ||
* @Date : 2021-04-23 18:20:58 | ||
* @FileName : change_the_mode.cpp | ||
* @Mail : [email protected] | ||
* Copyright : AgileX Robotics (2021) | ||
**/ | ||
#include <memory> | ||
|
||
#include <nav_msgs/Odometry.h> | ||
#include <ros/ros.h> | ||
|
||
#include "ranger_base/ranger_messenger.hpp" | ||
#include "ugv_sdk/ranger_base.hpp" | ||
|
||
using namespace westonrobot; | ||
|
||
std::shared_ptr<RangerBase> robot; | ||
|
||
int main(int argc, char *argv[]) { | ||
// setup ROS node | ||
ros::init(argc, argv, "change_the_mode"); | ||
ros::NodeHandle node(""), private_node("~"); | ||
|
||
// instantiate a robot object | ||
robot = std::make_shared<RangerBase>(); | ||
|
||
robot->Connect("can0"); | ||
robot->EnableCommandedMode(); | ||
|
||
// publish robot state at 50Hz while listening to twist commands | ||
ros::Rate rate(50); | ||
while (ros::ok()) { | ||
ros::spinOnce(); | ||
rate.sleep(); | ||
} | ||
return 0; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
/** | ||
* @Kit : Qt-Creator: Desktop | ||
* @Author : Wang Zhe | ||
* @Date : 2021-04-23 18:20:37 | ||
* @FileName : control_the_car.cpp | ||
* @Mail : [email protected] | ||
* Copyright : AgileX Robotics (2021) | ||
**/ | ||
|
||
#include <memory> | ||
|
||
#include <nav_msgs/Odometry.h> | ||
#include <ros/ros.h> | ||
|
||
#include "ranger_base/ranger_messenger.hpp" | ||
#include "ugv_sdk/ranger_base.hpp" | ||
|
||
using namespace westonrobot; | ||
|
||
std::shared_ptr<RangerBase> robot; | ||
|
||
|
||
int main(int argc, char *argv[]) { | ||
// setup ROS node | ||
ros::init(argc, argv, "control_the_car"); | ||
ros::NodeHandle node(""), private_node("~"); | ||
|
||
// instantiate a robot object | ||
robot = std::make_shared<RangerBase>(); | ||
|
||
robot->Connect("can0"); | ||
robot->EnableCommandedMode(); | ||
|
||
|
||
|
||
|
||
// publish robot state at 50Hz while listening to twist commands | ||
ros::Rate rate(50); | ||
while (ros::ok()) { | ||
ros::spinOnce(); | ||
rate.sleep(); | ||
} | ||
return 0; | ||
} |