Hello Fred,
I prepared a launch file that uses image_rotate node, this is a complete example, provided that you have phone and laptop connected in husarnet.
<launch>
<node pkg="image_rotate" type="image_rotate" name="image_rotater">
<remap from="image" to="/localimg"/>
<param name="use_camera_info" value="true"/>
<param name="target_x" value="-1"/>
</node>
<node pkg="find_object_2d" type="find_object_2d" name="find_object_2d" output="screen">
<remap from="image" to="/rotated/image"/>
<param name="gui" value="true"/>
</node>
<node pkg="tf" type="static_transform_publisher" name="tf4" args="0 0 0 0 0 0 base_link front 100" />
<node pkg="image_transport" type="republish" name="republish" output="screen" args="compressed in:=/myPhone/camera0/image out:=/localimg">
</node>
</launch>
Moreover image rotate needs camera info to work properly, it can be published with a python script:
#!/usr/bin/env python
import rospy
from sensor_msgs.msg import CameraInfo
from sensor_msgs.msg import Image
import std_msgs.msg
camera_info_msg = 0
def callback(data):
global camera_info_msg
camera_info_msg.header=data.header
camera_info_msg.header.frame_id="front"
publisher.publish(camera_info_msg)
if __name__ == "__main__":
camera_info_msg = CameraInfo()
camera_info_msg.width = 640
camera_info_msg.height = 480
camera_info_msg.K = [0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0]
camera_info_msg.D = []
camera_info_msg.R = [0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0]
camera_info_msg.P = [0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0]
camera_info_msg.distortion_model = ''
# Initialize publisher node
rospy.init_node("camera_info_publisher", anonymous=True)
publisher = rospy.Publisher("camera_info", CameraInfo, queue_size=10)
rospy.Subscriber("localimg", Image, callback)
rospy.spin()
Regards,
Łukasz