File tree 11 files changed +111
-40
lines changed
11 files changed +111
-40
lines changed Original file line number Diff line number Diff line change 12
12
</node >
13
13
14
14
<!-- GPS injector serial messages generator and switcher -->
15
- <node pkg =" gps_injection" type =" gps_injection_node" name =" gps"
16
- output =" screen"
17
- clear_params =" false"
18
- respawn =" true"
19
- respawn_delay =" 30" >
20
- </node >
15
+ <node pkg =" gps_injection" type =" gps_injection_node" name =" gps" output =" screen" />
21
16
22
17
<!-- Mavlink driver to listen to switch for GPS source switching -->
23
18
<include file =" $(find gps_injection)/launch/mavros.launch" >
Original file line number Diff line number Diff line change @@ -4,8 +4,22 @@ project(runs)
4
4
find_package (catkin REQUIRED COMPONENTS
5
5
roscpp
6
6
rospy
7
+ image_transport
8
+ std_msgs
9
+ cv_bridge
10
+ sensor_msgs
7
11
)
8
12
9
13
catkin_package()
10
14
11
- include_directories (${catkin_INCLUDE_DIRS} )
15
+ include_directories (${catkin_INCLUDE_DIRS} )
16
+
17
+ # Node for monocular-inertial2 camera
18
+ add_executable (color2gray
19
+ src/color2gray.cc
20
+ )
21
+
22
+ target_link_libraries (color2gray
23
+ ${LIBS}
24
+ ${catkin_LIBRARIES}
25
+ )
Original file line number Diff line number Diff line change 4
4
<!-- START SENSORS -->
5
5
<include file =" $(find runs)/launch/subsystems/sensors.launch" />
6
6
7
- <!-- REALSENSE CAMERA -->
8
- <include file =" $(find runs)/launch/subsystems/rs_d435i_rgbi.launch" />
7
+ <!-- START REALSENSE CAMERA -->
8
+ <include file =" $(find runs)/launch/subsystems/rs_d435i_iri.launch" />
9
+
10
+ <!-- START PI CAMERA MODULE -->
11
+ <include file =" $(find runs)/launch/subsystems/pi_camera.launch" />
12
+
13
+ <!-- START GPS injector (so we can get 3D fix while flying) -->
14
+ <node pkg =" gps_injection" type =" gps_injection_node" name =" gps" output =" screen" />
9
15
10
16
<!-- RECORD ROSBAG -->
11
17
<node pkg =" rosbag" type =" record" name =" data_capture"
12
18
args =" $(eval 'record --tcpnodelay --buffsize 0 -O /media/usb/rosbags/' + raw_input('Enter rec file name: ') + '.bag
13
19
/camera/imu
14
- /camera/color/image_raw
15
-
16
- /pi_camera/image_raw
17
- /pi_camera/camera_info
20
+ /camera/infra1/image_rect_raw
21
+ /camera/orthogonal
18
22
19
23
/ublox/fix
20
24
/ublox/fix_velocity
21
25
22
26
/mavros/global_position/compass_hdg
23
27
/mavros/global_position/rel_alt
24
- /mavros/imu/static_pressure
25
28
/mavros/imu/data
26
29
')" />
27
-
28
30
</launch >
Original file line number Diff line number Diff line change 1
1
<?xml version =" 1.0" encoding =" UTF-8" ?>
2
2
3
3
<launch >
4
+ <!-- START SENSORS -->
5
+ <include file =" $(find runs)/launch/subsystems/sensors.launch" />
4
6
7
+ <!-- GPS injector and switcher -->
8
+ <node pkg =" gps_injection" type =" gps_injection_node" name =" gps" output =" screen" required =" true" />
9
+
10
+ <!-- MAP GPS LOCATION TO LOCAL -->
11
+ <include file =" $(find gps_data_fusion)/launch/gps_to_local.launch" />
5
12
</launch >
Original file line number Diff line number Diff line change
1
+ <?xml version =" 1.0" encoding =" UTF-8" ?>
2
+
3
+ <launch >
4
+ <node type =" usb_cam_node" pkg =" usb_cam" name =" pi_camera" output =" screen" required =" true" >
5
+ <param name =" video_device" value =" /dev/video6" />
6
+ <param name =" image_width" value =" 1280" />
7
+ <param name =" image_height" value =" 720" />
8
+ <param name =" pixel_format" value =" yuyv" />
9
+ <param name =" framerate" value =" 2" />
10
+ <param name =" focus" value =" 0" />
11
+
12
+ <param name =" camera_info_url" value =" package://runs/camera_info/camerav2_1280x720.yaml" />
13
+ <param name =" camera_name" value =" camerav2_1280x720" />
14
+ </node >
15
+
16
+ <node type =" color2gray" pkg =" runs" name =" pi_camera_grayer" output =" screen" required =" true" >
17
+ <param name =" in" value =" /pi_camera/image_raw" />
18
+ <param name =" out" value =" /camera/orthogonal" />
19
+ </node >
20
+ </launch >
Original file line number Diff line number Diff line change 4
4
<arg name =" enable_gyro" default =" true" />
5
5
<arg name =" enable_accel" default =" true" />
6
6
<arg name =" enable_sync" default =" true" />
7
- <arg name =" initial_reset" default =" true" /> <!-- should be more reliable this way -->
7
+ <arg name =" initial_reset" default =" true" />
8
8
<arg name =" unite_imu_method" default =" linear_interpolation" />
9
9
<arg name =" infra_width" default =" 640" />
10
10
<arg name =" infra_height" default =" 480" />
13
13
<arg name =" infra_fps" default =" 15" />
14
14
15
15
<rosparam >
16
- /camera/stereo_module/emitter_enabled: false
16
+ /camera/stereo_module/emitter_enabled: 0
17
17
</rosparam >
18
18
19
19
<arg name =" depth_width" default =" 640" />
Original file line number Diff line number Diff line change 8
8
<arg name =" enable_gyro" default =" true" />
9
9
<arg name =" enable_accel" default =" true" />
10
10
<arg name =" enable_sync" default =" true" />
11
- <arg name =" initial_reset" default =" true" /> <!-- should be more reliable this way -->
11
+ <arg name =" initial_reset" default =" true" />
12
12
<arg name =" unite_imu_method" default =" linear_interpolation" />
13
13
<arg name =" depth_width" default =" 640" />
14
14
<arg name =" depth_height" default =" 480" />
15
15
<arg name =" enable_depth" default =" true" />
16
16
<arg name =" depth_fps" default =" 15" />
17
17
<arg name =" align_depth" default =" true" />
18
18
19
+ <rosparam >
20
+ /camera/rgb_camera/auto_exposure_priority: false
21
+ </rosparam >
22
+
19
23
<arg name =" serial_no" default =" " />
20
24
<arg name =" json_file_path" default =" " />
21
25
<arg name =" camera" default =" camera" />
Original file line number Diff line number Diff line change 8
8
<arg name =" enable_gyro" default =" true" />
9
9
<arg name =" enable_accel" default =" true" />
10
10
<arg name =" enable_sync" default =" true" />
11
- <arg name =" initial_reset" default =" true" /> <!-- should be more reliable this way -->
11
+ <arg name =" initial_reset" default =" true" />
12
12
<arg name =" unite_imu_method" default =" linear_interpolation" />
13
13
14
14
<rosparam >
15
- /camera/stereo_module/emitter_enabled: false
15
+ /camera/stereo_module/emitter_enabled: 0
16
+ /camera/rgb_camera/auto_exposure_priority: false
16
17
</rosparam >
17
18
18
19
<arg name =" serial_no" default =" " />
Original file line number Diff line number Diff line change 1
1
<?xml version =" 1.0" encoding =" UTF-8" ?>
2
2
3
3
<launch >
4
+ <!-- GPS MODULE -->
5
+ <node pkg =" ublox_gps" type =" ublox_gps" name =" ublox" output =" screen" clear_params =" false" required =" true" >
6
+ <param name =" device" type =" string" value =" /dev/ttyAMA4" />
7
+ <rosparam command =" load" file =" $(find gps_injection)/config/gps_config.yaml" />
8
+ </node >
9
+
4
10
<!-- MAVLINK (FC SENSORS) -->
5
11
<include file =" $(find gps_injection)/launch/mavros.launch" >
6
12
<arg name =" pluginlists_yaml" value =" $(find gps_injection)/launch/apm_pluginlists.yaml" />
16
22
17
23
<node pkg =" rosservice" type =" rosservice" name =" mavros_stream_rate" args =" call /mavros/set_stream_rate 0 10 1"
18
24
launch-prefix =" bash -c 'sleep 6; $0 $@'" />
19
-
20
- <!-- GPS MODULE -->
21
- <node pkg =" ublox_gps" type =" ublox_gps" name =" ublox" output =" screen" clear_params =" false" required =" true" >
22
- <param name =" device" type =" string" value =" /dev/ttyAMA4" />
23
- <rosparam command =" load" file =" $(find gps_injection)/config/gps_config.yaml" />
24
- </node >
25
-
26
- <!-- RASPBERRY PI CAMERA -->
27
- <node type =" usb_cam_node" pkg =" usb_cam" name =" pi_camera" output =" screen" required =" true" >
28
- <param name =" video_device" value =" /dev/video6" />
29
- <param name =" image_width" value =" 1280" />
30
- <param name =" image_height" value =" 720" />
31
- <param name =" pixel_format" value =" yuyv" />
32
- <param name =" framerate" value =" 2" />
33
- <param name =" focus" value =" 0" />
34
-
35
- <param name =" camera_info_url" value =" package://runs/camera_info/camerav2_1280x720.yaml" />
36
- <param name =" camera_name" value =" camerav2_1280x720" />
37
- </node >
38
25
</launch >
Original file line number Diff line number Diff line change 15
15
<build_export_depend >rospy</build_export_depend >
16
16
<exec_depend >roscpp</exec_depend >
17
17
<exec_depend >rospy</exec_depend >
18
-
18
+
19
+ <depend >sensor_msgs</depend >
20
+ <depend >cv_bridge</depend >
21
+ <depend >std_msgs</depend >
22
+ <depend >image_transport</depend >
23
+
19
24
<export >
20
25
</export >
21
26
</package >
Original file line number Diff line number Diff line change
1
+ #include < ros/ros.h>
2
+ #include < image_transport/image_transport.h>
3
+ #include < cv_bridge/cv_bridge.h>
4
+ #include < sensor_msgs/image_encodings.h>
5
+
6
+ image_transport::Publisher image_pub;
7
+
8
+ void imageCb (const sensor_msgs::ImageConstPtr &msg) {
9
+ cv_bridge::CvImageConstPtr cv_ptr;
10
+ try {
11
+ cv_ptr = cv_bridge::toCvShare (msg, sensor_msgs::image_encodings::MONO8);
12
+ } catch (cv_bridge::Exception &e) {
13
+ ROS_ERROR (" cv_bridge exception: %s" , e.what ());
14
+ return ;
15
+ }
16
+ image_pub.publish (cv_ptr->toImageMsg ());
17
+ }
18
+
19
+ int main (int argc, char **argv) {
20
+ ros::init (argc, argv, " color2gray" );
21
+ ros::NodeHandle n;
22
+ ros::NodeHandle nh (" ~" );
23
+
24
+ std::string topic_in;
25
+ nh.getParam (" in" , topic_in);
26
+ std::string topic_out;
27
+ nh.getParam (" out" , topic_out);
28
+
29
+ image_transport::ImageTransport it (n);
30
+ image_transport::Subscriber image_sub = it.subscribe (topic_in, 1 , imageCb);
31
+ image_pub = it.advertise (topic_out, 1 );
32
+
33
+ ros::spin ();
34
+
35
+ return 0 ;
36
+ }
You can’t perform that action at this time.
0 commit comments