mirror of
https://github.com/westonrobot/scout_ros.git
synced 2026-01-12 03:15:01 +08:00
updated launch files and readme
This commit is contained in:
19
NOTE.md
19
NOTE.md
@@ -1,19 +0,0 @@
|
|||||||
```
|
|
||||||
$ sudo apt-get install ros-kinetic-joint-state-controller
|
|
||||||
$ sudo apt-get install ros-kinetic-effort-controllers
|
|
||||||
$ sudo apt-get install ros-kinetic-position-controllers
|
|
||||||
```
|
|
||||||
|
|
||||||
```
|
|
||||||
$ rosrun teleop_twist_keyboard teleop_twist_keyboard.py cmd_vel:=scout_robot/cmd_vel
|
|
||||||
```
|
|
||||||
|
|
||||||
xacro to URDF
|
|
||||||
```
|
|
||||||
$ rosrun xacro xacro scout.urdf.xacro > agilex_scout.urdf
|
|
||||||
```
|
|
||||||
|
|
||||||
URDF to PROTO
|
|
||||||
```
|
|
||||||
$ python urdf2webots.py --input=someRobot.urdf [--output=outputFile] [--box-collision] [--normal]
|
|
||||||
```
|
|
||||||
77
README.md
77
README.md
@@ -4,10 +4,60 @@
|
|||||||
|
|
||||||
* scout_bringup: launch and configuration files to start ROS nodes
|
* scout_bringup: launch and configuration files to start ROS nodes
|
||||||
* scout_base: a ROS wrapper around Scout SDK to monitor and control the robot
|
* scout_base: a ROS wrapper around Scout SDK to monitor and control the robot
|
||||||
|
* scout_sdk: Scout SDK customized for ROS
|
||||||
* scout_msgs: scout related message definitions
|
* scout_msgs: scout related message definitions
|
||||||
* (scout_robot: meta package for the Scout robot ROS packages)
|
* (scout_ros: meta package for the Scout robot ROS packages)
|
||||||
|
|
||||||
## Basic Usage
|
## Communication interface setup
|
||||||
|
|
||||||
|
### Setup CAN-To-USB adapter
|
||||||
|
|
||||||
|
1. Enable gs_usb kernel module
|
||||||
|
|
||||||
|
```
|
||||||
|
$ sudo modprobe gs_usb
|
||||||
|
```
|
||||||
|
|
||||||
|
2. Bringup can device
|
||||||
|
|
||||||
|
```
|
||||||
|
$ sudo ip link set can0 up type can bitrate 500000
|
||||||
|
```
|
||||||
|
|
||||||
|
3. If no error occured during the previous steps, you should be able to see the can device now by using command
|
||||||
|
|
||||||
|
```
|
||||||
|
$ ifconfig -a
|
||||||
|
```
|
||||||
|
|
||||||
|
4. Install and use can-utils to test the hardware
|
||||||
|
|
||||||
|
```
|
||||||
|
$ sudo apt install can-utils
|
||||||
|
```
|
||||||
|
|
||||||
|
5. Testing command
|
||||||
|
|
||||||
|
```
|
||||||
|
# receiving data from can0
|
||||||
|
$ candump can0
|
||||||
|
# send data to can0
|
||||||
|
$ cansend can0 001#1122334455667788
|
||||||
|
```
|
||||||
|
|
||||||
|
Two scripts inside the "scout_bringup/scripts" folder are provided for easy setup. You can run "./setup_can2usb.bash" for the first-time setup and run "./bringup_can2usb.bash" to bring up the device each time you unplug and re-plug the adapter.
|
||||||
|
|
||||||
|
### Setup UART
|
||||||
|
|
||||||
|
Generally your UART2USB cable should be automatically recognized as "/dev/ttyUSB0" or something similar and ready for use. If you get the error "... permission denied ..." when trying to open the port, you need to grant access of the port to your user accout:
|
||||||
|
|
||||||
|
```
|
||||||
|
$ sudo usermod -a -G dialout <username>
|
||||||
|
```
|
||||||
|
|
||||||
|
Replace "<username>" in the above command with your Linux username. You need to re-login to get the change to take effect.
|
||||||
|
|
||||||
|
## Basic usage of the ROS package
|
||||||
|
|
||||||
1. Install dependent ROS packages
|
1. Install dependent ROS packages
|
||||||
|
|
||||||
@@ -32,11 +82,22 @@
|
|||||||
|
|
||||||
* Start the base node
|
* Start the base node
|
||||||
|
|
||||||
```
|
```
|
||||||
$ roslaunch scout_bringup scout_minimal.launch
|
$ roslaunch scout_bringup scout_minimal.launch
|
||||||
```
|
```
|
||||||
|
|
||||||
|
or (if you're using a serial port)
|
||||||
|
|
||||||
|
```
|
||||||
|
$ roslaunch scout_bringup scout_minimal_uart.launch
|
||||||
|
```
|
||||||
|
|
||||||
* Start the keyboard tele-op node
|
* Start the keyboard tele-op node
|
||||||
|
|
||||||
```
|
```
|
||||||
$ roslaunch scout_bringup scout_teleop_keyboard.launch
|
$ roslaunch scout_bringup scout_teleop_keyboard.launch
|
||||||
```
|
```
|
||||||
|
|
||||||
|
**SAFETY PRECAUSION**:
|
||||||
|
|
||||||
|
The default command values of the keyboard teleop node are high, make sure you decrease the speed commands before starting to control the robot with your keyboard! Have your remote controller ready to take over the control whenever necessary.
|
||||||
|
|||||||
@@ -1,17 +0,0 @@
|
|||||||
<launch>
|
|
||||||
<!--
|
|
||||||
<node name="scout_odom" pkg="scout_base" type="scout_base_node" output="screen">
|
|
||||||
<param name="port_name" type="string" value="can0" />
|
|
||||||
|
|
||||||
<param name="odom_frame" type="string" value="odom" />
|
|
||||||
<param name="base_frame" type="string" value="base_link" />
|
|
||||||
|
|
||||||
<param name="simulated_robot" type="bool" value="false" />
|
|
||||||
</node>
|
|
||||||
-->
|
|
||||||
<param name="robot_description" textfile="$(find scout_base)/urdf/agilex_scout.urdf" />
|
|
||||||
|
|
||||||
<node name="robot_state_publisher" pkg="robot_state_publisher" type="robot_state_publisher" />
|
|
||||||
|
|
||||||
<node name="rviz" pkg="rviz" type="rviz" required="true" args="-d $(find scout_viz)/rviz/scout_model.rviz" />
|
|
||||||
</launch>
|
|
||||||
@@ -1,10 +1,22 @@
|
|||||||
<launch>
|
<launch>
|
||||||
|
<!--
|
||||||
|
The robot can be controlled either through CAN bus or UART port. Make sure the hardware
|
||||||
|
interface is set up correctly before attempting to connect to the robot.
|
||||||
|
|
||||||
|
You only need to specify the port name, such as "can0", "/dev/ttyUSB0". The port should
|
||||||
|
operate with the following configuration:
|
||||||
|
|
||||||
|
* CAN bus: 500k
|
||||||
|
* UART: 115200, Parity None, 8-bit Data, 1 Stop Bit
|
||||||
|
-->
|
||||||
|
<arg name="port_name" default="can0" />
|
||||||
|
<arg name="simulated_robot" default="false" />
|
||||||
|
|
||||||
<node name="scout_base_node" pkg="scout_base" type="scout_base_node" output="screen">
|
<node name="scout_base_node" pkg="scout_base" type="scout_base_node" output="screen">
|
||||||
<param name="port_name" type="string" value="can0" />
|
<param name="port_name" type="string" value="$(arg port_name)" />
|
||||||
|
<param name="simulated_robot" type="bool" value="$(arg simulated_robot)" />
|
||||||
|
|
||||||
<param name="odom_frame" type="string" value="odom" />
|
<param name="odom_frame" type="string" value="odom" />
|
||||||
<param name="base_frame" type="string" value="base_link" />
|
<param name="base_frame" type="string" value="base_link" />
|
||||||
|
|
||||||
<param name="simulated_robot" type="bool" value="false" />
|
|
||||||
</node>
|
</node>
|
||||||
</launch>
|
</launch>
|
||||||
|
|||||||
6
scout_base/launch/view_scout_model.launch
Normal file
6
scout_base/launch/view_scout_model.launch
Normal file
@@ -0,0 +1,6 @@
|
|||||||
|
<launch>
|
||||||
|
<param name="robot_description" textfile="$(find scout_base)/urdf/agilex_scout.urdf" />
|
||||||
|
<node name="robot_state_publisher" pkg="robot_state_publisher" type="robot_state_publisher" />
|
||||||
|
|
||||||
|
<node name="rviz" pkg="rviz" type="rviz" required="true" args="-d $(find scout_viz)/rviz/scout_model.rviz" />
|
||||||
|
</launch>
|
||||||
@@ -16,18 +16,28 @@ int main(int argc, char **argv)
|
|||||||
ros::init(argc, argv, "scout_odom");
|
ros::init(argc, argv, "scout_odom");
|
||||||
ros::NodeHandle node(""), private_node("~");
|
ros::NodeHandle node(""), private_node("~");
|
||||||
|
|
||||||
// instantiate a robot
|
// instantiate a robot object
|
||||||
ScoutBase robot;
|
ScoutBase robot;
|
||||||
ScoutROSMessenger messenger(&robot, &node);
|
ScoutROSMessenger messenger(&robot, &node);
|
||||||
|
|
||||||
std::string scout_can_port;
|
// fetch parameters before connecting to robot
|
||||||
private_node.param<std::string>("port_name", scout_can_port, std::string("can0"));
|
std::string port_name;
|
||||||
|
private_node.param<std::string>("port_name", port_name, std::string("can0"));
|
||||||
private_node.param<std::string>("odom_frame", messenger.odom_frame_, std::string("odom"));
|
private_node.param<std::string>("odom_frame", messenger.odom_frame_, std::string("odom"));
|
||||||
private_node.param<std::string>("base_frame", messenger.base_frame_, std::string("base_link"));
|
private_node.param<std::string>("base_frame", messenger.base_frame_, std::string("base_link"));
|
||||||
private_node.param<bool>("simulated_robot", messenger.simulated_robot_, false);
|
private_node.param<bool>("simulated_robot", messenger.simulated_robot_, false);
|
||||||
|
|
||||||
// connect to scout and setup ROS subscription
|
// connect to robot and setup ROS subscription
|
||||||
robot.Connect(scout_can_port);
|
if (port_name.find("can") != std::string::npos)
|
||||||
|
{
|
||||||
|
robot.Connect(port_name);
|
||||||
|
ROS_INFO("Using CAN bus to talk with the robot");
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
robot.Connect(port_name, 115200);
|
||||||
|
ROS_INFO("Using UART to talk with the robot");
|
||||||
|
}
|
||||||
messenger.SetupSubscription();
|
messenger.SetupSubscription();
|
||||||
|
|
||||||
// publish robot state at 20Hz while listening to twist commands
|
// publish robot state at 20Hz while listening to twist commands
|
||||||
|
|||||||
@@ -154,7 +154,7 @@ include_directories(
|
|||||||
## Install ##
|
## Install ##
|
||||||
#############
|
#############
|
||||||
|
|
||||||
install(DIRECTORY launch
|
install(DIRECTORY launch scripts
|
||||||
DESTINATION ${CATKIN_PACKAGE_SHARE_DESTINATION})
|
DESTINATION ${CATKIN_PACKAGE_SHARE_DESTINATION})
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -1,3 +1,6 @@
|
|||||||
<launch>
|
<launch>
|
||||||
<include file="$(find scout_base)/launch/scout_base.launch" />
|
<include file="$(find scout_base)/launch/scout_base.launch" >
|
||||||
|
<arg name="port_name" default="can0" />
|
||||||
|
<arg name="simulated_robot" default="false" />
|
||||||
|
</include>
|
||||||
</launch>
|
</launch>
|
||||||
6
scout_bringup/launch/scout_minimal_uart.launch
Normal file
6
scout_bringup/launch/scout_minimal_uart.launch
Normal file
@@ -0,0 +1,6 @@
|
|||||||
|
<launch>
|
||||||
|
<include file="$(find scout_base)/launch/scout_base.launch" >
|
||||||
|
<arg name="port_name" value="/dev/ttyUSB0" />
|
||||||
|
<arg name="simulated_robot" value="false" />
|
||||||
|
</include>
|
||||||
|
</launch>
|
||||||
4
scout_bringup/scripts/bringup_can2usb.bash
Executable file
4
scout_bringup/scripts/bringup_can2usb.bash
Executable file
@@ -0,0 +1,4 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
# bring up can interface
|
||||||
|
sudo ip link set can0 up type can bitrate 500000
|
||||||
10
scout_bringup/scripts/setup_can2usb.bash
Executable file
10
scout_bringup/scripts/setup_can2usb.bash
Executable file
@@ -0,0 +1,10 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
# enable kernel module: gs_usb
|
||||||
|
sudo modprobe gs_usb
|
||||||
|
|
||||||
|
# bring up can interface
|
||||||
|
sudo ip link set can0 up type can bitrate 500000
|
||||||
|
|
||||||
|
# install can utils
|
||||||
|
sudo apt install -y can-utils
|
||||||
Reference in New Issue
Block a user