ros jetson_camera/raw image is only black

why image take from node jetson camera/raw only is black image? , this in jetson nano

Hi snek_angel15,

Please elaborate more details of your device system setup, such as BSP version, camera setup, capture command line…etc.

Hi kayccc

JetPack 4.2.2 jetson nano kit

Csi raspberry pi camera

ROS version: MELODIC

From the jetbot_ros package, i ran the jetbot_camera node and subscribed to the jetbot_camera/raw topic with $ rosrun image_view image_view image:=/jetbot_camera/raw, and the image was black.

Could you check if nvgstcapture-1.0 can show the camera preview first.

Hi snek_angel15, I just made some fixes to the jetbot_ros repo, sorry about that. Please remove it from your catkin workspace and re-clone.

You should be able to view the /jetbot_camera/raw topic now.
Also, I added some instructions for viewing the video feed here:

Hello, I’m having the same issue even after removing and re-cloning jetbot_ros. I am using a Sparkfun JetBot. In order to view the camera stream, I used the instructions provided here under the section titled ‘Using the Camera’, but I only receive a black window when running the line ‘rosrun image_view image_view image:=/jetbot_camera/raw’.

As I mentioned, I re-cloned jetbot_ros, and during the build using catkin_make, I noticed some messages that may point to the issue (see below or screenshot link here). Are there possibly still some fixes needed in the jetbot_ros repo?

Scanning dependencies of target jetbot_camera
[  6%] Building CXX object jetbot_ros/CMakeFiles/jetbot_camera.dir/src/jetbot_camera.cpp.o
/home/jetbot/workspace/catkin_ws/src/jetbot_ros/src/jetbot_camera.cpp: In function ‘bool aquireFrame()’:
/home/jetbot/workspace/catkin_ws/src/jetbot_ros/src/jetbot_camera.cpp:47:15: error: ‘class gstCamera’ has no member named ‘CaptureRGBA’; did you mean ‘Capture’?
  if( !camera->CaptureRGBA(&imgRGBA, 1000) )
/home/jetbot/workspace/catkin_ws/src/jetbot_ros/src/jetbot_camera.cpp: In function ‘int main(int, char**)’:
/home/jetbot/workspace/catkin_ws/src/jetbot_ros/src/jetbot_camera.cpp:97:48: error: invalid conversion from ‘const char*’ to ‘int’ [-fpermissive]
  camera = gstCamera::Create(camera_device.c_str());
In file included from /home/jetbot/workspace/catkin_ws/src/jetbot_ros/src/jetbot_camera.cpp:28:0:
/usr/local/include/jetson-utils/gstCamera.h:57:20: note:   initializing argument 1 of ‘static gstCamera* gstCamera::Create(int)’
  static gstCamera* Create( int v4l2_device=-1 ); // use onboard camera by default (>=0 for V4L2)
jetbot_ros/CMakeFiles/jetbot_camera.dir/build.make:62: recipe for target 'jetbot_ros/CMakeFiles/jetbot_camera.dir/src/jetbot_camera.cpp.o' failed
make[2]: *** [jetbot_ros/CMakeFiles/jetbot_camera.dir/src/jetbot_camera.cpp.o] Error 1
CMakeFiles/Makefile2:615: recipe for target 'jetbot_ros/CMakeFiles/jetbot_camera.dir/all' failed
make[1]: *** [jetbot_ros/CMakeFiles/jetbot_camera.dir/all] Error 2
Makefile:140: recipe for target 'all' failed
make: *** [all] Error 2
Invoking "make -j2 -l2" failed