Skip to content

Commit

Permalink
Wrap rviz node in class to simplify service handling and add motor pwm
Browse files Browse the repository at this point in the history
param
  • Loading branch information
jgoppert committed Feb 25, 2017
1 parent 4a54ec7 commit 45efb0b
Show file tree
Hide file tree
Showing 6 changed files with 217 additions and 180 deletions.
31 changes: 26 additions & 5 deletions launch/rplidar.launch
Original file line number Diff line number Diff line change
@@ -1,9 +1,30 @@
<launch>
<arg name="serial_port" default="/dev/ttyUSB0"/>
<arg name="serial_baudrate" default="115200"/>
<arg name="frame_id" default="laser"/>
<arg name="inverted" default="false"/>
<arg name="angle_compensate" default="true"/>
<arg name="motor_pwm" default="660"/>
<arg name="rviz" default="false"/>
<arg name="test" default="false"/>

<node name="rplidarNode" pkg="rplidar_ros" type="rplidarNode" output="screen">
<param name="serial_port" type="string" value="/dev/ttyUSB0"/>
<param name="serial_baudrate" type="int" value="115200"/>
<param name="frame_id" type="string" value="laser"/>
<param name="inverted" type="bool" value="false"/>
<param name="angle_compensate" type="bool" value="true"/>
<param name="serial_port" type="string" value="$(arg serial_port)"/>
<param name="serial_baudrate" type="int" value="$(arg serial_baudrate)"/>
<param name="frame_id" type="string" value="$(arg frame_id)"/>
<param name="inverted" type="bool" value="$(arg inverted)"/>
<param name="angle_compensate" type="bool" value="$(arg angle_compensate)"/>
<param name="motor_pwm" type="int" value="$(arg motor_pwm)"/>
</node>

<group if="$(arg rviz)">
<node name="rviz" pkg="rviz" type="rviz" args="-d $(find rplidar_ros)/rviz/rplidar.rviz"/>
</group>

<group if="$(arg test)">
<node name="rplidarNodeClient" pkg="rplidar_ros" type="rplidarNodeClient" output="screen"/>
</group>

</launch>

<!-- vim: set et fenc=utf-8 ff=unix sts=0 sw=2 ts=2 : -->
12 changes: 0 additions & 12 deletions launch/test_rplidar.launch

This file was deleted.

10 changes: 0 additions & 10 deletions launch/view_rplidar.launch

This file was deleted.

2 changes: 1 addition & 1 deletion rviz/rplidar.rviz
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ Visualization Manager:
Size (Pixels): 5
Size (m): 0.03
Style: Squares
Topic: /scan
Topic: /rplidarNode/scan
Use Fixed Frame: true
Use rainbow: true
Value: true
Expand Down
2 changes: 1 addition & 1 deletion src/client.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ int main(int argc, char **argv)
ros::init(argc, argv, "rplidar_node_client");
ros::NodeHandle n;

ros::Subscriber sub = n.subscribe<sensor_msgs::LaserScan>("/scan", 1000, scanCallback);
ros::Subscriber sub = n.subscribe<sensor_msgs::LaserScan>("/rplidarNode/scan", 1000, scanCallback);

ros::spin();

Expand Down
Loading

0 comments on commit 45efb0b

Please sign in to comment.