Skip to content

Commit d78e4ea

Browse files
committed
addind params
1 parent c64ad05 commit d78e4ea

File tree

4 files changed

+59
-5
lines changed

4 files changed

+59
-5
lines changed

launch/acquisition.launch

+1-1
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
<arg name="to_ros" default="true" doc="Flag whether images should be published to ROS" />
2222
<arg name="utstamps" default="false" doc="Flag whether each image should have Unique timestamps vs the master cams time stamp for all" />
2323
<arg name="max_rate_save" default="false" doc="Flag for max rate mode which is when the master triggerst the slaves and saves images at maximum rate possible" />
24-
<arg name="config_file" default="$(find spinnaker_sdk_camera_driver)/params/test_params.yaml" doc="File specifying the parameters of the camera_array"/>
24+
<arg name="config_file" default="$(find spinnaker_sdk_camera_driver)/params/cam_17197558.yaml" doc="File specifying the parameters of the camera_array"/>
2525

2626
<!-- load the acquisition node -->
2727
<node pkg="spinnaker_sdk_camera_driver" type="acquisition_node" name="acquisition_node" output="$(arg output)" launch-prefix="$(arg launch_prefix)" args="">

params/test_params.yaml renamed to params/cam_17197553.yaml

+6-4
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,20 @@
11
cam_ids:
2-
- 17197556
2+
- 17197553
33
cam_aliases:
44
- cam0
5-
master_cam: 17197556
5+
master_cam: 17197553
66
skip: 5
77
delay: 0
88

99
#Camera info message details
1010
distortion_model: plumb_bob
1111
distortion_coeffs:
12-
- [-0.17465, 0.03501, 0.00064, -0.00036]
12+
- [-0.22001, 0.16693, 0.00261, -0.00099, 0.00000]
13+
#- [-0.17465, 0.03501, 0.00064, -0.00036]
1314
#specified as [fx 0 cx 0 fy cy 0 0 1]
1415
intrinsic_coeffs:
15-
- [638.71023, 0.0, 315.25919, 0.0, 641.21041, 248.26077, 0.0, 0.0, 1.0]
16+
- [1278.71483, 0.0, 623.08283, 0.0, 1284.06247, 515.71835, 0.0, 0.0, 1.0]
17+
#- [638.71023, 0.0, 315.25919, 0.0, 641.21041, 248.26077, 0.0, 0.0, 1.0]
1618

1719
# Assign all the follwing via launch file to prevent confusion and conflict
1820

params/cam_17197558.yaml

+28
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
cam_ids:
2+
- 17197558
3+
cam_aliases:
4+
- cam0
5+
master_cam: 17197558
6+
skip: 5
7+
delay: 0
8+
9+
#Camera info message details
10+
distortion_model: plumb_bob
11+
distortion_coeffs:
12+
- [-0.22001, 0.16693, 0.00261, -0.00099, 0.00000]
13+
#- [-0.17465, 0.03501, 0.00064, -0.00036]
14+
#specified as [fx 0 cx 0 fy cy 0 0 1]
15+
intrinsic_coeffs:
16+
- [1278.71483, 0.0, 623.08283, 0.0, 1284.06247, 515.71835, 0.0, 0.0, 1.0]
17+
#- [638.71023, 0.0, 315.25919, 0.0, 641.21041, 248.26077, 0.0, 0.0, 1.0]
18+
19+
# Assign all the follwing via launch file to prevent confusion and conflict
20+
21+
#save_path: ~/projects/data
22+
#save_type: .bmp #binary or .tiff or .bmp
23+
#binning: 1 # going from 2 to 1 requires cameras to be unplugged and replugged
24+
color: false
25+
#frames: 50
26+
#soft_framerate: 4 # this frame rate reflects to the software frame rate set using ros::rate
27+
#exp: 997
28+
#to_ros: true #When to_ros is not selected, but live is selected, pressing 'space' exports single image to ROS

src/subscriber_node.cpp

+24
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
#include <ros/ros.h>
2+
#include <image_transport/image_transport.h>
3+
#include <opencv2/highgui/highgui.hpp>
4+
#include <cv_bridge/cv_bridge.h>
5+
#include <sensor_msgs/Image.h>
6+
7+
#include <ros/console.h>
8+
9+
10+
void imageCallback(const sensor_msgs::ImageConstPtr& msg)
11+
{
12+
sensor_msgs::Image a =*msg;
13+
double times =a.header.stamp.toSec();
14+
ROS_INFO_STREAM("THE DIFF IS :" << ros::Time::now().toSec() - times);
15+
}
16+
17+
int main(int argc, char **argv)
18+
{
19+
ros::init(argc, argv, "subscriber_node");
20+
ros::NodeHandle nh;
21+
image_transport::ImageTransport it(nh);
22+
image_transport::Subscriber sub = it.subscribe("/camera_array/cam0/image_raw", 1, imageCallback);
23+
ros::spin();
24+
}

0 commit comments

Comments
 (0)